-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
51 lines (45 loc) · 1.13 KB
/
global.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
declare module 'react-native-mmkv' {
export class MMKV {
getAllKeys: () => string[];
getBoolean: (key: string) => boolean;
getString: (key: string) => string;
delete: (key: string) => void;
set: (key: string, value: string | number | boolean) => void;
}
}
type PlatformType = 'h5' | 'rn' | 'weapp' | 'alipay' | 'tt' | 'swan' | 'qq' | 'jd' | 'quickapp';
interface Token {
accessToken?: string;
refreshToken?: string;
tokenExpireTime?: string;
tokenExpiresIn?: number;
userId?: number;
ispassword?: boolean;
}
interface AjaxResponse<T = any> {
code: number;
success: boolean;
message: string;
data: T;
}
type Obj = Record<string, any>;
interface Page<T> {
list?: Array<T>;
page?: number;
pageSize?: number;
total?: number;
totalPage?: number;
}
type UserInfo = {
userId?: number;
userName?: string;
profilePicture?: string;
};
interface Platform {
name: 'rn' | 'h5' | 'mini';
ref?: any;
getToken(): Token;
updateStorage<T>(key: string, value: T): void;
getStorage(key: string): Record<string, any> | string | undefined;
navigate(path: string, params?: Record<string, any>);
}