Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions packages/primevue/src/inputchips/InputChips.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough }
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { ChipPassThroughOptions } from 'primevue/chip';
import type { PassThroughOptions } from 'primevue/passthrough';
import { InputHTMLAttributes, VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, InputHTMLAttributes, VNode, VNodeProps } from 'vue';

export declare type InputChipsPassThroughOptionType = InputChipsPassThroughAttributes | ((options: InputChipsPassThroughMethodOptions) => InputChipsPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -155,11 +155,11 @@ export interface InputChipsState {
/**
* Defines valid properties in InputChips component.
*/
export interface InputChipsProps {
export interface InputChipsProps<T = any> {
/**
* Value of the component.
*/
modelValue?: any[];
modelValue?: T[];
/**
* Maximum number of entries allowed.
*/
Expand Down Expand Up @@ -252,7 +252,7 @@ export interface InputChipsProps {
/**
* Defines valid slots in InputChips slots.
*/
export interface InputChipsSlots {
export interface InputChipsSlots<T = any> {
/**
* Custom chip template.
* @param {Object} scope - chip slot's params.
Expand All @@ -261,7 +261,7 @@ export interface InputChipsSlots {
/**
* Value of the component
*/
value: any;
value: T;
}): VNode[];
/**
* @deprecated since v4.0. Use 'chipicon' slot.
Expand Down Expand Up @@ -338,11 +338,19 @@ export declare type InputChipsEmits = EmitFn<InputChipsEmitsOptions>;
* @group Component
*
*/
declare const InputChips: DefineComponent<InputChipsProps, InputChipsSlots, InputChipsEmits>;
declare const InputChips: {
new <T = any>(
props: InputChipsProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps
): {
$props: InputChipsProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: InputChipsSlots<T>;
$emit: InputChipsEmits;
};
};

declare module 'vue' {
export interface GlobalComponents {
InputChips: DefineComponent<InputChipsProps, InputChipsSlots, InputChipsEmits>;
InputChips: typeof InputChips;
}
}

Expand Down
28 changes: 18 additions & 10 deletions packages/primevue/src/selectbutton/SelectButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue';
// import { ToggleButtonPassThroughOptions } from 'primevue/togglebutton';
import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core';

Expand Down Expand Up @@ -120,7 +120,7 @@ export interface SelectButtonState {
/**
* Defines valid properties in SelectButton component.
*/
export interface SelectButtonProps {
export interface SelectButtonProps<T = any> {
/**
* Value of the component.
*/
Expand All @@ -136,19 +136,19 @@ export interface SelectButtonProps {
/**
* 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;
/**
* When specified, allows selecting multiple values.
* @defaultValue false
Expand Down Expand Up @@ -214,7 +214,7 @@ export interface SelectButtonProps {
/**
* Defines valid slots in SelectButton component.
*/
export interface SelectButtonSlots {
export interface SelectButtonSlots<T = any> {
/**
* Custom content for each option.
* @param {Object} scope - option slot's params.
Expand All @@ -223,7 +223,7 @@ export interface SelectButtonSlots {
/**
* Option instance
*/
option: any;
option: T;
/**
* Index of the option
*/
Expand Down Expand Up @@ -275,11 +275,19 @@ export declare type SelectButtonEmits = EmitFn<SelectButtonEmitsOptions>;
* @group Component
*
*/
declare const SelectButton: DefineComponent<SelectButtonProps, SelectButtonSlots, SelectButtonEmits>;
declare const SelectButton: {
new <T = any>(
props: SelectButtonProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps
): {
$props: SelectButtonProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: SelectButtonSlots<T>;
$emit: SelectButtonEmits;
};
};

declare module 'vue' {
export interface GlobalComponents {
SelectButton: DefineComponent<SelectButtonProps, SelectButtonSlots, SelectButtonEmits>;
SelectButton: typeof SelectButton;
}
}

Expand Down
24 changes: 16 additions & 8 deletions packages/primevue/src/virtualscroller/VirtualScroller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue';

export declare type VirtualScrollerPassThroughOptionType = VirtualScrollerPassThroughAttributes | ((options: VirtualScrollerPassThroughMethodOptions) => VirtualScrollerPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -222,7 +222,7 @@ export interface VirtualScrollerLoaderOptions extends VirtualScrollerItemOptions
/**
* Defines valid properties in VirtualScroller component.
*/
export interface VirtualScrollerProps {
export interface VirtualScrollerProps<T = any> {
/**
* Unique identifier of the element.
*/
Expand All @@ -238,7 +238,7 @@ export interface VirtualScrollerProps {
/**
* An array of objects to display.
*/
items?: any[] | any[][] | undefined | null;
items?: T[] | T[][] | undefined | null;
/**
* The height/width of item according to orientation.
*/
Expand Down Expand Up @@ -356,7 +356,7 @@ export interface VirtualScrollerProps {
/**
* Defines valid slots in VirtualScroller component.
*/
export interface VirtualScrollerSlots {
export interface VirtualScrollerSlots<T = any> {
/**
* Custom content template.
* @param {Object} scope - content slot's params.
Expand All @@ -365,7 +365,7 @@ export interface VirtualScrollerSlots {
/**
* An array of objects to display for virtualscroller
*/
items: any;
items: T[];
/**
* Style class of the content
*/
Expand Down Expand Up @@ -433,7 +433,7 @@ export interface VirtualScrollerSlots {
/**
* Item data.
*/
item: any;
item: T;
/**
* Item options.
*/
Expand Down Expand Up @@ -526,11 +526,19 @@ export interface VirtualScrollerMethods {
* @group Component
*
*/
declare const VirtualScroller: DefineComponent<VirtualScrollerProps, VirtualScrollerSlots, VirtualScrollerEmits, VirtualScrollerMethods>;
declare const VirtualScroller: {
new <T = any>(
props: VirtualScrollerProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps
): {
$props: VirtualScrollerProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: VirtualScrollerSlots<T>;
$emit: VirtualScrollerEmits;
} & VirtualScrollerMethods;
};

declare module 'vue' {
export interface GlobalComponents {
VirtualScroller: DefineComponent<VirtualScrollerProps, VirtualScrollerSlots, VirtualScrollerEmits, VirtualScrollerMethods>;
VirtualScroller: typeof VirtualScroller;
}
}

Expand Down