qsh-webview-sdk 2.0.7 → 2.0.9
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/dist/index.d.ts
CHANGED
|
@@ -54,9 +54,9 @@ declare namespace UniWebView {
|
|
|
54
54
|
/** 最多选择的图片数量,默认9 */
|
|
55
55
|
count?: number;
|
|
56
56
|
/** 图片质量类型 */
|
|
57
|
-
sizeType?: (
|
|
57
|
+
sizeType?: ("original" | "compressed")[];
|
|
58
58
|
/** 图片来源类型 */
|
|
59
|
-
sourceType?: (
|
|
59
|
+
sourceType?: ("album" | "camera")[];
|
|
60
60
|
/** 成功回调 */
|
|
61
61
|
success?: (res: ChooseImageResult) => void;
|
|
62
62
|
/** 失败回调 */
|
|
@@ -99,16 +99,16 @@ declare namespace UniWebView {
|
|
|
99
99
|
* 图片来源类型枚举
|
|
100
100
|
*/
|
|
101
101
|
interface ImageSourceTypesEnum {
|
|
102
|
-
readonly ALBUM:
|
|
103
|
-
readonly CAMERA:
|
|
102
|
+
readonly ALBUM: "album";
|
|
103
|
+
readonly CAMERA: "camera";
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* 图片大小类型枚举
|
|
108
108
|
*/
|
|
109
109
|
interface ImageSizeTypesEnum {
|
|
110
|
-
readonly ORIGINAL:
|
|
111
|
-
readonly COMPRESSED:
|
|
110
|
+
readonly ORIGINAL: "original";
|
|
111
|
+
readonly COMPRESSED: "compressed";
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/**
|
|
@@ -200,7 +200,7 @@ declare namespace UniWebView {
|
|
|
200
200
|
/** 是否 Html5Plus 环境 */
|
|
201
201
|
isHtml5Plus: boolean;
|
|
202
202
|
/** 环境类型 */
|
|
203
|
-
type:
|
|
203
|
+
type: "weixin" | "plus" | "nvue" | "uvue" | "UniApp" | "webview" | "h5";
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
@@ -233,6 +233,57 @@ declare namespace UniWebView {
|
|
|
233
233
|
[key: string]: any;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
/**
|
|
237
|
+
* 打印PDF选项
|
|
238
|
+
*/
|
|
239
|
+
interface PrintPdfOptions {
|
|
240
|
+
/** 要打印的文件 */
|
|
241
|
+
url: string;
|
|
242
|
+
/** HTTP 请求 Header,header 中不能设置 Referer 类型 UTSJSONObject */
|
|
243
|
+
header?: Record<string, string>;
|
|
244
|
+
/** 超时时间,单位 ms 默认 120000ms*/
|
|
245
|
+
timeout?: number;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* 打印PDF结果
|
|
250
|
+
*/
|
|
251
|
+
interface PrintPdfResult {
|
|
252
|
+
data: {
|
|
253
|
+
jobId: string;
|
|
254
|
+
};
|
|
255
|
+
message: string;
|
|
256
|
+
/** 0 成功,非0 失败 */
|
|
257
|
+
code: 0 | number;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* 打印PDF结果
|
|
262
|
+
*/
|
|
263
|
+
interface PrintPdfResult {
|
|
264
|
+
/** 错误信息 */
|
|
265
|
+
errMsg?: string;
|
|
266
|
+
[key: string]: any;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 打印PDF功能能力信息
|
|
271
|
+
*/
|
|
272
|
+
interface PrintPdfCapabilities {
|
|
273
|
+
/** 是否支持打印PDF功能 */
|
|
274
|
+
supported: boolean;
|
|
275
|
+
/** 当前环境类型 */
|
|
276
|
+
environment: string;
|
|
277
|
+
/** 底层实现类型 */
|
|
278
|
+
implementation: string;
|
|
279
|
+
/** 功能特性 */
|
|
280
|
+
features: {
|
|
281
|
+
/** 支持 Promise */
|
|
282
|
+
asyncSupport: boolean;
|
|
283
|
+
[key: string]: any;
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
236
287
|
/**
|
|
237
288
|
* WebView 对象接口
|
|
238
289
|
*/
|
|
@@ -258,17 +309,21 @@ declare namespace UniWebView {
|
|
|
258
309
|
ready(): Promise<void>;
|
|
259
310
|
/** WebView 对象(兼容旧版本) */
|
|
260
311
|
webView: WebView | null;
|
|
261
|
-
|
|
312
|
+
|
|
262
313
|
/** 图片选择(Promise版本) */
|
|
263
|
-
chooseImageAsync(
|
|
314
|
+
chooseImageAsync(
|
|
315
|
+
options?: Omit<ChooseImageOptions, "success" | "fail" | "complete">,
|
|
316
|
+
): Promise<ChooseImageResult>;
|
|
264
317
|
/** 获取图片功能能力信息 */
|
|
265
318
|
getImageCapabilities(): ImageCapabilities;
|
|
266
|
-
|
|
319
|
+
|
|
267
320
|
/** 位置选择(Promise版本) */
|
|
268
|
-
chooseLocationAsync(
|
|
321
|
+
chooseLocationAsync(
|
|
322
|
+
options?: Omit<ChooseLocationOptions, "success" | "fail" | "complete">,
|
|
323
|
+
): Promise<ChooseLocationResult>;
|
|
269
324
|
/** 获取位置选择功能能力信息 */
|
|
270
325
|
getChooseLocationCapabilities(): ChooseLocationCapabilities;
|
|
271
|
-
|
|
326
|
+
|
|
272
327
|
/** 图片来源类型枚举 */
|
|
273
328
|
ImageSourceTypes: ImageSourceTypesEnum;
|
|
274
329
|
/** 图片大小类型枚举 */
|
|
@@ -276,25 +331,39 @@ declare namespace UniWebView {
|
|
|
276
331
|
|
|
277
332
|
/** 微信分享 */
|
|
278
333
|
toShare(options: ShareOptions): Promise<ShareResult> | void;
|
|
279
|
-
toShareAsync(
|
|
334
|
+
toShareAsync(
|
|
335
|
+
options: Omit<ShareOptions, "success" | "fail" | "complete">,
|
|
336
|
+
): Promise<ShareResult>;
|
|
280
337
|
|
|
281
338
|
/** 蓝牙 API */
|
|
282
339
|
openBluetoothAdapter(options?: BluetoothOptions): Promise<any> | void;
|
|
283
340
|
openBluetoothAdapterAsync(options?: BluetoothOptions): Promise<any>;
|
|
284
|
-
startBluetoothDevicesDiscovery(
|
|
285
|
-
|
|
341
|
+
startBluetoothDevicesDiscovery(
|
|
342
|
+
options?: BluetoothOptions,
|
|
343
|
+
): Promise<any> | void;
|
|
344
|
+
startBluetoothDevicesDiscoveryAsync(
|
|
345
|
+
options?: BluetoothOptions,
|
|
346
|
+
): Promise<any>;
|
|
286
347
|
onBluetoothDeviceFound(options?: BluetoothOptions): Promise<any> | void;
|
|
287
348
|
onBluetoothDeviceFoundAsync(options?: BluetoothOptions): Promise<any>;
|
|
288
349
|
createBLEConnection(options?: BluetoothOptions): Promise<any> | void;
|
|
289
350
|
createBLEConnectionAsync(options?: BluetoothOptions): Promise<any>;
|
|
290
351
|
|
|
352
|
+
/** 打印PDF API */
|
|
353
|
+
printPdf(
|
|
354
|
+
options: PrintPdfOptions,
|
|
355
|
+
callback: (result: PrintPdfResult) => void,
|
|
356
|
+
): void;
|
|
357
|
+
printPdfAsync(options: PrintPdfOptions): Promise<PrintPdfResult>;
|
|
358
|
+
/** 获取打印PDF功能能力信息 */
|
|
359
|
+
getPrintCapabilities(): PrintPdfCapabilities;
|
|
360
|
+
|
|
291
361
|
/** 观测指标 */
|
|
292
362
|
metrics: {
|
|
293
363
|
getPerformanceReport(): Record<string, any>;
|
|
294
364
|
clearPerformanceMetrics(): void;
|
|
295
365
|
};
|
|
296
366
|
}
|
|
297
|
-
}
|
|
298
367
|
}
|
|
299
368
|
|
|
300
369
|
/**
|
|
@@ -318,4 +387,4 @@ declare global {
|
|
|
318
387
|
}
|
|
319
388
|
}
|
|
320
389
|
|
|
321
|
-
export as namespace qsh;
|
|
390
|
+
export as namespace qsh;
|