uni-app.d.ts
2.79 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
declare module "@dcloudio/vite-plugin-uni";
declare type Theme = "light" | "dark";
declare interface Uni {
rpx2px(px: number): number;
// 兼容旧项目在 uni 上挂载的扩展对象,供 UTS 编译期识别
$api?: any;
// $logger?: any;
$storage?: {
get(key: string): any;
set(key: string, value: any): void;
};
$signHttp?: any;
signHttpConfig?: any;
}
declare interface JSON {
parseObject<T>(text: string): T | null;
}
declare type UTSJSONObject = {
[key: string]: any;
parse?<T>(): T | null;
get?(key: string): any | null;
set?(key: string, value: any | null): void;
getAny?(key: string): any | null;
getAny?(key: string, def: any): any;
getBoolean?(key: string): boolean | null;
getBoolean?(key: string, def: any): boolean;
getNumber?(key: string): number | null;
getNumber?(key: string, def: any): number;
getString?(key: string): string | null;
getString?(key: string, def: any): string;
getJSON?(key: string): UTSJSONObject | null;
getJSON?(key: string, def: any): UTSJSONObject;
getArray?<T>(key: string): T[] | null;
getArray?<T>(key: string, def: T[]): T[];
getArray?(key: string): any[] | null;
getArray?(key: string, def: any[]): any[];
toMap?(): Map<string, any>;
};
declare interface ChooseImageTempFile {
path: string;
size: number;
name: string;
type: string;
}
declare type RequestMethod =
| "OPTIONS"
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "TRACE"
| "CONNECT";
declare interface DOMRect {
x: number;
y: number;
width: number;
height: number;
left: number;
top: number;
right: number;
bottom: number;
}
declare interface UniElement {
$vm: ComponentPublicInstance;
id: string;
firstChild: UniElement;
lastChild: UniElement;
previousSibling: UniElement;
parentElement: UniElement;
children: UniElement[];
attributes: Map<string, any>;
dataset: Map<string, any>;
style: CSSStyleDeclaration;
classList: string[];
takeSnapshot(options: {
success?: (res: { tempFilePath: string }) => void;
fail?: (err: { errCode: number; errMsg: string }) => void;
}): void;
getBoundingClientRectAsync(): Promise<DOMRect>;
getDrawableContext(): DrawableContext;
animate(
keyframes: UniAnimationKeyframe | UniAnimationKeyframe[],
options?:
| {
delay?: number;
direction?: "normal" | "reverse" | "alternate" | "alternate-reverse";
duration?: number;
easing?:
| "ease"
| "ease-in"
| "ease-out"
| "ease-in-out"
| "linear"
| "cubic-bezier";
fill?: "backwards" | "forwards" | "both" | "none";
iterations?: number;
}
| number
): {
id: string;
playState: "running" | "paused" | "finished" | "idle";
} | null;
}
declare interface CanvasContext extends HTMLCanvasElement {
createImage(): HTMLImageElement;
reset(): void;
}
declare type Image = HTMLImageElement;
declare type VueApp = any;