superapp-miniapp-invoke-native 1.12.3 → 1.13.0
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/main.d.ts +36 -0
- package/lib/main.js +539 -500
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
|
@@ -429,6 +429,7 @@ export declare class NativeApi {
|
|
|
429
429
|
httpPlugin: HttpPlugins;
|
|
430
430
|
printPlugins: PrintPlugins;
|
|
431
431
|
downloadFilePlugin: DownloadFilePlugin;
|
|
432
|
+
uploadFilePlugin: UploadFilePlugin;
|
|
432
433
|
otelPlugins: OtelPlugins;
|
|
433
434
|
}
|
|
434
435
|
|
|
@@ -652,6 +653,41 @@ declare interface TouchListenerParamsType {
|
|
|
652
653
|
callBack?: PluginCallback;
|
|
653
654
|
}
|
|
654
655
|
|
|
656
|
+
declare interface UploadFileHandleType {
|
|
657
|
+
uploadFile(params: UploadFileParamsType): Promise<UploadFileResultType>;
|
|
658
|
+
getStatus(): Promise<any>;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export declare interface UploadFileParamsType {
|
|
662
|
+
source?: UploadFileSource;
|
|
663
|
+
accept?: string[];
|
|
664
|
+
maxBytes?: number;
|
|
665
|
+
request: UploadFileRequestType;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
declare class UploadFilePlugin implements UploadFileHandleType {
|
|
669
|
+
uploadFile(params: UploadFileParamsType): Promise<UploadFileResultType>;
|
|
670
|
+
getStatus(): Promise<any>;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
export declare interface UploadFileRequestType {
|
|
674
|
+
url: string;
|
|
675
|
+
method: string;
|
|
676
|
+
headers?: Record<string, string>;
|
|
677
|
+
fileField?: string;
|
|
678
|
+
fields?: Record<string, string | number | boolean>;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export declare interface UploadFileResultType {
|
|
682
|
+
success: boolean;
|
|
683
|
+
message: string;
|
|
684
|
+
fileName?: string;
|
|
685
|
+
status?: number;
|
|
686
|
+
data?: unknown;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export declare type UploadFileSource = "camera" | "image" | "file";
|
|
690
|
+
|
|
655
691
|
declare interface usagePermissionParamsType {
|
|
656
692
|
action: string;
|
|
657
693
|
value: boolean;
|