Splitter d.ts updated

pull/3689/head
Bahadır Sofuoğlu 2023-03-01 00:23:26 +03:00
parent b3a7f65af0
commit 0bf8507230
2 changed files with 79 additions and 20 deletions

View File

@ -1,10 +1,19 @@
/**
*
* Splitter is utilized to separate and resize panels.
*
* [Live Demo](https://www.primevue.org/splitter/)
*
* @module splitter
*
*/
import { VNode } from 'vue'; import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type SplitterLayoutType = 'horizontal' | 'vertical' | undefined; /**
* Custom resize start event.
type SplitterStateStorageType = 'local' | 'session' | undefined; * @see resizestar
*/
export interface SplitterResizeStartEvent { export interface SplitterResizeStartEvent {
/** /**
* Browser event * Browser event
@ -16,6 +25,10 @@ export interface SplitterResizeStartEvent {
sizes: number[]; sizes: number[];
} }
/**
* Custom resize end event.
* @see resizeend
*/
export interface SplitterResizeEndEvent { export interface SplitterResizeEndEvent {
/** /**
* Browser event * Browser event
@ -27,16 +40,18 @@ export interface SplitterResizeEndEvent {
sizes: number[]; sizes: number[];
} }
/**
* Defines valid properties in Splitter component.
*/
export interface SplitterProps { export interface SplitterProps {
/** /**
* Orientation of the panels. * Orientation of the panels.
* @see SplitterLayoutType * @defaultValue horizontal
* Default value is 'horizontal'.
*/ */
layout?: SplitterLayoutType; layout?: 'horizontal' | 'vertical' | undefined;
/** /**
* Size of the divider in pixels. * Size of the divider in pixels.
* Default value is 4. * @defaultValue 4
*/ */
gutterSize?: number | undefined; gutterSize?: number | undefined;
/** /**
@ -45,38 +60,55 @@ export interface SplitterProps {
stateKey?: string | undefined; stateKey?: string | undefined;
/** /**
* Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage. * Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
* @see SplitterStateStorageType * @defaultValue session
* Default value is 'session'.
*/ */
stateStorage?: SplitterStateStorageType; stateStorage?: 'local' | 'session' | undefined;
/** /**
* Step factor to increment/decrement the size of the panels while pressing the arrow keys. * Step factor to increment/decrement the size of the panels while pressing the arrow keys.
* Default value is 1. * @defaultValue 1
*/ */
step?: number | undefined; step?: number | undefined;
} }
/**
* Defines valid slots in Splitter slots.
*/
export interface SplitterSlots { export interface SplitterSlots {
/** /**
* Default slot to detect SplitterPanel components. * Default slot to detect SplitterPanel components.
*/ */
default: () => VNode[]; default(): VNode[];
} }
export declare type SplitterEmits = { /**
* Defines valid emits in Splitter component.
*/
export interface SplitterEmits {
/** /**
* Callback to invoke when resize starts. * Callback to invoke when resize starts.
* @param {SplitterResizeStartEvent} event - Custom resize start event. * @param {SplitterResizeStartEvent} event - Custom resize start event.
*/ */
resizestar: (event: SplitterResizeStartEvent) => void; resizestar(event: SplitterResizeStartEvent): void;
/** /**
* Callback to invoke when resize ends. * Callback to invoke when resize ends.
* @param {SplitterResizeEndEvent} event - Custom resize end event. * @param {SplitterResizeEndEvent} event - Custom resize end event.
*/ */
resizeend: (event: SplitterResizeEndEvent) => void; resizeend(event: SplitterResizeEndEvent): void;
}; }
declare class Splitter extends ClassComponent<SplitterProps, SplitterSlots, SplitterEmits> {} /**
* **PrimeVue - Splitter**
*
* _Splitter is utilized to separate and resize panels._
*
* [Live Demo](https://www.primevue.org/splitter/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
export declare class Splitter extends ClassComponent<SplitterProps, SplitterSlots, SplitterEmits> {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
interface GlobalComponents { interface GlobalComponents {

View File

@ -1,6 +1,18 @@
/**
*
* SplitterPanel is a helper component for Splitter component.
*
* [Live Demo](https://www.primevue.org/splitter/)
*
* @module splitterpanel
*
*/
import { VNode } from 'vue'; import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
/**
* Defines valid properties in SplitterPanel component.
*/
export interface SplitterPanelProps { export interface SplitterPanelProps {
/** /**
* Size of the element relative to 100%. * Size of the element relative to 100%.
@ -12,6 +24,9 @@ export interface SplitterPanelProps {
minSize?: number | undefined; minSize?: number | undefined;
} }
/**
* Defines valid slots in SplitterPanel slots.
*/
export interface SplitterPanelSlots { export interface SplitterPanelSlots {
/** /**
* Custom content template. * Custom content template.
@ -19,9 +34,21 @@ export interface SplitterPanelSlots {
default: () => VNode[]; default: () => VNode[];
} }
export declare type SplitterPanelEmits = {}; export interface SplitterPanelEmits {}
declare class SplitterPanel extends ClassComponent<SplitterPanelProps, SplitterPanelSlots, SplitterPanelEmits> {} /**
* **PrimeVue - SplitterPanel**
*
* _SplitterPanel is a helper component for Splitter component._
*
* [Live Demo](https://www.primevue.org/splitterpanel/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
export declare class SplitterPanel extends ClassComponent<SplitterPanelProps, SplitterPanelSlots, SplitterPanelEmits> {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
interface GlobalComponents { interface GlobalComponents {