diff --git a/.eslintrc.js b/.eslintrc.js index d002974d3b..aad5131ec5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,5 +95,19 @@ module.exports = { { blankLine: 'always', prev: '*', next: 'block-like' }, { blankLine: 'always', prev: ['import'], next: ['const', 'let', 'var'] } ] - } + }, + overrides: [ + { + files: ['*.typedef.vue'], + extends: ['plugin:vue/vue3-recommended', '@vue/eslint-config-typescript', 'plugin:@typescript-eslint/recommended-type-checked'], + parser: 'vue-eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + parser: '@typescript-eslint/parser', + project: ['tsconfig.lint.json'], + extraFileExtensions: ['.vue'] + } + } + ] }; diff --git a/packages/primevue/src/menu/Menu.d.ts b/packages/primevue/src/menu/Menu.d.ts index 87db222128..b75f1fbf73 100755 --- a/packages/primevue/src/menu/Menu.d.ts +++ b/packages/primevue/src/menu/Menu.d.ts @@ -7,7 +7,7 @@ * @module menu * */ -import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core'; +import type { DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core'; import type { ComponentHooks } from '@primevue/core/basecomponent'; import type { MenuItem } from 'primevue/menuitem'; import type { PassThroughOptions } from 'primevue/passthrough'; @@ -191,11 +191,11 @@ export interface MenuRouterBindProps { /** * Defines valid properties in Menu component. */ -export interface MenuProps { +export interface MenuProps { /** * An array of menuitems. */ - model?: MenuItem[] | undefined; + model?: Item[] | undefined; /** * Defines if menu would displayed as a popup. * @defaultValue false @@ -252,7 +252,7 @@ export interface MenuProps { /** * Defines valid slots in Menu component. */ -export interface MenuSlots { +export interface MenuSlots { /** * Custom start template. */ @@ -269,7 +269,7 @@ export interface MenuSlots { /** * Menuitem instance */ - item: MenuItem; + item: Item; /** * Label property of the menuitem */ @@ -287,7 +287,7 @@ export interface MenuSlots { /** * Menuitem instance */ - item: MenuItem; + item: Item; /** * Style class of the item icon element. */ @@ -302,7 +302,7 @@ export interface MenuSlots { /** * Menuitem instance */ - item: MenuItem; + item: Item; }): VNode[]; /** * Custom submenu item template. @@ -312,7 +312,7 @@ export interface MenuSlots { /** * Menuitem instance */ - item: MenuItem; + item: Item; }): VNode[]; } @@ -370,11 +370,11 @@ export interface MenuMethods { * @group Component * */ -declare const Menu: DefineComponent; +declare const Menu: typeof import('./Menu.typedef.vue')['default']; declare module 'vue' { export interface GlobalComponents { - Menu: DefineComponent; + Menu: typeof import('./Menu.typedef.vue')['default']; } } diff --git a/packages/primevue/src/menu/Menu.ts-playground.typedef.vue b/packages/primevue/src/menu/Menu.ts-playground.typedef.vue new file mode 100644 index 0000000000..f05b707f0d --- /dev/null +++ b/packages/primevue/src/menu/Menu.ts-playground.typedef.vue @@ -0,0 +1,16 @@ + + + diff --git a/packages/primevue/src/menu/Menu.typedef.vue b/packages/primevue/src/menu/Menu.typedef.vue new file mode 100644 index 0000000000..41b3a8951e --- /dev/null +++ b/packages/primevue/src/menu/Menu.typedef.vue @@ -0,0 +1,9 @@ + diff --git a/packages/primevue/tsconfig.json b/packages/primevue/tsconfig.json index 7646ae3984..9ac96befcb 100644 --- a/packages/primevue/tsconfig.json +++ b/packages/primevue/tsconfig.json @@ -21,6 +21,6 @@ "@primevue/icons/*": ["../../packages/icons/src/*"] } }, - "include": ["**/*.ts", "src/*"], + "include": ["**/*.ts", "src/*", "**/*.typedef.vue"], "exclude": ["node_modules", "dist"] }