-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.d.ts
71 lines (62 loc) · 2.25 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import * as React from 'react';
import Vue from 'vue';
export interface IProps0 {
cssurl?: string;
name?: string;
id?: string;
visible?: boolean;
extraProps?: { [propName: string]: any };
loadType?: 'xhr' | 'script';
instable_publicPath?: string;
}
export interface IProps1 extends IProps0 {
jsurl: string;
component?: object;
}
export interface IProps2 extends IProps0 {
component: object;
jsurl?: string;
}
export interface Self {
Vue: typeof Vue;
[ propName: string ]: any;
}
export type IProps = IProps1 | IProps2;
declare class VueFrame extends React.Component<IProps, {}> {
private loadType: IProps['loadType'];
private currentName: string;
private visible: boolean;
private currentUrl: string;
private currentCSSUrl: string;
private currentPublicPath: string;
private publicPathKey: string;
private publicPathReg: RegExp;
private rootNodeWrapper: RefObject<HTMLDivElement>;;
private component: any;
private parcel: any;
private vueWrapper1: HTMLDivElement;
private vueWrapper2: HTMLDivElement;
private styleElements: HTMLLinkElement[] | HTMLStyleElement[];
constructor(props: IProps);
componentDidMount(): void;
componentDidUpdate(prevProps: IProps): void;
componentWillUnmount(): void;
private initHack(): void;
private initHackSelector(name: keyof ISelecotr, originSelectorFn: ((id: string) => HTMLElement | null) |
(<E extends Element = Element>(id: string) => NodeListOf<E>) |
HTMLCollectionOf<Element>): void;
private internalHackSelector(selectorMap: { [name: string]: Function },name: keyof ISelecotr,
codeIsExecuting: boolean,): void;
private internalHackCSSsandbox(originAppendChild: <T extends Node>(this: any, newChild: T) => T,
codeIsExecuting: boolean,): void;
private registerComponentAndMount(component: object): void;
private addComponentToPage(rootEleWrapper: HTMLDivElement): void;
private registerVueComponent(el: string | HTMLElement, vueComponent: object, id: string): object;
private isVueComponent(component: any): boolean;
private getOriginCode(url: string, method: string, data?: any): Promise<any>;
private getCurrentName(self: any): string;
private executeOriginCode(code: string): Self;
private getOriginVueComponent(): object;
render(): JSX.Element;
}
export default VueFrame;