superapp-miniapp-invoke-native 1.12.2 → 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 CHANGED
@@ -143,9 +143,13 @@ declare class CommunicatePlugins implements CommunicatePluginsHookType {
143
143
  cancelNativeLoading(): Promise<void>;
144
144
  getMiniAppKong(miniAppKong: MiniAppKongType): Promise<MiniAppKongType | undefined>;
145
145
  getDeeplinkParams(sendDeepLinkListenerParams: SendDeepLinkListenerParamsType): void;
146
- switchLanguage(sendSwitchLanguageParams: SendSwitchLanguageParamsType): void;
146
+ switchLanguage(sendSwitchLanguageParams: SendSwitchLanguageParamsType): {
147
+ errorMsg: string;
148
+ };
147
149
  setupMiniApp(setupMiniAppParams: SetupMiniAppParamsType): void;
148
- switchStore(sendSwitchStoreParams: SendSwitchStoreParamsType): void;
150
+ switchStore(sendSwitchStoreParams: SendSwitchStoreParamsType): {
151
+ errorMsg: string;
152
+ };
149
153
  closeMiniApp(): Promise<void>;
150
154
  getStatus(): Promise<any>;
151
155
  dispatchToShell(params: DispatchToShellParamsType): Promise<DispatchToShellParamsType | undefined>;
@@ -425,6 +429,7 @@ export declare class NativeApi {
425
429
  httpPlugin: HttpPlugins;
426
430
  printPlugins: PrintPlugins;
427
431
  downloadFilePlugin: DownloadFilePlugin;
432
+ uploadFilePlugin: UploadFilePlugin;
428
433
  otelPlugins: OtelPlugins;
429
434
  }
430
435
 
@@ -648,6 +653,41 @@ declare interface TouchListenerParamsType {
648
653
  callBack?: PluginCallback;
649
654
  }
650
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
+
651
691
  declare interface usagePermissionParamsType {
652
692
  action: string;
653
693
  value: boolean;