|
| 1 | +import Vue, {VueConstructor} from 'vue' |
| 2 | + |
| 3 | +/** |
| 4 | + * @FYI https://www.yuque.com/docs/share/a72a1b84-c0e4-4bd5-853f-6711cb08a507 |
| 5 | + */ |
| 6 | +declare module '@{{ownerNameLowerCase}}/{{componentName}}' { |
| 7 | + class VueComponent extends Vue { |
| 8 | + static install(vue: typeof Vue): void |
| 9 | + } |
| 10 | + |
| 11 | + type CombinedVueInstance< |
| 12 | + Instance extends Vue, |
| 13 | + Data, |
| 14 | + Methods, |
| 15 | + Computed, |
| 16 | + Props |
| 17 | + > = Data & Methods & Computed & Props & Instance |
| 18 | + |
| 19 | + type ExtendedVue< |
| 20 | + Instance extends Vue, |
| 21 | + Data, |
| 22 | + Methods, |
| 23 | + Computed, |
| 24 | + Props |
| 25 | + > = VueConstructor< |
| 26 | + CombinedVueInstance<Instance, Data, Methods, Computed, Props> & Vue |
| 27 | + > |
| 28 | + |
| 29 | + type Combined<Data, Methods, Computed, Props> = Data & |
| 30 | + Methods & |
| 31 | + Computed & |
| 32 | + Props |
| 33 | + |
| 34 | + type {{componentNamePascal}}Data = {} |
| 35 | + |
| 36 | + type {{componentNamePascal}}Methods = {} |
| 37 | + |
| 38 | + type {{componentNamePascal}}Computed = {} |
| 39 | + |
| 40 | + type {{componentNamePascal}}Props = {} |
| 41 | + |
| 42 | + type {{componentNamePascal}} = Combined< |
| 43 | + {{componentNamePascal}}Data, |
| 44 | + {{componentNamePascal}}Methods, |
| 45 | + {{componentNamePascal}}Computed, |
| 46 | + {{componentNamePascal}}Props |
| 47 | + > |
| 48 | + |
| 49 | + export interface {{componentNamePascal}}Type extends VueComponent, {{componentNamePascal}} {} |
| 50 | + |
| 51 | + const {{componentNamePascal}}Construction: ExtendedVue< |
| 52 | + Vue, |
| 53 | + {{componentNamePascal}}Data, |
| 54 | + {{componentNamePascal}}Methods, |
| 55 | + {{componentNamePascal}}Computed, |
| 56 | + {{componentNamePascal}}Props |
| 57 | + > |
| 58 | + |
| 59 | + export default {{componentNamePascal}}Construction |
| 60 | +} |
0 commit comments