@hylid/types 4.0.0-alpha.3 → 4.0.0-alpha.5
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 -2
- package/package.json +1 -1
package/lib/mp.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
90
90
|
defaultGateway: string;
|
|
91
91
|
defaultHeaders?: Record<string, string>;
|
|
92
92
|
request: PickMPAttr<'request'>;
|
|
93
|
-
}) => PickMPAttr<'rpc'
|
|
93
|
+
}) => PickPromiseAttr<PickMPAttr<'rpc'>>;
|
|
94
94
|
rpcWithAuth: PickMPAttr<'rpc'>;
|
|
95
95
|
rpcWithAuthAPlus: PickMPAttr<'rpc'>;
|
|
96
96
|
defineRuntimeConfig: (args: Record<string, any>) => Record<string, any>;
|
|
@@ -177,6 +177,15 @@ export interface MPApi extends Omit<MiniprogramApi, 'request'> {
|
|
|
177
177
|
ext: string;
|
|
178
178
|
}>) => void;
|
|
179
179
|
popWindow: () => void;
|
|
180
|
+
setTransparentTitle: (args: AsyncCallback<{
|
|
181
|
+
transparentTitle: 'none' | 'auto' | 'always' | 'custom';
|
|
182
|
+
}>) => void;
|
|
183
|
+
getLocation: (args: {
|
|
184
|
+
bizType?: string;
|
|
185
|
+
requestType?: number;
|
|
186
|
+
timeout?: number;
|
|
187
|
+
horizontalAccuracy?: number;
|
|
188
|
+
} & GetLocationArgs) => void;
|
|
180
189
|
}
|
|
181
190
|
export declare type HeadModel = {
|
|
182
191
|
/**
|
|
@@ -224,5 +233,5 @@ export declare type ItemModel = {
|
|
|
224
233
|
export declare type PickMPAttr<Attr extends keyof MPApi> = PickAttr<Attr, MPApi>;
|
|
225
234
|
export declare type PickMPArgs<Attr extends keyof MPApi> = Parameters<PickMPAttr<Attr>>[0];
|
|
226
235
|
export declare type PickMpReturns<Attr extends keyof MPApi> = ReturnType<PickMPAttr<Attr>>;
|
|
227
|
-
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?:
|
|
236
|
+
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?: T | undefined) => Promise<S> : never;
|
|
228
237
|
export declare type PickPromiseAttr<T> = T extends (args: infer S) => void ? ReturnTypePromise<S> : never;
|