@hylid/types 4.0.0-alpha.3 → 4.0.0-alpha.4
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 +6 -2
- package/package.json +1 -1
package/lib/mp.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface IRPCArgs {
|
|
|
14
14
|
disableLimitView?: boolean;
|
|
15
15
|
timeout?: number;
|
|
16
16
|
getResponse?: boolean;
|
|
17
|
+
[key: string]: any;
|
|
17
18
|
}
|
|
18
19
|
export interface getCurrentPagesOptions {
|
|
19
20
|
payload?: Record<string, any>;
|
|
@@ -90,7 +91,7 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
90
91
|
defaultGateway: string;
|
|
91
92
|
defaultHeaders?: Record<string, string>;
|
|
92
93
|
request: PickMPAttr<'request'>;
|
|
93
|
-
}) => PickMPAttr<
|
|
94
|
+
}) => PickPromiseAttr<PickMPAttr<"rpc">>;
|
|
94
95
|
rpcWithAuth: PickMPAttr<'rpc'>;
|
|
95
96
|
rpcWithAuthAPlus: PickMPAttr<'rpc'>;
|
|
96
97
|
defineRuntimeConfig: (args: Record<string, any>) => Record<string, any>;
|
|
@@ -177,6 +178,9 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
177
178
|
ext: string;
|
|
178
179
|
}>) => void;
|
|
179
180
|
popWindow: () => void;
|
|
181
|
+
setTransparentTitle: (args: AsyncCallback<{
|
|
182
|
+
transparentTitle: 'none' | 'auto' | 'always' | 'custom';
|
|
183
|
+
}>) => void;
|
|
180
184
|
}
|
|
181
185
|
export declare type HeadModel = {
|
|
182
186
|
/**
|
|
@@ -224,5 +228,5 @@ export declare type ItemModel = {
|
|
|
224
228
|
export declare type PickMPAttr<Attr extends keyof MPApi> = PickAttr<Attr, MPApi>;
|
|
225
229
|
export declare type PickMPArgs<Attr extends keyof MPApi> = Parameters<PickMPAttr<Attr>>[0];
|
|
226
230
|
export declare type PickMpReturns<Attr extends keyof MPApi> = ReturnType<PickMPAttr<Attr>>;
|
|
227
|
-
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?:
|
|
231
|
+
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?: T | undefined) => Promise<S> : never;
|
|
228
232
|
export declare type PickPromiseAttr<T> = T extends (args: infer S) => void ? ReturnTypePromise<S> : never;
|