-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
53 lines (52 loc) · 1.42 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export interface YrvOption {
name?: string;
template: string;
style: string;
props: object;
data: object;
methods?: object;
watch?: object;
onRun(): void;
onDomChange(paramObj: any): void;
onMount(): void;
onUnMount():void;
onInit();void;
onRender?(el:Element, props:any, belong:string, componentUniqueTag:string):void
}
export interface YrvRouteConfig {
path: string;
component: YrvComponent;
param?: string;
ismain: boolean;
}
export interface YrvRouteInfo{
prevPath:string;
path:string;
param:any;
}
export interface YrvEvent {
name: string;
value: any;
}
export interface RouteInfo {
path: string;
paramObj: any;
}
declare class YrvComponent {
constructor(componentParam: YrvOption, ismain: boolean);
use(component: YrvComponent ,key?:string): void;
$emit(event: YrvEvent,toParent?:boolean): void;
$routeChange(routeInfo: RouteInfo,parentRouteChange?:boolean): void;
$on(event:string,callback:((value) => {}),fromParent?:boolean)
$ref(componentName:string, componentkey?:string)
route(routeConfig: Array<YrvRouteConfig>): void;
$getRouteInfo():YrvRouteInfo
getParentComponentName(): string;
getComponentUniqueTag(): string;
}
declare class RV extends YrvComponent {
constructor(el: string, componentParam: YrvOption);
static component(option: YrvOption): YrvComponent;
run(callback: (rv: RV) => {}): void;
}
export default RV;