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/breadcrumb/Breadcrumb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevu
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { MenuItem } from 'primevue/menuitem';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue';

export declare type BreadcrumbPassThroughOptionType = BreadcrumbPassThroughAttributes | ((options: BreadcrumbPassThroughMethodOptions) => BreadcrumbPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -131,15 +131,15 @@ export interface BreadcrumbRouterBindProps {
/**
* Defines valid properties in Breadcrumb component.
*/
export interface BreadcrumbProps {
export interface BreadcrumbProps<T extends MenuItem = MenuItem> {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
model?: T[] | undefined;
/**
* Configuration for the home icon.
*/
home?: MenuItem | undefined;
home?: T | undefined;
/**
* Defines a string value that labels an interactive element.
*/
Expand Down Expand Up @@ -172,7 +172,7 @@ export interface BreadcrumbProps {
/**
* Defines valid slots in Breadcrumb component.
*/
export interface BreadcrumbSlots {
export interface BreadcrumbSlots<T extends MenuItem = MenuItem> {
/**
* Custom item template.
* @param {Object} scope - item slot's params.
Expand All @@ -181,7 +181,7 @@ export interface BreadcrumbSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Label property of the menuitem
*/
Expand All @@ -203,7 +203,7 @@ export interface BreadcrumbSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Style class of the item icon element.
*/
Expand All @@ -230,11 +230,19 @@ export declare type BreadcrumbEmits = EmitFn<BreadcrumbEmitsOptions>;
* @group Component
*
*/
declare const Breadcrumb: DefineComponent<BreadcrumbProps, BreadcrumbSlots, BreadcrumbEmits>;
declare const Breadcrumb: {
new <T extends MenuItem = MenuItem>(
props: BreadcrumbProps<T>
): {
$props: BreadcrumbProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: BreadcrumbSlots<T>;
$emit: EmitFn<BreadcrumbEmitsOptions>;
};
};

declare module 'vue' {
export interface GlobalComponents {
Breadcrumb: DefineComponent<BreadcrumbProps, BreadcrumbSlots, BreadcrumbEmits>;
Breadcrumb: typeof Breadcrumb;
}
}

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

export declare type ContextMenuPassThroughOptionType = ContextMenuPassThroughAttributes | ((options: ContextMenuPassThroughMethodOptions) => ContextMenuPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -222,11 +222,11 @@ export interface ContextMenuRouterBindProps {
/**
* Defines valid properties in ContextMenu component.
*/
export interface ContextMenuProps {
export interface ContextMenuProps<T extends MenuItem = MenuItem> {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
model?: T[] | undefined;
/**
* The breakpoint to define the maximum width boundary.
* @defaultValue 960px
Expand Down Expand Up @@ -288,7 +288,7 @@ export interface ContextMenuProps {
/**
* Defines valid slots in ContextMenu component.
*/
export interface ContextMenuSlots {
export interface ContextMenuSlots<T extends MenuItem = MenuItem> {
/**
* Custom item template.
* @param {Object} scope - item slot's params.
Expand All @@ -297,7 +297,7 @@ export interface ContextMenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Label property of the menuitem
*/
Expand All @@ -319,7 +319,7 @@ export interface ContextMenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Style class of the item icon element.
*/
Expand Down Expand Up @@ -407,11 +407,19 @@ export interface ContextMenuMethods {
* @group Component
*
*/
declare const ContextMenu: DefineComponent<ContextMenuProps, ContextMenuSlots, ContextMenuEmits, ContextMenuMethods>;
declare const ContextMenu: {
new <T extends MenuItem = MenuItem>(
props: ContextMenuProps<T>
): {
$props: ContextMenuProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: ContextMenuSlots<T>;
$emit: EmitFn<ContextMenuEmitsOptions>;
} & ContextMenuMethods;
};

declare module 'vue' {
export interface GlobalComponents {
ContextMenu: DefineComponent<ContextMenuProps, ContextMenuSlots, ContextMenuEmits, ContextMenuMethods>;
ContextMenu: typeof ContextMenu;
}
}

Expand Down
26 changes: 17 additions & 9 deletions packages/primevue/src/dock/Dock.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 { MenuItem } from 'primevue/menuitem';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue';

export declare type DockPassThroughOptionType = DockPassThroughAttributes | ((options: DockPassThroughMethodOptions) => DockPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -176,11 +176,11 @@ export interface DockRouterBindProps {
/**
* Defines valid properties in Dock component.
*/
export interface DockProps {
export interface DockProps<T extends MenuItem = MenuItem> {
/**
* MenuModel instance to define the action items.
*/
model?: MenuItem[] | undefined;
model?: T[] | undefined;
/**
* Position of element.
* @defaultValue bottom
Expand Down Expand Up @@ -244,7 +244,7 @@ export interface DockProps {
/**
* Defines valid slots in Dock component.
*/
export interface DockSlots {
export interface DockSlots<T extends MenuItem = MenuItem> {
/**
* Custom item content.
* @param {Object} scope - item slot's params.
Expand All @@ -253,7 +253,7 @@ export interface DockSlots {
/**
* Custom content for item.
*/
item: MenuItem;
item: T;
/**
* Index of the menuitem
*/
Expand All @@ -276,7 +276,7 @@ export interface DockSlots {
/**
* Custom content for item icon.
*/
item: MenuItem;
item: T;
}): VNode[];
/**
* Custom icon content.
Expand All @@ -286,7 +286,7 @@ export interface DockSlots {
/**
* Custom content for item icon.
*/
item: MenuItem;
item: T;
}): VNode[];
}

Expand Down Expand Up @@ -320,11 +320,19 @@ export declare type DockEmits = EmitFn<DockEmitsOptions>;
* @group Component
*
*/
declare const Dock: DefineComponent<DockProps, DockSlots, DockEmits>;
declare const Dock: {
new <T extends MenuItem = MenuItem>(
props: DockProps<T>
): {
$props: DockProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: DockSlots<T>;
$emit: EmitFn<DockEmitsOptions>;
};
};

declare module 'vue' {
export interface GlobalComponents {
Dock: DefineComponent<DockProps, DockSlots, DockEmits>;
Dock: typeof Dock;
}
}

Expand Down
24 changes: 16 additions & 8 deletions packages/primevue/src/megamenu/MegaMenu.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 { MenuItem } from 'primevue/menuitem';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, VNode, VNodeProps } from 'vue';

export declare type MegaMenuPassThroughOptionType = MegaMenuPassThroughAttributes | ((options: MegaMenuPassThroughMethodOptions) => MegaMenuPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -237,11 +237,11 @@ export interface MegaMenuRouterBindProps {
/**
* Defines valid properties in MegaMenu component.
*/
export interface MegaMenuProps {
export interface MegaMenuProps<T extends MenuItem = MenuItem> {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
model?: T[] | undefined;
/**
* Defines the orientation.
* @defaultValue horizontal
Expand Down Expand Up @@ -298,7 +298,7 @@ export interface MegaMenuProps {
/**
* Defines valid slots in MegaMenu component.
*/
export interface MegaMenuSlots {
export interface MegaMenuSlots<T extends MenuItem = MenuItem> {
/**
* Custom start template.
*/
Expand All @@ -315,7 +315,7 @@ export interface MegaMenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Label property of the menuitem
*/
Expand Down Expand Up @@ -369,7 +369,7 @@ export interface MegaMenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Style class of the item icon element.
*/
Expand Down Expand Up @@ -407,11 +407,19 @@ export declare type MegaMenuEmits = EmitFn<MegaMenuEmitsOptions>;
* @group Component
*
*/
declare const MegaMenu: DefineComponent<MegaMenuProps, MegaMenuSlots, MegaMenuEmits>;
declare const MegaMenu: {
new <T extends MenuItem = MenuItem>(
props: MegaMenuProps<T>
): {
$props: MegaMenuProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: MegaMenuSlots<T>;
$emit: EmitFn<MegaMenuEmitsOptions>;
};
};

declare module 'vue' {
export interface GlobalComponents {
MegaMenu: DefineComponent<MegaMenuProps, MegaMenuSlots, MegaMenuEmits>;
MegaMenu: typeof MegaMenu;
}
}

Expand Down
26 changes: 17 additions & 9 deletions packages/primevue/src/menu/Menu.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 { MenuItem } from 'primevue/menuitem';
import type { PassThroughOptions } from 'primevue/passthrough';
import { TransitionProps, VNode } from 'vue';
import { AllowedComponentProps, ComponentCustomProps, TransitionProps, VNode, VNodeProps } from 'vue';

export declare type MenuPassThroughOptionType = MenuPassThroughAttributes | ((options: MenuPassThroughMethodOptions) => MenuPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -191,11 +191,11 @@ export interface MenuRouterBindProps {
/**
* Defines valid properties in Menu component.
*/
export interface MenuProps {
export interface MenuProps<T extends MenuItem = MenuItem> {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
model?: T[] | undefined;
/**
* Defines if menu would displayed as a popup.
* @defaultValue false
Expand Down Expand Up @@ -252,7 +252,7 @@ export interface MenuProps {
/**
* Defines valid slots in Menu component.
*/
export interface MenuSlots {
export interface MenuSlots<T extends MenuItem = MenuItem> {
/**
* Custom start template.
*/
Expand All @@ -269,7 +269,7 @@ export interface MenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Label property of the menuitem
*/
Expand All @@ -287,7 +287,7 @@ export interface MenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
/**
* Style class of the item icon element.
*/
Expand All @@ -302,7 +302,7 @@ export interface MenuSlots {
/**
* Menuitem instance
*/
item: MenuItem;
item: T;
}): VNode[];
}

Expand Down Expand Up @@ -371,11 +371,19 @@ export interface MenuMethods {
* @group Component
*
*/
declare const Menu: DefineComponent<MenuProps, MenuSlots, MenuEmits, MenuMethods>;
declare const Menu: {
new <T extends MenuItem = MenuItem>(
props: MenuProps<T>
): {
$props: MenuProps<T> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
$slots: MenuSlots<T>;
$emit: EmitFn<MenuEmitsOptions>;
} & MenuMethods;
};

declare module 'vue' {
export interface GlobalComponents {
Menu: DefineComponent<MenuProps, MenuSlots, MenuEmits, MenuMethods>;
Menu: typeof Menu;
}
}

Expand Down
Loading