primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
128 lines (125 loc) • 3.6 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { PassThrough, PassThroughOption } from 'primeng/api';
/**
* Defines the layout orientation for Splitter component.
* @group Types
*/
type SplitterLayout = 'horizontal' | 'vertical';
/**
* Defines the state storage type for Splitter component.
* @group Types
*/
type SplitterStateStorage = 'session' | 'local';
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link Splitter.pt}
* @group Interface
*/
interface SplitterPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the panel's DOM element.
*/
panel: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the gutter's DOM element.
*/
gutter?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the gutter handle's DOM element.
*/
gutterHandle?: PassThroughOption<HTMLDivElement, I>;
}
/**
* Defines valid pass-through options in Splitter component.
* @see {@link SplitterPassThroughOptions}
*
* @template I Type of instance.
*/
type SplitterPassThrough<I = unknown> = PassThrough<I, SplitterPassThroughOptions<I>>;
/**
* Custom pass-through(pt) options for SplitterPanel.
* @template I Type of instance.
*
* @see {@link SplitterPanel.pt}
* @group Interface
*/
interface SplitterPanelPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLElement, I>;
}
/**
* Defines valid pass-through options in SplitterPanel component.
* @see {@link SplitterPanelPassThroughOptions}
*
* @template I Type of instance.
*/
type SplitterPanelPassThrough<I = unknown> = PassThrough<I, SplitterPanelPassThroughOptions<I>>;
/**
* Custom panel resize start event.
* @see {@link Splitter.onResizeStart}
* @group Events
*/
interface SplitterResizeStartEvent {
/**
* Browser event.
*/
originalEvent: PointerEvent | KeyboardEvent;
/**
* Sizes of the panels, can be percentages, pixels, rem, or other CSS units.
*/
sizes: (number | string)[];
}
/**
* Custom panel resize event, invoked continuously while a gutter is being dragged.
* @see {@link Splitter.onResize}
* @extends {SplitterResizeStartEvent}
* @group Events
*/
interface SplitterResizeEvent extends SplitterResizeStartEvent {
}
/**
* Custom panel resize end event.
* @see {@link Splitter.onResizeEnd}
* @extends {SplitterResizeStartEvent}
* @group Events
*/
interface SplitterResizeEndEvent extends SplitterResizeStartEvent {
}
/**
* Custom collapse event, invoked when a collapsible panel collapses or expands.
* @see {@link Splitter.onCollapse}
* @group Events
*/
interface SplitterCollapseEvent {
/**
* Index of the panel whose collapsed state changed.
*/
index: number;
/**
* Current collapsed state of the panel.
*/
collapsed: boolean;
/**
* Sizes of the panels at the moment the change happened.
*/
sizes: number[];
}
/**
* Defines valid templates in Splitter.
* @group Templates
*/
interface SplitterTemplates {
/**
* Custom panel template.
*/
panel(): TemplateRef<void>;
}
export type { SplitterCollapseEvent, SplitterLayout, SplitterPanelPassThrough, SplitterPanelPassThroughOptions, SplitterPassThrough, SplitterPassThroughOptions, SplitterResizeEndEvent, SplitterResizeEvent, SplitterResizeStartEvent, SplitterStateStorage, SplitterTemplates };