From 7755627c4cf91753aef4824223fcf0f18786674f Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 1 Dec 2021 23:54:30 +0300 Subject: [PATCH] Fixed #1836 - For TabMenu --- src/components/tabmenu/TabMenu.d.ts | 73 +++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/src/components/tabmenu/TabMenu.d.ts b/src/components/tabmenu/TabMenu.d.ts index 91b0a034d..729d3877d 100755 --- a/src/components/tabmenu/TabMenu.d.ts +++ b/src/components/tabmenu/TabMenu.d.ts @@ -1,18 +1,71 @@ -interface TabMenuProps { - model?: any[]; - exact?: boolean; - activeIndex?: number; +import { VNode } from 'vue'; +import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +import { MenuItem } from '../menuitem'; + +export interface TabMenuChangeEvent { + /** + * Browser event + */ + originalEvent: Event; + /** + * Index of the selected tab + */ + index: number; } -interface TabMenuItemSlotInterface { - item: any; +export interface TabMenuProps { + /** + * An array of menuitems. + */ + model?: MenuItem[] | undefined; + /** + * Defines if active route highlight should match the exact route path. + * Default value is true. + */ + exact?: boolean | undefined; + /** + * Active index of menuitem. + * Default value is 0. + */ + activeIndex?: number | undefined; } -declare class TabMenu { - $props: TabMenuProps; - $slots: { - item: TabMenuItemSlotInterface; +export interface TabMenuSlots { + /** + * Custom content for each item. + * @param {Object} scope - item slot's params. + */ + item: (scope: { + /** + * Menuitem instance + */ + item: MenuItem; + }) => VNode[]; +} + +export declare type TabMenuEmits = { + /** + * Callback to invoke when an active tab is changed. + * @param {TabMenuChangeEvent} event - Custom tab change event. + */ + 'tab-change': (event: TabMenuChangeEvent) => void; +} + +declare class TabMenu extends ClassComponent { } + +declare module '@vue/runtime-core' { + interface GlobalComponents { + TabMenu: GlobalComponentConstructor } } +/** + * + * TabMenu is a navigation component that displays items as tab headers. Example below uses nested routes with TabMenu. + * + * Demos: + * + * - [TabMenu](https://www.primefaces.org/primevue/showcase/#/tabmenu) + * + */ export default TabMenu;