diff --git a/packages/primevue/src/listbox/Listbox.d.ts b/packages/primevue/src/listbox/Listbox.d.ts index 97eaa01132..708f34d580 100755 --- a/packages/primevue/src/listbox/Listbox.d.ts +++ b/packages/primevue/src/listbox/Listbox.d.ts @@ -14,7 +14,7 @@ import type { InputIconPassThroughOptions } from 'primevue/inputicon'; import type { InputTextPassThroughOptions } from 'primevue/inputtext'; import type { PassThroughOptions } from 'primevue/passthrough'; import type { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from 'primevue/virtualscroller'; -import { VNode } from 'vue'; +import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue'; export declare type ListboxPassThroughOptionType = ListboxPassThroughAttributes | ((options: ListboxPassThroughMethodOptions) => ListboxPassThroughAttributes | string) | string | null | undefined; @@ -258,7 +258,7 @@ export interface ListboxContext { /** * Defines valid properties in Listbox component. */ -export interface ListboxProps { +export interface ListboxProps { /** * Value of the component. */ @@ -274,27 +274,27 @@ export interface ListboxProps { /** * An array of selectitems to display as the available options. */ - options?: any[] | undefined; + options?: T[] | undefined; /** * Property name or getter function to use as the label of an option. */ - optionLabel?: string | ((data: any) => string) | undefined; + optionLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function to use as the value of an option, defaults to the option itself when not defined. */ - optionValue?: string | ((data: any) => any) | undefined; + optionValue?: string | ((data: T) => any) | undefined; /** * Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. */ - optionDisabled?: string | ((data: any) => boolean) | undefined; + optionDisabled?: string | ((data: T) => boolean) | undefined; /** * Property name or getter function to use as the label of an option group. */ - optionGroupLabel?: string | ((data: any) => string) | undefined; + optionGroupLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function that refers to the children options of option group. */ - optionGroupChildren?: string | ((data: any) => any[]) | undefined; + optionGroupChildren?: string | ((data: T) => any[]) | undefined; /** * Inline style of inner list element. */ @@ -460,7 +460,7 @@ export interface ListboxProps { /** * Defines valid slots in Listbox component. */ -export interface ListboxSlots { +export interface ListboxSlots { /** * Custom header template. * @param {Object} scope - header slot's params. @@ -473,7 +473,7 @@ export interface ListboxSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom footer template. @@ -487,7 +487,7 @@ export interface ListboxSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom option template. @@ -497,7 +497,7 @@ export interface ListboxSlots { /** * Option instance */ - option: any; + option: T; /** * Selection state */ @@ -515,7 +515,7 @@ export interface ListboxSlots { /** * Option instance */ - option: any; + option: T; /** * Index of the option */ @@ -562,7 +562,7 @@ export interface ListboxSlots { /** * Options of the loader items for virtualscroller */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom filter icon template. @@ -636,11 +636,19 @@ export declare type ListboxEmits = EmitFn; * @group Component * */ -declare const Listbox: DefineComponent; +declare const Listbox: { + new ( + props: ListboxProps + ): { + $props: ListboxProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; + $slots: ListboxSlots; + $emit: EmitFn; + }; +}; declare module 'vue' { export interface GlobalComponents { - Listbox: DefineComponent; + Listbox: typeof Listbox; } } diff --git a/packages/primevue/src/multiselect/MultiSelect.d.ts b/packages/primevue/src/multiselect/MultiSelect.d.ts index 8d36e0cbc3..d6c1535055 100755 --- a/packages/primevue/src/multiselect/MultiSelect.d.ts +++ b/packages/primevue/src/multiselect/MultiSelect.d.ts @@ -15,7 +15,7 @@ import type { InputIconPassThroughOptions } from 'primevue/inputicon'; import type { InputTextPassThroughOptions } from 'primevue/inputtext'; import type { PassThroughOptions } from 'primevue/passthrough'; import type { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from 'primevue/virtualscroller'; -import { TransitionProps, VNode } from 'vue'; +import { AllowedComponentProps, ComponentCustomProps, TransitionProps, VNode, VNodeProps } from 'vue'; export declare type MultiSelectPassThroughOptionType = MultiSelectPassThroughAttributes | ((options: MultiSelectPassThroughMethodOptions) => MultiSelectPassThroughAttributes | string) | string | null | undefined; @@ -315,7 +315,7 @@ export interface MultiSelectContext { /** * Defines valid properties in MultiSelect component. */ -export interface MultiSelectProps { +export interface MultiSelectProps { /** * Value of the component. */ @@ -331,27 +331,27 @@ export interface MultiSelectProps { /** * An array of select items to display as the available options. */ - options?: any[] | undefined; + options?: T[] | undefined; /** * Property name or getter function to use as the label of an option. */ - optionLabel?: string | ((data: any) => string) | undefined; + optionLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function to use as the value of an option, defaults to the option itself when not defined. */ - optionValue?: string | ((data: any) => any) | undefined; + optionValue?: string | ((data: T) => any) | undefined; /** * Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. */ - optionDisabled?: string | ((data: any) => boolean) | undefined; + optionDisabled?: string | ((data: T) => boolean) | undefined; /** * Property name or getter function to use as the label of an option group. */ - optionGroupLabel?: string | ((data: any) => string) | undefined; + optionGroupLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function that refers to the children options of option group. */ - optionGroupChildren?: string | ((data: any) => any[]) | undefined; + optionGroupChildren?: string | ((data: T) => any[]) | undefined; /** * Height of the viewport, a scrollbar is defined if height of list exceeds this value. * @defaultValue 14rem @@ -604,7 +604,7 @@ export interface MultiSelectProps { /** * Defines valid slots in MultiSelect component. */ -export interface MultiSelectSlots { +export interface MultiSelectSlots { /** * Custom value template. * @param {Object} scope - value slot's params. @@ -647,7 +647,7 @@ export interface MultiSelectSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom footer template. @@ -661,7 +661,7 @@ export interface MultiSelectSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom option template. @@ -671,7 +671,7 @@ export interface MultiSelectSlots { /** * Option instance */ - option: any; + option: T; /** * Selection state */ @@ -689,7 +689,7 @@ export interface MultiSelectSlots { /** * Option instance */ - option: any; + option: T; /** * Index of the option */ @@ -736,7 +736,7 @@ export interface MultiSelectSlots { /** * Options of the loader items for virtualscroller */ - options: any[]; + options: T[]; }): VNode[]; /** * @deprecated since v4.0. Use 'chipicon' slot instead. @@ -938,11 +938,19 @@ export interface MultiSelectMethods { * @group Component * */ -declare const MultiSelect: DefineComponent; +declare const MultiSelect: { + new ( + props: MultiSelectProps + ): { + $props: MultiSelectProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; + $slots: MultiSelectSlots; + $emit: EmitFn; + } & MultiSelectMethods; +}; declare module 'vue' { export interface GlobalComponents { - MultiSelect: DefineComponent; + MultiSelect: typeof MultiSelect; } } diff --git a/packages/primevue/src/select/Select.d.ts b/packages/primevue/src/select/Select.d.ts index a31edd4e50..432d4acfb1 100755 --- a/packages/primevue/src/select/Select.d.ts +++ b/packages/primevue/src/select/Select.d.ts @@ -14,7 +14,7 @@ import type { InputIconPassThroughOptions } from 'primevue/inputicon'; import type { InputTextPassThroughOptions } from 'primevue/inputtext'; import type { PassThroughOptions } from 'primevue/passthrough'; import type { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from 'primevue/virtualscroller'; -import { TransitionProps, VNode } from 'vue'; +import { AllowedComponentProps, ComponentCustomProps, TransitionProps, VNode, VNodeProps } from 'vue'; export declare type SelectPassThroughOptionType = SelectPassThroughAttributes | ((options: SelectPassThroughMethodOptions) => SelectPassThroughAttributes | string) | string | null | undefined; @@ -290,7 +290,7 @@ export interface SelectContext { /** * Defines valid properties in Select component. */ -export interface SelectProps { +export interface SelectProps { /** * Value of the component. */ @@ -306,27 +306,27 @@ export interface SelectProps { /** * An array of select items to display as the available options. */ - options?: any[]; + options?: T[]; /** * Property name or getter function to use as the label of an option. */ - optionLabel?: string | ((data: any) => string) | undefined; + optionLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function to use as the value of an option, defaults to the option itself when not defined. */ - optionValue?: string | ((data: any) => any) | undefined; + optionValue?: string | ((data: T) => any) | undefined; /** * Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. */ - optionDisabled?: string | ((data: any) => boolean) | undefined; + optionDisabled?: string | ((data: T) => boolean) | undefined; /** * Property name or getter function to use as the label of an option group. */ - optionGroupLabel?: string | ((data: any) => string) | undefined; + optionGroupLabel?: string | ((data: T) => string) | undefined; /** * Property name or getter function that refers to the children options of option group. */ - optionGroupChildren?: string | ((data: any) => any[]) | undefined; + optionGroupChildren?: string | ((data: T) => any[]) | undefined; /** * Height of the viewport, a scrollbar is defined if height of list exceeds this value. * @defaultValue 14rem @@ -576,7 +576,7 @@ export interface SelectProps { /** * Defines valid slots in Select component. */ -export interface SelectSlots { +export interface SelectSlots { /** * Custom value template. * @param {Object} scope - value slot's params. @@ -603,7 +603,7 @@ export interface SelectSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom footer template of panel. @@ -617,7 +617,7 @@ export interface SelectSlots { /** * Displayed options */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom option template. @@ -627,7 +627,7 @@ export interface SelectSlots { /** * Option instance */ - option: any; + option: T; /** * Selection state */ @@ -645,7 +645,7 @@ export interface SelectSlots { /** * Option instance */ - option: any; + option: T; /** * Index of the option */ @@ -692,7 +692,7 @@ export interface SelectSlots { /** * Options of the loader items for virtualscroller */ - options: any[]; + options: T[]; }): VNode[]; /** * Custom clear icon template. @@ -822,11 +822,19 @@ export interface SelectMethods { * @group Component * */ -declare const Select: DefineComponent; +declare const Select: { + new ( + props: SelectProps + ): { + $props: SelectProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; + $slots: SelectSlots; + $emit: EmitFn; + } & SelectMethods; +}; declare module 'vue' { export interface GlobalComponents { - Select: DefineComponent; + Select: typeof Select; } }