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
26 changes: 17 additions & 9 deletions packages/primevue/src/orderlist/OrderList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { ButtonPassThroughOptions, ButtonProps } from 'primevue/button';
import type { ListboxPassThroughOptions } from 'primevue/listbox';
import type { PassThroughOptions } from 'primevue/passthrough';
import { TransitionProps, VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, TransitionProps, VNode, VNodeProps } from 'vue';

export declare type OrderListPassThroughOptionType = OrderListPassThroughAttributes | ((options: OrderListPassThroughMethodOptions) => OrderListPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -169,19 +169,19 @@ export interface OrderListState {
/**
* Defines valid properties in OrderList component.
*/
export interface OrderListProps {
export interface OrderListProps<T = any> {
/**
* Value of the component.
*/
modelValue?: any[];
modelValue?: T[];
/**
* Name of the field that uniquely identifies the a record in the data.
*/
dataKey?: string | undefined;
/**
* Selected items in the list.
*/
selection?: any[];
selection?: T[];
/**
* Defines whether metaKey is required or not for the selection.
* When true metaKey needs to be pressed to select or unselect an item and
Expand Down Expand Up @@ -281,7 +281,7 @@ export interface OrderListProps {
/**
* Defines valid slots in OrderList component.
*/
export interface OrderListSlots {
export interface OrderListSlots<T = any> {
/**
* Custom header template.
*/
Expand All @@ -295,7 +295,7 @@ export interface OrderListSlots {
/**
* Item of the component
*/
item: any;
item: T;
/**
* Selection state
*/
Expand All @@ -313,7 +313,7 @@ export interface OrderListSlots {
/**
* Option of the component
*/
option: any;
option: T;
/**
* Selection state
*/
Expand Down Expand Up @@ -389,11 +389,19 @@ export declare type OrderListEmits = EmitFn<OrderListEmitsOptions>;
* @group Component
*
*/
declare const OrderList: DefineComponent<OrderListProps, OrderListSlots, OrderListEmits>;
declare const OrderList: {
new <T = any>(
props: OrderListProps<T>
): {
$props: OrderListProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: OrderListSlots<T>;
$emit: EmitFn<OrderListEmitsOptions>;
};
};

declare module 'vue' {
export interface GlobalComponents {
OrderList: DefineComponent<OrderListProps, OrderListSlots, OrderListEmits>;
OrderList: typeof OrderList;
}
}

Expand Down
26 changes: 17 additions & 9 deletions packages/primevue/src/picklist/PickList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { ButtonPassThroughOptions } from 'primevue/button';
import type { ListboxPassThroughOptions } from 'primevue/listbox';
import type { PassThroughOptions } from 'primevue/passthrough';
import { TransitionProps, VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, TransitionProps, VNode, VNodeProps } from 'vue';

export declare type PickListPassThroughOptionType = PickListPassThroughAttributes | ((options: PickListPassThroughMethodOptions) => PickListPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -290,15 +290,15 @@ export interface PickListContext {
/**
* Defines valid properties in PickList component.
*/
export interface PickListProps {
export interface PickListProps<T = any> {
/**
* Value of the component as a multidimensional array.
*/
modelValue?: any[][] | undefined;
modelValue?: T[][] | undefined;
/**
* Selected items in the list as a multidimensional array.
*/
selection?: any[][] | undefined;
selection?: T[][] | undefined;
/**
* Name of the field that uniquely identifies the a record in the data.
*/
Expand Down Expand Up @@ -420,7 +420,7 @@ export interface PickListProps {
/**
* Defines valid slots in PickList component.
*/
export interface PickListSlots {
export interface PickListSlots<T = any> {
/**
* Custom header template.
*/
Expand All @@ -434,7 +434,7 @@ export interface PickListSlots {
/**
* Item of the component
*/
item: any;
item: T;
/**
* Selection state
*/
Expand All @@ -452,7 +452,7 @@ export interface PickListSlots {
/**
* Option of the component
*/
option: any;
option: T;
/**
* Selection state
*/
Expand Down Expand Up @@ -612,11 +612,19 @@ export declare type PickListEmits = EmitFn<PickListEmitsOptions>;
* @group Component
*
*/
declare const PickList: DefineComponent<PickListProps, PickListSlots, PickListEmits>;
declare const PickList: {
new <T = any>(
props: PickListProps<T>
): {
$props: PickListProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: PickListSlots<T>;
$emit: EmitFn<PickListEmitsOptions>;
};
};

declare module 'vue' {
export interface GlobalComponents {
PickList: DefineComponent<PickListProps, PickListSlots, PickListEmits>;
PickList: typeof PickList;
}
}

Expand Down