File tree Expand file tree Collapse file tree 4 files changed +68
-0
lines changed
packages/module-loader-typing Expand file tree Collapse file tree 4 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ # @vue-async/module-loader-type
2+
3+ ### TypeScript definitions for @vue-async/module-loader but using in the child modules
4+
Original file line number Diff line number Diff line change 1+ import { Component as VueComponent , AsyncComponent } from 'vue' ;
2+ import { Framework , ModuleLoaderOptions } from './module' ;
3+
4+ declare module 'vue/types/vue' {
5+ interface Vue {
6+ $moduleLoadManager : Framework & ModuleLoaderOptions ;
7+ $dynamicComponent : {
8+ add : (
9+ component : VueComponent | AsyncComponent | ( { component : VueComponent | AsyncComponent } & Record < string , any > ) ,
10+ position ?: string ,
11+ ) => void ;
12+ remove : ( name : string , position ?: string ) => void ;
13+ } ;
14+ $eventBus : {
15+ emit : ( eventName : string , playload : any ) => void ;
16+ on : ( eventName : string , handler : ( playload : any ) => void ) => void ;
17+ off : ( eventName : string , handler : ( playload : any ) => void ) => void ;
18+ clear : ( ) => void ;
19+ getEvents : ( ) => Record < string , any > ;
20+ } ;
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ import { Component as VueComponent , AsyncComponent } from 'vue' ;
2+ import { RouteConfig } from 'vue-router' ;
3+
4+ export type ModuleLoaderOptions = Omit < Record < string , any > , 'layouts' > ;
5+
6+ export interface Framework {
7+ layouts : Record < string , VueComponent | AsyncComponent > ;
8+ addRouters : ( routes : RouteConfig [ ] ) => void ; // 可以被重写
9+ addLayouts : ( name : string , layout : VueComponent ) => void ; // 可以被重写
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @vue-async/module-loader-typing" ,
3+ "version" : " 0.0.1" ,
4+ "description" : " TypeScript definitions for @vue-async/module-loader but using in the child modules" ,
5+ "main" : " " ,
6+ "typings" : " index.d.ts" ,
7+ "keywords" : [
8+ " vue" ,
9+ " vue-async" ,
10+ " module-loader" ,
11+ " async-module" ,
12+ " async-loader" ,
13+ " typescript" ,
14+ " types"
15+ ],
16+ "scripts" : {},
17+ "author" : " Hubert <yi.xiang@live.cn>" ,
18+ "license" : " MIT" ,
19+ "repository" : {
20+ "type" : " git" ,
21+ "url" : " https://github.com/aceHubert/vue-async.git" ,
22+ "directory" : " packages/module-loader-type"
23+ },
24+ "bugs" : {
25+ "url" : " https://github.com/aceHubert/vus-async/issues"
26+ },
27+ "dependencies" : {},
28+ "devDependencies" : {
29+ "vue-router" : " ^3.1.6" ,
30+ "vue" : " ^2.6.0"
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments