Skip to content

Commit 77dfc72

Browse files
committed
feat(api): export type VueFinalModalCore to allow users to define their own types
1 parent a920499 commit 77dfc72

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

types/index.d.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ export class VueFinalModalComponant extends Vue {
88
}
99
}
1010

11+
export type VueFinalModalCore = {
12+
readonly openedModals: VueFinalModalComponant[]
13+
readonly modals: VueFinalModalComponant[],
14+
get(name: string): VueFinalModalComponant | undefined
15+
show(name: string): void
16+
hide(name: string): void
17+
hideAll(): void
18+
toggle(name: string, params?: any): void
19+
toggle(name: string, show?: boolean, params?: any): void
20+
}
21+
22+
1123
declare module 'vue/types/vue' {
1224
interface Vue {
13-
readonly $vfm: {
14-
readonly openedModals: VueFinalModalComponant[]
15-
readonly modals: VueFinalModalComponant[]
16-
get(name: string): VueFinalModalComponant | undefined
17-
show(name: string): void
18-
hide(name: string): void
19-
hideAll(): void
20-
toggle(name: string, params?: any): void
21-
toggle(name: string, show?: boolean, params?: any): void
22-
}
25+
readonly $vfm: VueFinalModalCore
2326
}
2427
}
2528

0 commit comments

Comments
 (0)