@hylid/types 3.3.0-alpha.11 → 3.3.0-alpha.13
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/package.json +1 -1
- package/lib/common.d.ts +0 -15
- package/lib/common.js +0 -1
- package/lib/custom/appLink.d.ts +0 -32
- package/lib/custom/appLink.js +0 -1
- package/lib/custom/index.d.ts +0 -4
- package/lib/custom/index.js +0 -1
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -4
- package/lib/jsapi.d.ts +0 -250
- package/lib/jsapi.js +0 -1
- package/lib/mp.d.ts +0 -95
- package/lib/mp.js +0 -1
package/package.json
CHANGED
package/lib/common.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type PickAttr<Attr extends keyof T, T = any> = {
|
|
2
|
-
[P in keyof T]: T[Attr];
|
|
3
|
-
}[keyof T];
|
|
4
|
-
export declare type Common = Record<string, any>;
|
|
5
|
-
export declare type Callback<T> = (result?: T) => void;
|
|
6
|
-
/**
|
|
7
|
-
* jsapi 类型
|
|
8
|
-
* @enum {string}
|
|
9
|
-
* @memberof JsApiType
|
|
10
|
-
* @property {string} async 参数有回调函数的异步 JSAPI(如: my.getSystemInfo)
|
|
11
|
-
* @property {string} sync 参数无回调函数的不同 JSAPI(如: my.getSystemInfoSync)
|
|
12
|
-
* @property {string} callback 参数是回调函数的 JSAPI(如: my.onAppShow)
|
|
13
|
-
* @property {string} attribute 访问 my 对象上的属性(如: my.SDKVersion)套壳 H5 only
|
|
14
|
-
*/
|
|
15
|
-
export declare type JsApiType = 'async' | 'sync' | 'callback' | 'attribute';
|
package/lib/common.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/custom/appLink.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare type AppLinkParams = {
|
|
2
|
-
/** 小程序id / 应用id */
|
|
3
|
-
appId: string;
|
|
4
|
-
/** 唤端的 h5 页面
|
|
5
|
-
* - 如果为字符串,则直接使用该字符串作为 url,会拼接为 `${page}?url=${url}`
|
|
6
|
-
* - 如果为对象,则根据对象中的 mode 和 key 来拼接 url
|
|
7
|
-
* - 如果为 false,则不拼接 url
|
|
8
|
-
*/
|
|
9
|
-
url: string | {
|
|
10
|
-
/** 固定为 pageQuery, 表示自动拼接到 pageQuery 中,如:
|
|
11
|
-
* page = '/pages/index/index' 时,会拼接为 `/pages/index/index?${key}=${value}`
|
|
12
|
-
*/
|
|
13
|
-
mode: 'pageQuery';
|
|
14
|
-
/** 配置 url 拼接参数的 key 值, mode 为 pageQuery 时,
|
|
15
|
-
* 若 page = '/pages/index/index',会拼接为 `/pages/index/index?${key}=${value}`
|
|
16
|
-
*/
|
|
17
|
-
key: string;
|
|
18
|
-
/** 配置 url 拼接参数的 value 值, mode 为 pageQuery 时,
|
|
19
|
-
* 若 page = '/pages/index/index',会拼接为 `/pages/index/index?${key}=${value}`
|
|
20
|
-
*/
|
|
21
|
-
value: string;
|
|
22
|
-
} | false;
|
|
23
|
-
/** 小程序 page, 不传默认为 /pages/index/index */
|
|
24
|
-
page?: string;
|
|
25
|
-
/** 应用的 query 信息 **注意不是pageQuery** */
|
|
26
|
-
query?: Record<string, any>;
|
|
27
|
-
/** 小程序的 debug 版本信息 */
|
|
28
|
-
debugConfig?: {
|
|
29
|
-
version: string;
|
|
30
|
-
token?: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
package/lib/custom/appLink.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/custom/index.d.ts
DELETED
package/lib/custom/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
package/lib/jsapi.d.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { Common, PickAttr } from './common';
|
|
2
|
-
export declare namespace AliJsApi {
|
|
3
|
-
type AlertArgs = {
|
|
4
|
-
title?: string;
|
|
5
|
-
message?: string;
|
|
6
|
-
align?: string;
|
|
7
|
-
button?: string;
|
|
8
|
-
};
|
|
9
|
-
type ConfirmArgs = {
|
|
10
|
-
title?: string;
|
|
11
|
-
message?: string;
|
|
12
|
-
align?: string;
|
|
13
|
-
okButton?: string;
|
|
14
|
-
cancelButton?: string;
|
|
15
|
-
};
|
|
16
|
-
type GetAuthCodeArgs = {
|
|
17
|
-
scopes?: string | string[];
|
|
18
|
-
appId: string;
|
|
19
|
-
showErrorTip?: boolean;
|
|
20
|
-
};
|
|
21
|
-
type GetCurrentLocationArgs = {
|
|
22
|
-
bizType: string;
|
|
23
|
-
requestType?: number;
|
|
24
|
-
cacheTimeout?: number;
|
|
25
|
-
timeout?: number;
|
|
26
|
-
};
|
|
27
|
-
type GetCurrentLocationReturns = {
|
|
28
|
-
error: number;
|
|
29
|
-
errorMessage: string;
|
|
30
|
-
latitude: number;
|
|
31
|
-
longitude: number;
|
|
32
|
-
accuracy: number;
|
|
33
|
-
country: string;
|
|
34
|
-
countryCode: string;
|
|
35
|
-
province: string;
|
|
36
|
-
city: string;
|
|
37
|
-
cityAdcode: string;
|
|
38
|
-
district: string;
|
|
39
|
-
districtAdcode: string;
|
|
40
|
-
streetNumber: {
|
|
41
|
-
street: string;
|
|
42
|
-
number: number;
|
|
43
|
-
};
|
|
44
|
-
pois: {
|
|
45
|
-
name: string;
|
|
46
|
-
address: string;
|
|
47
|
-
}[];
|
|
48
|
-
highAccuracyClosed: boolean;
|
|
49
|
-
};
|
|
50
|
-
type GetAPDataStorageArgs = {
|
|
51
|
-
key: string;
|
|
52
|
-
business?: string;
|
|
53
|
-
type?: 'user' | 'common';
|
|
54
|
-
};
|
|
55
|
-
type GetAPDataStorageReturns = {
|
|
56
|
-
data: string;
|
|
57
|
-
errorMessage: string;
|
|
58
|
-
};
|
|
59
|
-
type GetSystemInfoReturns = {
|
|
60
|
-
model: string;
|
|
61
|
-
pixelRatio: number;
|
|
62
|
-
windowWidth: number;
|
|
63
|
-
windowHeight: number;
|
|
64
|
-
language: string;
|
|
65
|
-
version: string;
|
|
66
|
-
};
|
|
67
|
-
type PopToArgs = {
|
|
68
|
-
url?: string;
|
|
69
|
-
urlPattern?: string;
|
|
70
|
-
index?: number;
|
|
71
|
-
data?: Common;
|
|
72
|
-
};
|
|
73
|
-
type PushWindowArgs = {
|
|
74
|
-
url: string;
|
|
75
|
-
data?: Common;
|
|
76
|
-
params?: Common;
|
|
77
|
-
};
|
|
78
|
-
type HttpRequestArgs = {
|
|
79
|
-
url: string;
|
|
80
|
-
headers?: Common;
|
|
81
|
-
method?: 'GET' | 'POST';
|
|
82
|
-
data?: Common | string;
|
|
83
|
-
timeout?: number;
|
|
84
|
-
dataType?: 'json' | 'text' | 'base64' | ({} & string);
|
|
85
|
-
};
|
|
86
|
-
type HttpRequestReturns = {
|
|
87
|
-
data: string;
|
|
88
|
-
status: number;
|
|
89
|
-
headers: Common;
|
|
90
|
-
};
|
|
91
|
-
type SetTitleArgs = {
|
|
92
|
-
title?: string;
|
|
93
|
-
subtitle?: string;
|
|
94
|
-
image?: string;
|
|
95
|
-
};
|
|
96
|
-
type SetBarBottomLineColorArgs = {
|
|
97
|
-
color: number;
|
|
98
|
-
};
|
|
99
|
-
type SetTitleColorArgs = {
|
|
100
|
-
color: number;
|
|
101
|
-
reset?: boolean;
|
|
102
|
-
resetTransparent?: boolean;
|
|
103
|
-
};
|
|
104
|
-
type SetAPDataStorageArgs = GetAPDataStorageArgs & {
|
|
105
|
-
value: string;
|
|
106
|
-
};
|
|
107
|
-
type ShowAuthGuideArgs = {
|
|
108
|
-
bizType: string;
|
|
109
|
-
authType: string;
|
|
110
|
-
issue?: string;
|
|
111
|
-
source?: string;
|
|
112
|
-
option?: string;
|
|
113
|
-
};
|
|
114
|
-
type ShowLoadingArgs = {
|
|
115
|
-
content?: string;
|
|
116
|
-
delay?: number;
|
|
117
|
-
};
|
|
118
|
-
type ToastArgs = {
|
|
119
|
-
content: string;
|
|
120
|
-
type?: 'none' | 'success' | 'fail' | 'exception' | ({} & string);
|
|
121
|
-
duration?: number;
|
|
122
|
-
xOffset?: number;
|
|
123
|
-
yOffset?: number;
|
|
124
|
-
};
|
|
125
|
-
type TradePayArgs = {
|
|
126
|
-
tradeNO?: string;
|
|
127
|
-
partnerID?: string;
|
|
128
|
-
bizType?: string;
|
|
129
|
-
bizSubType?: string;
|
|
130
|
-
bizContext?: string;
|
|
131
|
-
orderStr?: string;
|
|
132
|
-
paymentUrl?: string;
|
|
133
|
-
flowType?: 'a+' | 'local' | '';
|
|
134
|
-
};
|
|
135
|
-
type ActionSheetArgs = {
|
|
136
|
-
title?: string;
|
|
137
|
-
btns: string[];
|
|
138
|
-
cancelBtn?: string;
|
|
139
|
-
destructiveBtnIndex?: number;
|
|
140
|
-
fn?: (v: any) => void;
|
|
141
|
-
};
|
|
142
|
-
type SetTabBarArgs = {
|
|
143
|
-
actionType: string;
|
|
144
|
-
};
|
|
145
|
-
interface Api {
|
|
146
|
-
alert(args?: AlertArgs): any;
|
|
147
|
-
clearTinyLocalStorage(args?: Common): any;
|
|
148
|
-
confirm(args?: ConfirmArgs): any;
|
|
149
|
-
getAuthCode(args?: GetAuthCodeArgs): {
|
|
150
|
-
authCode: string;
|
|
151
|
-
};
|
|
152
|
-
getClipboard(args?: Common): any;
|
|
153
|
-
getCurrentLocation(args?: GetCurrentLocationArgs): GetCurrentLocationReturns;
|
|
154
|
-
getNetworkType(): {
|
|
155
|
-
networkInfo: string;
|
|
156
|
-
};
|
|
157
|
-
getAPDataStorage(args: GetAPDataStorageArgs): GetAPDataStorageReturns;
|
|
158
|
-
getSystemInfo(): GetSystemInfoReturns;
|
|
159
|
-
hideKeyboard(): void;
|
|
160
|
-
hideLoading(args?: {
|
|
161
|
-
page: number;
|
|
162
|
-
}): void;
|
|
163
|
-
hideTitleLoading(): void;
|
|
164
|
-
hideToast(args?: Common): any;
|
|
165
|
-
popTo(args?: PopToArgs): any;
|
|
166
|
-
pushWindow(args?: PushWindowArgs): any;
|
|
167
|
-
removeTinyLocalStorage(args?: {
|
|
168
|
-
key: string;
|
|
169
|
-
}): any;
|
|
170
|
-
httpRequest(args: HttpRequestArgs): HttpRequestReturns;
|
|
171
|
-
setClipboard(args: {
|
|
172
|
-
text: string;
|
|
173
|
-
}): any;
|
|
174
|
-
setTitle(args?: SetTitleArgs): any;
|
|
175
|
-
setBarBottomLineColor(args?: SetBarBottomLineColorArgs): any;
|
|
176
|
-
setTitleColor(args?: SetTitleColorArgs): any;
|
|
177
|
-
setAPDataStorage(args?: SetAPDataStorageArgs): any;
|
|
178
|
-
showAuthGuide(args?: ShowAuthGuideArgs): {
|
|
179
|
-
shown: boolean;
|
|
180
|
-
};
|
|
181
|
-
showLoading(args?: ShowLoadingArgs): any;
|
|
182
|
-
showTitleLoading(): void;
|
|
183
|
-
toast(args: ToastArgs): void;
|
|
184
|
-
tradePay(args: TradePayArgs): {
|
|
185
|
-
resultCode: string;
|
|
186
|
-
};
|
|
187
|
-
getImageInfo(args?: Common): void;
|
|
188
|
-
multiLevelSelect(args?: Common): void;
|
|
189
|
-
navigateBackMiniProgram(args?: Common): void;
|
|
190
|
-
navigateToMiniProgram(args?: Common): void;
|
|
191
|
-
previewImage(args?: Common): void;
|
|
192
|
-
saveImage(args?: Common): void;
|
|
193
|
-
setOptionMenu(args?: Common): void;
|
|
194
|
-
chooseImage(args?: Common): void;
|
|
195
|
-
actionSheet(args?: ActionSheetArgs): void;
|
|
196
|
-
setTabBar(args?: SetTabBarArgs): void;
|
|
197
|
-
switchTab(args?: {
|
|
198
|
-
url: string;
|
|
199
|
-
}): void;
|
|
200
|
-
firePullToRefresh(): void;
|
|
201
|
-
restorePullToRefresh(): void;
|
|
202
|
-
datePicker(args: any): void;
|
|
203
|
-
saveFile(args?: any): void;
|
|
204
|
-
uploadFile(args?: any): void;
|
|
205
|
-
downloadFile(args?: any): void;
|
|
206
|
-
watchShake(args?: any): void;
|
|
207
|
-
connectSocket(args?: any): void;
|
|
208
|
-
onSocketOpen(args?: any): void;
|
|
209
|
-
offSocketOpen(args?: any): void;
|
|
210
|
-
onSocketError(args?: any): void;
|
|
211
|
-
offSocketError(args?: any): void;
|
|
212
|
-
sendSocketMessage(args?: any): void;
|
|
213
|
-
onSocketMessage(args?: any): void;
|
|
214
|
-
offSocketMessage(args?: any): void;
|
|
215
|
-
closeSocket(args?: any): void;
|
|
216
|
-
onSocketClose(args?: any): void;
|
|
217
|
-
offSocketClose(args?: any): void;
|
|
218
|
-
onAccelerometerChange(args?: any): void;
|
|
219
|
-
offAccelerometerChange(args?: any): void;
|
|
220
|
-
onCompassChange(args?: any): void;
|
|
221
|
-
offCompassChange(args?: any): void;
|
|
222
|
-
connectBLEDevice(args?: Common): void;
|
|
223
|
-
disconnectBLEDevice(args?: Common): void;
|
|
224
|
-
getBLEDeviceCharacteristics(args?: Common): void;
|
|
225
|
-
getBLEDeviceServices(args?: Common): void;
|
|
226
|
-
notifyBLECharacteristicValueChange(args?: Common): void;
|
|
227
|
-
offBLECharacteristicValueChange(args?: Common): void;
|
|
228
|
-
offBLEConnectionStateChanged(args?: Common): void;
|
|
229
|
-
onBLECharacteristicValueChange(args?: Common): void;
|
|
230
|
-
onBLEConnectionStateChanged(args?: Common): void;
|
|
231
|
-
readBLECharacteristicValue(args?: Common): void;
|
|
232
|
-
writeBLECharacteristicValue(args?: Common): void;
|
|
233
|
-
openBluetoothAdapter(args?: Common): void;
|
|
234
|
-
closeBluetoothAdapter(args?: Common): void;
|
|
235
|
-
getBluetoothAdapterState(args?: Common): void;
|
|
236
|
-
startBluetoothDevicesDiscovery(args?: Common): void;
|
|
237
|
-
stopBluetoothDevicesDiscovery(args?: Common): void;
|
|
238
|
-
getBluetoothDevices(args?: Common): void;
|
|
239
|
-
getConnectedBluetoothDevices(args?: Common): void;
|
|
240
|
-
onBluetoothDeviceFound(args?: Common): void;
|
|
241
|
-
offBluetoothDeviceFound(args?: Common): void;
|
|
242
|
-
onBluetoothAdapterStateChange(args?: Common): void;
|
|
243
|
-
offBluetoothAdapterStateChange(args?: Common): void;
|
|
244
|
-
getFileInfo(args?: Common): void;
|
|
245
|
-
openDocument(args?: Common): void;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
export declare type PickJSAttr<Attr extends keyof AliJsApi.Api> = PickAttr<Attr, AliJsApi.Api>;
|
|
249
|
-
export declare type PickJSArgs<Attr extends keyof AliJsApi.Api = any> = Parameters<PickJSAttr<Attr>>[0];
|
|
250
|
-
export declare type PickJSReturns<Attr extends keyof AliJsApi.Api> = ReturnType<PickJSAttr<Attr>>;
|
package/lib/jsapi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/mp.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/// <reference types="miniprogram" />
|
|
2
|
-
import { PickAttr, Common } from './common';
|
|
3
|
-
export interface AddFatigueActionArgs extends AsyncCallback<any> {
|
|
4
|
-
deliverId?: string;
|
|
5
|
-
spaceCode?: string;
|
|
6
|
-
action?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IRPCArgs {
|
|
9
|
-
operationType: string;
|
|
10
|
-
requestData: string | unknown[];
|
|
11
|
-
headers?: Record<string, any>;
|
|
12
|
-
gateway?: string;
|
|
13
|
-
compress?: boolean;
|
|
14
|
-
disableLimitView?: boolean;
|
|
15
|
-
timeout?: number;
|
|
16
|
-
getResponse?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface getCurrentPagesOptions {
|
|
19
|
-
payload?: Record<string, any>;
|
|
20
|
-
success: (res: {
|
|
21
|
-
route: string;
|
|
22
|
-
}[]) => void;
|
|
23
|
-
fail: (err: any) => void;
|
|
24
|
-
}
|
|
25
|
-
export interface MPApi extends MiniprogramApi {
|
|
26
|
-
authorize: (opt: any) => void;
|
|
27
|
-
getAuthUserInfo: (opt: any) => void;
|
|
28
|
-
crossPay(args?: TradePayArgs): void;
|
|
29
|
-
addFatigueAction(args?: AddFatigueActionArgs): void;
|
|
30
|
-
appxrpc(args?: {
|
|
31
|
-
reqeustData: any;
|
|
32
|
-
}): void;
|
|
33
|
-
batchQueryCdpSpaceInfo(args?: any): void;
|
|
34
|
-
exitApp(args?: any): void;
|
|
35
|
-
getAppToken(args?: any): void;
|
|
36
|
-
getComponentAuth(args?: any): void;
|
|
37
|
-
getPaymentCode(args?: any): void;
|
|
38
|
-
getPhoneNumber(args?: any): void;
|
|
39
|
-
inquireQuote(args?: any): void;
|
|
40
|
-
isInstalledApp(args?: any): void;
|
|
41
|
-
navigateToBizScene(args?: any): void;
|
|
42
|
-
paySignCenter(args?: any): void;
|
|
43
|
-
rpc(args: IRPCArgs & AsyncCallback<{
|
|
44
|
-
headers: Record<string, string>;
|
|
45
|
-
resData: object;
|
|
46
|
-
}>): void;
|
|
47
|
-
APRegionRPC(args?: any): void;
|
|
48
|
-
startApp(args?: any): void;
|
|
49
|
-
startBizService(args?: any): void;
|
|
50
|
-
thirdPartyAuthForAc(args?: any): void;
|
|
51
|
-
openSchemeWithBacking(args?: any): void;
|
|
52
|
-
uploadApdidToken(args?: any): void;
|
|
53
|
-
apDisableJSAPI(args?: any): void;
|
|
54
|
-
regionFetchAllApps(args?: any): void;
|
|
55
|
-
regionSearchAppsByKeywords(args?: any): void;
|
|
56
|
-
setOptionMenu(args?: Common & AsyncCallback<any>): void;
|
|
57
|
-
getLaunchOptionsSync(): any;
|
|
58
|
-
getStorageInfo(args?: any): void;
|
|
59
|
-
getStorageInfoSync(args?: any): void;
|
|
60
|
-
showSharePanel(args?: any): void;
|
|
61
|
-
postMessage(args?: any): void;
|
|
62
|
-
onMessage(args?: any): void;
|
|
63
|
-
canIUse(args: string): boolean;
|
|
64
|
-
SDKVersion: any;
|
|
65
|
-
hideOptionButton(args?: any): void;
|
|
66
|
-
getCurrentLanguage(): string;
|
|
67
|
-
openURL(args?: Common): Promise<void>;
|
|
68
|
-
getAppId(args: AsyncCallback<{
|
|
69
|
-
appId: string;
|
|
70
|
-
}>): void;
|
|
71
|
-
getCurrentPages(args: getCurrentPagesOptions): void;
|
|
72
|
-
getSDKVersion(args: AsyncCallback<string>): void;
|
|
73
|
-
createWithoutAuthRpc: (args: {
|
|
74
|
-
appId?: string;
|
|
75
|
-
workspaceId?: string;
|
|
76
|
-
defaultGateway: string;
|
|
77
|
-
defaultHeaders?: Record<string, string>;
|
|
78
|
-
request: (args: RequestArgs) => void;
|
|
79
|
-
}) => PickMPAttr<'rpc'>;
|
|
80
|
-
rpcWithAuth: PickMPAttr<'rpc'>;
|
|
81
|
-
rpcWithAuthAPlus: PickMPAttr<'rpc'>;
|
|
82
|
-
defineRuntimeConfig: {
|
|
83
|
-
(args: Record<string, any>): void;
|
|
84
|
-
getRuntimeConfig?: () => Record<string, any>;
|
|
85
|
-
};
|
|
86
|
-
getAuthCode: (args: {
|
|
87
|
-
scopes: string | string[];
|
|
88
|
-
appId?: string;
|
|
89
|
-
} & AsyncCallback<GetAuthCodeCallbackValue>) => void;
|
|
90
|
-
}
|
|
91
|
-
export declare type PickMPAttr<Attr extends keyof MPApi> = PickAttr<Attr, MPApi>;
|
|
92
|
-
export declare type PickMPArgs<Attr extends keyof MPApi> = Parameters<PickMPAttr<Attr>>[0];
|
|
93
|
-
export declare type PickMpReturns<Attr extends keyof MPApi> = ReturnType<PickMPAttr<Attr>>;
|
|
94
|
-
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?: Omit<T, "success" | "fail" | "complete"> | undefined) => Promise<S> : never;
|
|
95
|
-
export declare type PickPromiseAttr<T> = T extends (args: infer S) => void ? ReturnTypePromise<S> : never;
|
package/lib/mp.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|