-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
68 lines (58 loc) · 1.47 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
import { ComponentId, Component } from "j-component";
export {
behavior,
Component,
ComponentJSON,
ComponentId,
RootComponent,
create as render,
} from "j-component";
export interface LoadOptions {
compiler?: "official" | "simulate";
rootPath?: string;
less?: boolean;
usingComponents?: Object;
}
export interface MockComponentDefinition {
id?: string;
tagName?: string;
template: string;
usingComponents?: Object;
behaviors: Array<any>;
options: Object
}
export function load<
TData extends WechatMiniprogram.Component.DataOption,
TProperty extends WechatMiniprogram.Component.PropertyOption,
TMethod extends WechatMiniprogram.Component.MethodOption
>(
options: WechatMiniprogram.Component.Options<TData, TProperty, TMethod> &
LoadOptions & {
id?: string;
tagName?: string;
template?: string;
}
): ComponentId<TData, TProperty, TMethod>;
export function load(
componentPath: string,
tagName: string,
options?: LoadOptions
): string;
export function loadMpx(
componentPath: string,
tagName?: string,
options?: LoadOptions
): string;
export function mockComponent(
compName: string,
compDefinition: MockComponentDefinition
): void;
export function clearMockComponent(): void;
export function match(dom: Node, html: string): boolean;
export function sleep(timeout: number): Promise<void>;
export function scroll(
component: Component<any, any, any>,
destOffset: number,
times?: number,
propName?: string
): void;