@hylid/types 4.0.0-alpha.6 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/mp.d.ts +11 -3
- package/package.json +1 -1
package/lib/mp.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface getCurrentPagesOptions {
|
|
|
22
22
|
}[]) => void;
|
|
23
23
|
fail: (err: any) => void;
|
|
24
24
|
}
|
|
25
|
+
export interface AsyncCallback<T = any> {
|
|
26
|
+
success?: ((res: T) => void) | undefined;
|
|
27
|
+
fail?: ((err: AsyncCallbackFailObject) => void) | undefined;
|
|
28
|
+
complete?: ((res?: any) => any) | undefined;
|
|
29
|
+
}
|
|
25
30
|
export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
26
31
|
authorize: (opt: any) => void;
|
|
27
32
|
getAuthUserInfo: (opt: any) => void;
|
|
@@ -108,7 +113,10 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
108
113
|
imageUrl?: string;
|
|
109
114
|
image?: string;
|
|
110
115
|
url: string;
|
|
111
|
-
} & AsyncCallback<
|
|
116
|
+
} & AsyncCallback<{
|
|
117
|
+
succeed: boolean;
|
|
118
|
+
channelName: string;
|
|
119
|
+
}>) => void;
|
|
112
120
|
homeAddAppToMyApps: (args: {
|
|
113
121
|
appId: string;
|
|
114
122
|
}) => void;
|
|
@@ -123,8 +131,8 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
123
131
|
addNotifyListener: (args: {
|
|
124
132
|
name: string;
|
|
125
133
|
keep?: boolean;
|
|
126
|
-
callback
|
|
127
|
-
} & AsyncCallback<
|
|
134
|
+
callback?: (res: any) => void;
|
|
135
|
+
} & AsyncCallback<any>) => void;
|
|
128
136
|
postNotification: (args: {
|
|
129
137
|
name: string;
|
|
130
138
|
data: object;
|