@weapp-vite/web 1.2.4 → 1.3.1

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.
@@ -7,14 +7,6 @@ interface ButtonFormConfig {
7
7
  declare function ensureButtonDefined(): void;
8
8
  declare function setButtonFormConfig(next: ButtonFormConfig): void;
9
9
 
10
- type LegacyTemplateScope = Record<string, any>;
11
- type LegacyTemplateRenderer = (scope?: LegacyTemplateScope) => string;
12
- declare function renderTemplate(nodes: ChildNode$1[], scope?: LegacyTemplateScope): string;
13
- declare function createTemplate(source: string): LegacyTemplateRenderer;
14
-
15
- type TemplateScope = Record<string, any>;
16
- type TemplateRenderer = (scope: TemplateScope, ctx: RenderContext) => TemplateResult | string | unknown;
17
-
18
10
  interface RenderContext {
19
11
  instance: ComponentPublicInstance;
20
12
  eval: (expression: string, scope: TemplateScope, wxs?: Record<string, any>) => any;
@@ -31,6 +23,15 @@ interface RenderContext {
31
23
  }
32
24
  declare function createRenderContext(instance: ComponentPublicInstance, methods: Record<string, (event: any) => any>): RenderContext;
33
25
 
26
+ type LegacyTemplateScope = Record<string, any>;
27
+ type LegacyTemplateRenderer = (scope?: LegacyTemplateScope) => string;
28
+
29
+ declare function renderTemplate(nodes: ChildNode$1[], scope?: LegacyTemplateScope): string;
30
+ declare function createTemplate(source: string): LegacyTemplateRenderer;
31
+
32
+ type TemplateScope = Record<string, any>;
33
+ type TemplateRenderer = (scope: TemplateScope, ctx: RenderContext) => TemplateResult | string | unknown;
34
+
34
35
  type DataRecord = Record<string, any>;
35
36
  interface PropertyOption {
36
37
  type?: StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor | ArrayConstructor | null;
@@ -43,11 +44,17 @@ interface LifeTimeHooks {
43
44
  ready?: (this: ComponentPublicInstance) => void;
44
45
  detached?: (this: ComponentPublicInstance) => void;
45
46
  }
47
+ interface PageLifeTimeHooks$1 {
48
+ show?: (this: ComponentPublicInstance) => void;
49
+ hide?: (this: ComponentPublicInstance) => void;
50
+ resize?: (this: ComponentPublicInstance) => void;
51
+ }
46
52
  interface ComponentOptions {
47
53
  properties?: Record<string, PropertyOption>;
48
54
  data?: DataRecord | (() => DataRecord);
49
55
  methods?: Record<string, (this: ComponentPublicInstance, event: any) => any>;
50
56
  lifetimes?: LifeTimeHooks;
57
+ pageLifetimes?: PageLifeTimeHooks$1;
51
58
  behaviors?: ComponentOptions[];
52
59
  }
53
60
  interface DefineComponentOptions {
@@ -61,10 +68,14 @@ interface ComponentPublicInstance extends HTMLElement {
61
68
  readonly properties: DataRecord;
62
69
  setData: (patch: DataRecord) => void;
63
70
  triggerEvent: (name: string, detail?: any) => void;
71
+ createSelectorQuery: () => any;
72
+ selectComponent: (selector: string) => ComponentPublicInstance | null;
73
+ selectAllComponents: (selector: string) => ComponentPublicInstance[];
64
74
  }
65
75
  type ComponentConstructor = CustomElementConstructor & {
66
76
  __weappUpdate?: (options: DefineComponentOptions) => void;
67
77
  };
78
+
68
79
  declare function defineComponent(tagName: string, options: DefineComponentOptions): ComponentConstructor | {
69
80
  new (): {
70
81
  "__#private@#state": DataRecord;
@@ -80,6 +91,9 @@ declare function defineComponent(tagName: string, options: DefineComponentOption
80
91
  get properties(): DataRecord;
81
92
  setData(patch: DataRecord): void;
82
93
  triggerEvent(name: string, detail?: any): void;
94
+ createSelectorQuery(): unknown;
95
+ selectComponent(selector: string): ComponentPublicInstance | null;
96
+ selectAllComponents(selector: string): ComponentPublicInstance[];
83
97
  connectedCallback(): void;
84
98
  disconnectedCallback(): void;
85
99
  attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null): void;
@@ -93,6 +107,7 @@ declare function defineComponent(tagName: string, options: DefineComponentOption
93
107
  "__#private@#runInitialObservers"(): void;
94
108
  "__#private@#syncMethods"(nextMethods: ComponentOptions["methods"]): void;
95
109
  __weappSync(nextMethods: ComponentOptions["methods"]): void;
110
+ __weappInvokePageLifetime(type: keyof PageLifeTimeHooks): void;
96
111
  "__#private@#renderLegacy"(): void;
97
112
  accessKey: string;
98
113
  readonly accessKeyLabel: string;
@@ -448,6 +463,10 @@ declare function defineComponent(tagName: string, options: DefineComponentOption
448
463
  get observedAttributes(): string[];
449
464
  };
450
465
 
466
+ type RuntimeExecutionMode = 'compat' | 'safe' | 'strict';
467
+ declare function getRuntimeExecutionMode(): RuntimeExecutionMode;
468
+ declare function setRuntimeExecutionMode(mode?: RuntimeExecutionMode | string): void;
469
+
451
470
  interface NavigationBarMetrics {
452
471
  statusBarHeight?: number;
453
472
  navContentHeight?: number;
@@ -455,6 +474,792 @@ interface NavigationBarMetrics {
455
474
  }
456
475
  declare function setNavigationBarMetrics(next: NavigationBarMetrics): void;
457
476
 
477
+ interface WxBaseResult {
478
+ errMsg: string;
479
+ }
480
+ interface WxAsyncOptions<SuccessResult extends WxBaseResult> {
481
+ success?: (result: SuccessResult) => void;
482
+ fail?: (result: WxBaseResult) => void;
483
+ complete?: (result: SuccessResult | WxBaseResult) => void;
484
+ }
485
+
486
+ interface ShowToastOptions extends WxAsyncOptions<WxBaseResult> {
487
+ title?: string;
488
+ icon?: 'success' | 'error' | 'none';
489
+ duration?: number;
490
+ }
491
+ interface SetClipboardDataOptions extends WxAsyncOptions<WxBaseResult> {
492
+ data?: string;
493
+ }
494
+ interface GetClipboardDataSuccessResult extends WxBaseResult {
495
+ data: string;
496
+ }
497
+ interface GetClipboardDataOptions extends WxAsyncOptions<GetClipboardDataSuccessResult> {
498
+ }
499
+ interface SetStorageOptions extends WxAsyncOptions<WxBaseResult> {
500
+ key?: string;
501
+ data?: any;
502
+ }
503
+ interface GetStorageSuccessResult extends WxBaseResult {
504
+ data: any;
505
+ }
506
+ interface GetStorageOptions extends WxAsyncOptions<GetStorageSuccessResult> {
507
+ key?: string;
508
+ }
509
+ interface RemoveStorageOptions extends WxAsyncOptions<WxBaseResult> {
510
+ key?: string;
511
+ }
512
+ interface StorageInfoResult extends WxBaseResult {
513
+ keys: string[];
514
+ currentSize: number;
515
+ limitSize: number;
516
+ }
517
+ interface FileReadResult extends WxBaseResult {
518
+ data: string | ArrayBuffer;
519
+ }
520
+ interface FileWriteOptions extends WxAsyncOptions<WxBaseResult> {
521
+ filePath?: string;
522
+ data?: string | ArrayBuffer | ArrayBufferView;
523
+ encoding?: string;
524
+ }
525
+ interface FileReadOptions extends WxAsyncOptions<FileReadResult> {
526
+ filePath?: string;
527
+ encoding?: string;
528
+ }
529
+ interface FileSystemManager {
530
+ writeFile: (options?: FileWriteOptions) => void;
531
+ readFile: (options?: FileReadOptions) => void;
532
+ writeFileSync: (filePath: string, data: string | ArrayBuffer | ArrayBufferView, encoding?: string) => void;
533
+ readFileSync: (filePath: string, encoding?: string) => string | ArrayBuffer;
534
+ }
535
+ type WorkerMessageCallback = (result: {
536
+ data: unknown;
537
+ }) => void;
538
+ type WorkerErrorCallback = (result: {
539
+ message: string;
540
+ filename?: string;
541
+ lineno?: number;
542
+ colno?: number;
543
+ }) => void;
544
+ interface WorkerBridge {
545
+ postMessage: (data: unknown) => void;
546
+ terminate: () => void;
547
+ onMessage: (callback: WorkerMessageCallback) => void;
548
+ offMessage: (callback?: WorkerMessageCallback) => void;
549
+ onError: (callback: WorkerErrorCallback) => void;
550
+ offError: (callback?: WorkerErrorCallback) => void;
551
+ }
552
+ interface RequestSuccessResult extends WxBaseResult {
553
+ data: any;
554
+ statusCode: number;
555
+ header: Record<string, string>;
556
+ }
557
+ interface RequestOptions extends WxAsyncOptions<RequestSuccessResult> {
558
+ url?: string;
559
+ method?: string;
560
+ data?: any;
561
+ header?: Record<string, string>;
562
+ timeout?: number;
563
+ dataType?: 'json' | 'text';
564
+ responseType?: 'text' | 'arraybuffer';
565
+ }
566
+ interface DownloadFileSuccessResult extends WxBaseResult {
567
+ tempFilePath: string;
568
+ statusCode: number;
569
+ }
570
+ interface DownloadFileOptions extends WxAsyncOptions<DownloadFileSuccessResult> {
571
+ url?: string;
572
+ header?: Record<string, string>;
573
+ timeout?: number;
574
+ }
575
+ interface UploadFileSuccessResult extends WxBaseResult {
576
+ data: string;
577
+ statusCode: number;
578
+ header: Record<string, string>;
579
+ }
580
+ interface UploadFileOptions extends WxAsyncOptions<UploadFileSuccessResult> {
581
+ url?: string;
582
+ filePath?: string;
583
+ name?: string;
584
+ header?: Record<string, string>;
585
+ formData?: Record<string, unknown>;
586
+ timeout?: number;
587
+ }
588
+ interface PreviewImageOptions extends WxAsyncOptions<WxBaseResult> {
589
+ current?: string;
590
+ urls?: string[];
591
+ }
592
+ interface ChooseImageTempFile {
593
+ path: string;
594
+ size: number;
595
+ type: string;
596
+ name: string;
597
+ }
598
+ interface ChooseImageSuccessResult extends WxBaseResult {
599
+ tempFilePaths: string[];
600
+ tempFiles: ChooseImageTempFile[];
601
+ }
602
+ interface ChooseImageOptions extends WxAsyncOptions<ChooseImageSuccessResult> {
603
+ count?: number;
604
+ sizeType?: Array<'original' | 'compressed'>;
605
+ sourceType?: Array<'album' | 'camera'>;
606
+ }
607
+
608
+ interface GetLocationSuccessResult extends WxBaseResult {
609
+ latitude: number;
610
+ longitude: number;
611
+ speed: number;
612
+ accuracy: number;
613
+ altitude: number;
614
+ verticalAccuracy: number;
615
+ horizontalAccuracy: number;
616
+ }
617
+ interface GetLocationOptions extends WxAsyncOptions<GetLocationSuccessResult> {
618
+ type?: 'wgs84' | 'gcj02';
619
+ altitude?: boolean;
620
+ isHighAccuracy?: boolean;
621
+ highAccuracyExpireTime?: number;
622
+ }
623
+ interface GetFuzzyLocationSuccessResult extends WxBaseResult {
624
+ latitude: number;
625
+ longitude: number;
626
+ accuracy: number;
627
+ }
628
+ interface GetFuzzyLocationOptions extends WxAsyncOptions<GetFuzzyLocationSuccessResult> {
629
+ }
630
+ type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none';
631
+ interface NetworkStatusResult {
632
+ isConnected: boolean;
633
+ networkType: NetworkType;
634
+ }
635
+ interface GetNetworkTypeSuccessResult extends WxBaseResult, NetworkStatusResult {
636
+ }
637
+ interface GetNetworkTypeOptions extends WxAsyncOptions<GetNetworkTypeSuccessResult> {
638
+ }
639
+ type NetworkStatusChangeCallback = (result: NetworkStatusResult) => void;
640
+ interface WindowResizeResult {
641
+ size: {
642
+ windowWidth: number;
643
+ windowHeight: number;
644
+ };
645
+ windowWidth: number;
646
+ windowHeight: number;
647
+ }
648
+ type WindowResizeCallback = (result: WindowResizeResult) => void;
649
+ interface ShowLoadingOptions extends WxAsyncOptions<WxBaseResult> {
650
+ title?: string;
651
+ mask?: boolean;
652
+ }
653
+ interface SetBackgroundColorOptions extends WxAsyncOptions<WxBaseResult> {
654
+ backgroundColor?: string;
655
+ backgroundColorTop?: string;
656
+ backgroundColorBottom?: string;
657
+ }
658
+ interface SetBackgroundTextStyleOptions extends WxAsyncOptions<WxBaseResult> {
659
+ textStyle?: 'dark' | 'light';
660
+ }
661
+ interface ShareMenuOptions extends WxAsyncOptions<WxBaseResult> {
662
+ withShareTicket?: boolean;
663
+ menus?: string[];
664
+ }
665
+ interface NavigateToMiniProgramOptions extends WxAsyncOptions<WxBaseResult> {
666
+ appId?: string;
667
+ path?: string;
668
+ extraData?: Record<string, any>;
669
+ envVersion?: 'develop' | 'trial' | 'release';
670
+ }
671
+ interface LoadSubPackageOptions extends WxAsyncOptions<WxBaseResult> {
672
+ name?: string;
673
+ root?: string;
674
+ }
675
+ interface PreloadSubpackageOptions extends WxAsyncOptions<WxBaseResult> {
676
+ name?: string;
677
+ root?: string;
678
+ }
679
+ interface UpdateManagerCheckResult {
680
+ hasUpdate: boolean;
681
+ }
682
+ interface UpdateManager {
683
+ applyUpdate: () => void;
684
+ onCheckForUpdate: (callback: (result: UpdateManagerCheckResult) => void) => void;
685
+ onUpdateReady: (callback: () => void) => void;
686
+ onUpdateFailed: (callback: () => void) => void;
687
+ }
688
+ interface LogManagerOptions {
689
+ level?: 0 | 1;
690
+ }
691
+ interface LogManager {
692
+ debug: (...args: unknown[]) => void;
693
+ info: (...args: unknown[]) => void;
694
+ log: (...args: unknown[]) => void;
695
+ warn: (...args: unknown[]) => void;
696
+ }
697
+ interface ChooseLocationSuccessResult extends WxBaseResult {
698
+ name: string;
699
+ address: string;
700
+ latitude: number;
701
+ longitude: number;
702
+ }
703
+ interface ChooseLocationOptions extends WxAsyncOptions<ChooseLocationSuccessResult> {
704
+ }
705
+ interface ChooseAddressSuccessResult extends WxBaseResult {
706
+ userName: string;
707
+ postalCode: string;
708
+ provinceName: string;
709
+ cityName: string;
710
+ countyName: string;
711
+ detailInfo: string;
712
+ nationalCode: string;
713
+ telNumber: string;
714
+ }
715
+ interface ChooseAddressOptions extends WxAsyncOptions<ChooseAddressSuccessResult> {
716
+ }
717
+ interface GetImageInfoSuccessResult extends WxBaseResult {
718
+ width: number;
719
+ height: number;
720
+ path: string;
721
+ type: string;
722
+ orientation: 'up';
723
+ }
724
+ interface GetImageInfoOptions extends WxAsyncOptions<GetImageInfoSuccessResult> {
725
+ src?: string;
726
+ }
727
+ interface MakePhoneCallOptions extends WxAsyncOptions<WxBaseResult> {
728
+ phoneNumber?: string;
729
+ }
730
+ interface OpenLocationOptions extends WxAsyncOptions<WxBaseResult> {
731
+ latitude?: number;
732
+ longitude?: number;
733
+ scale?: number;
734
+ name?: string;
735
+ address?: string;
736
+ }
737
+ interface TabBarOptions extends WxAsyncOptions<WxBaseResult> {
738
+ animation?: boolean;
739
+ }
740
+ interface OpenCustomerServiceChatOptions extends WxAsyncOptions<WxBaseResult> {
741
+ corpId?: string;
742
+ extInfo?: Record<string, any>;
743
+ url?: string;
744
+ }
745
+ interface RequestPaymentOptions extends WxAsyncOptions<WxBaseResult> {
746
+ timeStamp?: string;
747
+ nonceStr?: string;
748
+ package?: string;
749
+ signType?: string;
750
+ paySign?: string;
751
+ }
752
+ interface RequestSubscribeMessageSuccessResult extends WxBaseResult {
753
+ [tmplId: string]: string;
754
+ }
755
+ interface RequestSubscribeMessageOptions extends WxAsyncOptions<RequestSubscribeMessageSuccessResult> {
756
+ tmplIds?: string[];
757
+ }
758
+
759
+ interface AuthSettingResult {
760
+ authSetting: Record<string, boolean>;
761
+ }
762
+ interface GetSettingSuccessResult extends WxBaseResult, AuthSettingResult {
763
+ }
764
+ interface GetSettingOptions extends WxAsyncOptions<GetSettingSuccessResult> {
765
+ }
766
+ interface AuthorizeOptions extends WxAsyncOptions<WxBaseResult> {
767
+ scope?: string;
768
+ }
769
+ interface OpenSettingSuccessResult extends WxBaseResult, AuthSettingResult {
770
+ }
771
+ interface OpenSettingOptions extends WxAsyncOptions<OpenSettingSuccessResult> {
772
+ }
773
+ type ChooseMediaType = 'image' | 'video';
774
+ interface ChooseMediaTempFile {
775
+ tempFilePath: string;
776
+ size: number;
777
+ fileType: ChooseMediaType;
778
+ thumbTempFilePath?: string;
779
+ width: number;
780
+ height: number;
781
+ duration: number;
782
+ }
783
+ interface ChooseMediaSuccessResult extends WxBaseResult {
784
+ type: ChooseMediaType;
785
+ tempFiles: ChooseMediaTempFile[];
786
+ }
787
+ interface ChooseMediaOptions extends WxAsyncOptions<ChooseMediaSuccessResult> {
788
+ count?: number;
789
+ mediaType?: Array<'image' | 'video' | 'mix'>;
790
+ sourceType?: Array<'album' | 'camera'>;
791
+ maxDuration?: number;
792
+ sizeType?: Array<'original' | 'compressed'>;
793
+ camera?: 'back' | 'front';
794
+ }
795
+ interface CompressImageSuccessResult extends WxBaseResult {
796
+ tempFilePath: string;
797
+ }
798
+ interface CompressImageOptions extends WxAsyncOptions<CompressImageSuccessResult> {
799
+ src?: string;
800
+ quality?: number;
801
+ compressedWidth?: number;
802
+ compressedHeight?: number;
803
+ }
804
+ interface ChooseVideoSuccessResult extends WxBaseResult {
805
+ tempFilePath: string;
806
+ duration: number;
807
+ size: number;
808
+ height: number;
809
+ width: number;
810
+ }
811
+ interface ChooseVideoOptions extends WxAsyncOptions<ChooseVideoSuccessResult> {
812
+ sourceType?: Array<'album' | 'camera'>;
813
+ compressed?: boolean;
814
+ maxDuration?: number;
815
+ camera?: 'back' | 'front';
816
+ }
817
+ interface GetVideoInfoSuccessResult extends WxBaseResult {
818
+ size: number;
819
+ duration: number;
820
+ width: number;
821
+ height: number;
822
+ fps: number;
823
+ bitrate: number;
824
+ type: string;
825
+ orientation: 'up';
826
+ }
827
+ interface GetVideoInfoOptions extends WxAsyncOptions<GetVideoInfoSuccessResult> {
828
+ src?: string;
829
+ }
830
+ interface CompressVideoSuccessResult extends WxBaseResult {
831
+ tempFilePath: string;
832
+ size: number;
833
+ duration: number;
834
+ width: number;
835
+ height: number;
836
+ bitrate: number;
837
+ fps: number;
838
+ }
839
+ interface CompressVideoOptions extends WxAsyncOptions<CompressVideoSuccessResult> {
840
+ src?: string;
841
+ quality?: 'low' | 'medium' | 'high';
842
+ bitrate?: number;
843
+ }
844
+ interface MediaPreviewSource {
845
+ url: string;
846
+ type?: 'image' | 'video';
847
+ poster?: string;
848
+ }
849
+ interface PreviewMediaOptions extends WxAsyncOptions<WxBaseResult> {
850
+ sources?: MediaPreviewSource[];
851
+ current?: number;
852
+ }
853
+ interface SaveVideoToPhotosAlbumOptions extends WxAsyncOptions<WxBaseResult> {
854
+ filePath?: string;
855
+ }
856
+ interface ChooseFileSuccessResult extends WxBaseResult {
857
+ tempFiles: ChooseMessageFileTempFile[];
858
+ }
859
+ interface ChooseFileOptions extends WxAsyncOptions<ChooseFileSuccessResult> {
860
+ count?: number;
861
+ type?: 'all' | 'video' | 'image' | 'file';
862
+ extension?: string[];
863
+ }
864
+ interface OpenVideoEditorSuccessResult extends WxBaseResult {
865
+ tempFilePath: string;
866
+ }
867
+ interface OpenVideoEditorOptions extends WxAsyncOptions<OpenVideoEditorSuccessResult> {
868
+ src?: string;
869
+ }
870
+ interface SaveFileSuccessResult extends WxBaseResult {
871
+ savedFilePath: string;
872
+ }
873
+ interface SaveFileOptions extends WxAsyncOptions<SaveFileSuccessResult> {
874
+ tempFilePath?: string;
875
+ filePath?: string;
876
+ }
877
+ interface SaveFileToDiskOptions extends WxAsyncOptions<WxBaseResult> {
878
+ filePath?: string;
879
+ fileName?: string;
880
+ }
881
+ interface ChooseMessageFileTempFile {
882
+ path: string;
883
+ size: number;
884
+ type: string;
885
+ name: string;
886
+ time: number;
887
+ }
888
+ interface ChooseMessageFileSuccessResult extends WxBaseResult {
889
+ tempFiles: ChooseMessageFileTempFile[];
890
+ }
891
+ interface ChooseMessageFileOptions extends WxAsyncOptions<ChooseMessageFileSuccessResult> {
892
+ count?: number;
893
+ type?: 'all' | 'video' | 'image' | 'file';
894
+ }
895
+ interface SaveImageToPhotosAlbumOptions extends WxAsyncOptions<WxBaseResult> {
896
+ filePath?: string;
897
+ }
898
+ interface ScanCodeSuccessResult extends WxBaseResult {
899
+ result: string;
900
+ scanType: string;
901
+ charSet: string;
902
+ path: string;
903
+ rawData: string;
904
+ }
905
+ interface ScanCodeOptions extends WxAsyncOptions<ScanCodeSuccessResult> {
906
+ onlyFromCamera?: boolean;
907
+ scanType?: string[];
908
+ }
909
+
910
+ interface VibrateShortOptions extends WxAsyncOptions<WxBaseResult> {
911
+ type?: 'heavy' | 'medium' | 'light';
912
+ }
913
+ interface BatteryInfo {
914
+ level: number;
915
+ isCharging: boolean;
916
+ }
917
+ interface GetBatteryInfoSuccessResult extends WxBaseResult, BatteryInfo {
918
+ }
919
+ interface GetExtConfigSuccessResult extends WxBaseResult {
920
+ extConfig: Record<string, any>;
921
+ }
922
+ interface GetExtConfigOptions extends WxAsyncOptions<GetExtConfigSuccessResult> {
923
+ }
924
+ interface ShowModalSuccessResult extends WxBaseResult {
925
+ confirm: boolean;
926
+ cancel: boolean;
927
+ }
928
+ interface ShowModalOptions extends WxAsyncOptions<ShowModalSuccessResult> {
929
+ title?: string;
930
+ content?: string;
931
+ showCancel?: boolean;
932
+ confirmText?: string;
933
+ cancelText?: string;
934
+ }
935
+ interface ShowActionSheetSuccessResult extends WxBaseResult {
936
+ tapIndex: number;
937
+ }
938
+ interface ShowActionSheetOptions extends WxAsyncOptions<ShowActionSheetSuccessResult> {
939
+ itemList?: string[];
940
+ itemColor?: string;
941
+ alertText?: string;
942
+ }
943
+ interface OpenDocumentOptions extends WxAsyncOptions<WxBaseResult> {
944
+ filePath?: string;
945
+ fileType?: string;
946
+ showMenu?: boolean;
947
+ }
948
+ interface PageScrollToOptions extends WxAsyncOptions<WxBaseResult> {
949
+ scrollTop?: number;
950
+ duration?: number;
951
+ }
952
+ interface SelectorQueryNodeFields {
953
+ id?: boolean;
954
+ dataset?: boolean;
955
+ rect?: boolean;
956
+ size?: boolean;
957
+ scrollOffset?: boolean;
958
+ properties?: string[];
959
+ computedStyle?: string[];
960
+ context?: boolean;
961
+ node?: boolean;
962
+ }
963
+ type SelectorQueryNodeCallback = (result: any) => void;
964
+ interface SelectorQuery {
965
+ in: (context?: unknown) => SelectorQuery;
966
+ select: (selector: string) => SelectorQueryNodesRef;
967
+ selectAll: (selector: string) => SelectorQueryNodesRef;
968
+ selectViewport: () => SelectorQueryNodesRef;
969
+ exec: (callback?: (result: any[]) => void) => SelectorQuery;
970
+ }
971
+ interface SelectorQueryNodesRef {
972
+ boundingClientRect: (callback?: SelectorQueryNodeCallback) => SelectorQuery;
973
+ scrollOffset: (callback?: SelectorQueryNodeCallback) => SelectorQuery;
974
+ fields: (fields: SelectorQueryNodeFields, callback?: SelectorQueryNodeCallback) => SelectorQuery;
975
+ node: (callback?: SelectorQueryNodeCallback) => SelectorQuery;
976
+ }
977
+ interface CanvasContext {
978
+ setFillStyle: (color: string) => void;
979
+ setStrokeStyle: (color: string) => void;
980
+ setLineWidth: (width: number) => void;
981
+ setFontSize: (size: number) => void;
982
+ fillRect: (x: number, y: number, width: number, height: number) => void;
983
+ strokeRect: (x: number, y: number, width: number, height: number) => void;
984
+ clearRect: (x: number, y: number, width: number, height: number) => void;
985
+ fillText: (text: string, x: number, y: number, maxWidth?: number) => void;
986
+ beginPath: () => void;
987
+ closePath: () => void;
988
+ moveTo: (x: number, y: number) => void;
989
+ lineTo: (x: number, y: number) => void;
990
+ stroke: () => void;
991
+ draw: (reserve?: boolean | (() => void), callback?: () => void) => void;
992
+ }
993
+ interface VideoContext {
994
+ play: () => void;
995
+ pause: () => void;
996
+ stop: () => void;
997
+ seek: (position: number) => void;
998
+ playbackRate: (rate: number) => void;
999
+ requestFullScreen: () => void;
1000
+ exitFullScreen: () => void;
1001
+ }
1002
+ interface AdBaseOptions {
1003
+ adUnitId?: string;
1004
+ }
1005
+ interface AdError {
1006
+ errMsg: string;
1007
+ errCode: number;
1008
+ }
1009
+ interface AdLoadResult {
1010
+ errMsg: string;
1011
+ }
1012
+ interface AdShowResult {
1013
+ errMsg: string;
1014
+ }
1015
+ interface RewardedVideoAdCloseResult {
1016
+ isEnded: boolean;
1017
+ }
1018
+ interface RewardedVideoAd {
1019
+ load: () => Promise<AdLoadResult>;
1020
+ show: () => Promise<AdShowResult>;
1021
+ destroy: () => void;
1022
+ onLoad: (callback: () => void) => void;
1023
+ offLoad: (callback?: () => void) => void;
1024
+ onError: (callback: (error: AdError) => void) => void;
1025
+ offError: (callback?: (error: AdError) => void) => void;
1026
+ onClose: (callback: (result: RewardedVideoAdCloseResult) => void) => void;
1027
+ offClose: (callback?: (result: RewardedVideoAdCloseResult) => void) => void;
1028
+ }
1029
+ interface InterstitialAd {
1030
+ load: () => Promise<AdLoadResult>;
1031
+ show: () => Promise<AdShowResult>;
1032
+ destroy: () => void;
1033
+ onLoad: (callback: () => void) => void;
1034
+ offLoad: (callback?: () => void) => void;
1035
+ onError: (callback: (error: AdError) => void) => void;
1036
+ offError: (callback?: (error: AdError) => void) => void;
1037
+ onClose: (callback: () => void) => void;
1038
+ offClose: (callback?: () => void) => void;
1039
+ }
1040
+ interface VkSession {
1041
+ start: () => Promise<WxBaseResult>;
1042
+ stop: () => Promise<WxBaseResult>;
1043
+ destroy: () => void;
1044
+ on: (eventName: string, callback: (payload: unknown) => void) => void;
1045
+ off: (eventName?: string, callback?: (payload: unknown) => void) => void;
1046
+ }
1047
+
1048
+ interface SystemInfo {
1049
+ brand: string;
1050
+ model: string;
1051
+ pixelRatio: number;
1052
+ screenWidth: number;
1053
+ screenHeight: number;
1054
+ windowWidth: number;
1055
+ windowHeight: number;
1056
+ statusBarHeight: number;
1057
+ language: string;
1058
+ version: string;
1059
+ system: string;
1060
+ platform: string;
1061
+ }
1062
+ interface AppBaseInfo {
1063
+ SDKVersion: string;
1064
+ language: string;
1065
+ version: string;
1066
+ platform: string;
1067
+ enableDebug: boolean;
1068
+ theme: 'light' | 'dark';
1069
+ }
1070
+ interface MenuButtonBoundingClientRect {
1071
+ width: number;
1072
+ height: number;
1073
+ top: number;
1074
+ right: number;
1075
+ bottom: number;
1076
+ left: number;
1077
+ }
1078
+ interface WindowInfo {
1079
+ pixelRatio: number;
1080
+ screenWidth: number;
1081
+ screenHeight: number;
1082
+ windowWidth: number;
1083
+ windowHeight: number;
1084
+ statusBarHeight: number;
1085
+ screenTop: number;
1086
+ safeArea: {
1087
+ left: number;
1088
+ right: number;
1089
+ top: number;
1090
+ bottom: number;
1091
+ width: number;
1092
+ height: number;
1093
+ };
1094
+ }
1095
+ interface DeviceInfo {
1096
+ brand: string;
1097
+ model: string;
1098
+ system: string;
1099
+ platform: string;
1100
+ memorySize: number;
1101
+ benchmarkLevel: number;
1102
+ abi: string;
1103
+ deviceOrientation: 'portrait' | 'landscape';
1104
+ }
1105
+ interface SystemSetting {
1106
+ bluetoothEnabled: boolean;
1107
+ wifiEnabled: boolean;
1108
+ locationEnabled: boolean;
1109
+ locationReducedAccuracy: boolean;
1110
+ deviceOrientation: 'portrait' | 'landscape';
1111
+ }
1112
+ type AppAuthorizeStatus = 'authorized' | 'denied' | 'not determined';
1113
+ interface AppAuthorizeSetting {
1114
+ albumAuthorized: AppAuthorizeStatus;
1115
+ bluetoothAuthorized: AppAuthorizeStatus;
1116
+ cameraAuthorized: AppAuthorizeStatus;
1117
+ locationAuthorized: AppAuthorizeStatus;
1118
+ microphoneAuthorized: AppAuthorizeStatus;
1119
+ notificationAuthorized: AppAuthorizeStatus;
1120
+ phoneCalendarAuthorized: AppAuthorizeStatus;
1121
+ }
1122
+ interface OpenAppAuthorizeSettingSuccessResult extends WxBaseResult, AppAuthorizeSetting {
1123
+ }
1124
+ interface OpenAppAuthorizeSettingOptions extends WxAsyncOptions<OpenAppAuthorizeSettingSuccessResult> {
1125
+ }
1126
+ interface LoginSuccessResult extends WxBaseResult {
1127
+ code: string;
1128
+ }
1129
+ interface LoginOptions extends WxAsyncOptions<LoginSuccessResult> {
1130
+ timeout?: number;
1131
+ }
1132
+ interface CheckSessionOptions extends WxAsyncOptions<WxBaseResult> {
1133
+ }
1134
+ interface UserInfo {
1135
+ nickName: string;
1136
+ avatarUrl: string;
1137
+ gender: 0 | 1 | 2;
1138
+ country: string;
1139
+ province: string;
1140
+ city: string;
1141
+ language: string;
1142
+ }
1143
+ interface UserProfileSuccessResult extends WxBaseResult {
1144
+ userInfo: UserInfo;
1145
+ rawData: string;
1146
+ signature: string;
1147
+ encryptedData: string;
1148
+ iv: string;
1149
+ }
1150
+ interface GetUserInfoOptions extends WxAsyncOptions<UserProfileSuccessResult> {
1151
+ lang?: 'en' | 'zh_CN' | 'zh_TW';
1152
+ }
1153
+ interface GetUserProfileOptions extends WxAsyncOptions<UserProfileSuccessResult> {
1154
+ desc?: string;
1155
+ lang?: 'en' | 'zh_CN' | 'zh_TW';
1156
+ }
1157
+ interface AccountInfoSync {
1158
+ miniProgram: {
1159
+ appId: string;
1160
+ envVersion: 'develop' | 'trial' | 'release';
1161
+ version: string;
1162
+ };
1163
+ plugin: Record<string, unknown>;
1164
+ }
1165
+ interface GetSystemInfoSuccessResult extends WxBaseResult, SystemInfo {
1166
+ }
1167
+ interface GetSystemInfoOptions extends WxAsyncOptions<GetSystemInfoSuccessResult> {
1168
+ }
1169
+
1170
+ declare function vibrateShort(options?: VibrateShortOptions): Promise<{
1171
+ errMsg: string;
1172
+ }>;
1173
+ declare function getBatteryInfoSync(): BatteryInfo;
1174
+ declare function getBatteryInfo(options?: WxAsyncOptions<GetBatteryInfoSuccessResult>): Promise<{
1175
+ level: number;
1176
+ isCharging: boolean;
1177
+ errMsg: string;
1178
+ }>;
1179
+ declare function getLocation(options?: GetLocationOptions): Promise<{
1180
+ latitude: number;
1181
+ longitude: number;
1182
+ speed: number;
1183
+ accuracy: number;
1184
+ altitude: number;
1185
+ verticalAccuracy: number;
1186
+ horizontalAccuracy: number;
1187
+ errMsg: string;
1188
+ }>;
1189
+ declare function getFuzzyLocation(options?: GetFuzzyLocationOptions): Promise<{
1190
+ latitude: number;
1191
+ longitude: number;
1192
+ accuracy: number;
1193
+ errMsg: string;
1194
+ }>;
1195
+ declare function getSetting(options?: GetSettingOptions): Promise<{
1196
+ errMsg: string;
1197
+ authSetting: Record<string, boolean>;
1198
+ }>;
1199
+ declare function authorize(options?: AuthorizeOptions): Promise<{
1200
+ errMsg: string;
1201
+ }>;
1202
+ declare function openSetting(options?: OpenSettingOptions): Promise<{
1203
+ errMsg: string;
1204
+ authSetting: Record<string, boolean>;
1205
+ }>;
1206
+ declare function getAppAuthorizeSetting(): AppAuthorizeSetting;
1207
+ declare function openAppAuthorizeSetting(options?: OpenAppAuthorizeSettingOptions): Promise<{
1208
+ errMsg: string;
1209
+ }>;
1210
+ declare function getNetworkType(options?: GetNetworkTypeOptions): Promise<any>;
1211
+ declare function onNetworkStatusChange(callback: NetworkStatusChangeCallback): void;
1212
+ declare function offNetworkStatusChange(callback?: NetworkStatusChangeCallback): void;
1213
+ declare function getWindowInfo(): WindowInfo;
1214
+ declare function onWindowResize(callback: WindowResizeCallback): void;
1215
+ declare function offWindowResize(callback?: WindowResizeCallback): void;
1216
+ declare function getSystemInfoSync(): SystemInfo;
1217
+ declare function getSystemInfo(options?: GetSystemInfoOptions): Promise<any>;
1218
+ declare function getDeviceInfo(): DeviceInfo;
1219
+ declare function getSystemSetting(): SystemSetting;
1220
+ declare function login(options?: LoginOptions): Promise<{
1221
+ errMsg: string;
1222
+ code: string;
1223
+ }>;
1224
+ declare function checkSession(options?: CheckSessionOptions): Promise<{
1225
+ errMsg: string;
1226
+ }>;
1227
+ declare function getUserInfo(options?: GetUserInfoOptions): Promise<{
1228
+ errMsg: "getUserInfo:ok" | "getUserProfile:ok";
1229
+ userInfo: {
1230
+ nickName: string;
1231
+ avatarUrl: string;
1232
+ gender: 0 | 2 | 1;
1233
+ country: string;
1234
+ province: string;
1235
+ city: string;
1236
+ language: "en" | "zh_CN" | "zh_TW";
1237
+ };
1238
+ rawData: string;
1239
+ signature: string;
1240
+ encryptedData: string;
1241
+ iv: string;
1242
+ }>;
1243
+ declare function getUserProfile(options?: GetUserProfileOptions): Promise<{
1244
+ errMsg: "getUserInfo:ok" | "getUserProfile:ok";
1245
+ userInfo: {
1246
+ nickName: string;
1247
+ avatarUrl: string;
1248
+ gender: 0 | 2 | 1;
1249
+ country: string;
1250
+ province: string;
1251
+ city: string;
1252
+ language: "en" | "zh_CN" | "zh_TW";
1253
+ };
1254
+ rawData: string;
1255
+ signature: string;
1256
+ encryptedData: string;
1257
+ iv: string;
1258
+ }>;
1259
+ declare function getAccountInfoSync(): AccountInfoSync;
1260
+ declare function getAppBaseInfo(): AppBaseInfo;
1261
+ declare function getMenuButtonBoundingClientRect(): MenuButtonBoundingClientRect;
1262
+
458
1263
  interface RegisterMeta {
459
1264
  id: string;
460
1265
  template?: TemplateRenderer;
@@ -482,6 +1287,7 @@ interface AppLaunchOptions {
482
1287
  }
483
1288
  type PageRawOptions = ComponentOptions & PageHooks & Record<string, unknown>;
484
1289
  type ComponentRawOptions = ComponentOptions & Record<string, unknown>;
1290
+
485
1291
  declare function initializePageRoutes(ids: string[], options?: {
486
1292
  rpx?: {
487
1293
  designWidth?: number;
@@ -489,6 +1295,13 @@ declare function initializePageRoutes(ids: string[], options?: {
489
1295
  };
490
1296
  navigationBar?: NavigationBarMetrics;
491
1297
  form?: ButtonFormConfig;
1298
+ runtime?: {
1299
+ executionMode?: 'compat' | 'safe' | 'strict';
1300
+ warnings?: {
1301
+ level?: 'off' | 'warn' | 'error';
1302
+ dedupe?: boolean;
1303
+ };
1304
+ };
492
1305
  }): void;
493
1306
  declare function registerPage<T extends PageRawOptions | undefined>(options: T, meta: RegisterMeta): T;
494
1307
  declare function registerComponent<T extends ComponentRawOptions | undefined>(options: T, meta: RegisterMeta): T;
@@ -508,6 +1321,243 @@ declare function switchTab(options: {
508
1321
  declare function navigateBack(options?: {
509
1322
  delta?: number;
510
1323
  }): Promise<void>;
1324
+ declare function getLaunchOptionsSync(): AppLaunchOptions;
1325
+ declare function getEnterOptionsSync(): AppLaunchOptions;
1326
+
1327
+ declare function navigateToMiniProgram(options?: NavigateToMiniProgramOptions): Promise<{
1328
+ errMsg: string;
1329
+ }>;
1330
+ declare function exitMiniProgram(options?: WxAsyncOptions<WxBaseResult>): Promise<{
1331
+ errMsg: string;
1332
+ }>;
1333
+ declare function nextTick(callback?: () => void): void;
1334
+ declare function startPullDownRefresh(options?: WxAsyncOptions<WxBaseResult>): Promise<{
1335
+ errMsg: string;
1336
+ }>;
1337
+ declare function stopPullDownRefresh(options?: WxAsyncOptions<WxBaseResult>): Promise<{
1338
+ errMsg: string;
1339
+ }>;
1340
+ declare function hideKeyboard(options?: WxAsyncOptions<WxBaseResult>): Promise<{
1341
+ errMsg: string;
1342
+ }>;
1343
+ declare function loadSubPackage(options?: LoadSubPackageOptions): Promise<{
1344
+ errMsg: string;
1345
+ }>;
1346
+ declare function preloadSubpackage(options?: PreloadSubpackageOptions): Promise<{
1347
+ errMsg: string;
1348
+ }>;
1349
+ declare function pageScrollTo(options?: PageScrollToOptions): Promise<unknown>;
1350
+ declare function createSelectorQuery(): SelectorQuery;
1351
+ declare function createCanvasContext(canvasId: string): CanvasContext;
1352
+ declare function createVideoContext(videoId: string): VideoContext;
1353
+ declare function setStorageSync(key: string, data: any): void;
1354
+ declare function getStorageSync(key: string): any;
1355
+ declare function removeStorageSync(key: string): void;
1356
+ declare function clearStorageSync(): void;
1357
+ declare function getStorageInfoSync(): StorageInfoResult;
1358
+ declare function setStorage(options?: SetStorageOptions): Promise<{
1359
+ errMsg: string;
1360
+ }>;
1361
+ declare function getStorage(options?: GetStorageOptions): Promise<{
1362
+ errMsg: string;
1363
+ data: any;
1364
+ }>;
1365
+ declare function removeStorage(options?: RemoveStorageOptions): Promise<{
1366
+ errMsg: string;
1367
+ }>;
1368
+ declare function clearStorage(options?: WxAsyncOptions<WxBaseResult>): Promise<{
1369
+ errMsg: string;
1370
+ }>;
1371
+ declare function getStorageInfo(options?: WxAsyncOptions<StorageInfoResult>): Promise<{
1372
+ errMsg: string;
1373
+ keys: string[];
1374
+ currentSize: number;
1375
+ limitSize: number;
1376
+ }>;
1377
+ declare function getFileSystemManager(): FileSystemManager;
1378
+ declare function createWorker(path: string): WorkerBridge;
1379
+ declare function createVKSession(_options?: Record<string, unknown>): VkSession;
1380
+ declare function request(options?: RequestOptions): Promise<{
1381
+ errMsg: string;
1382
+ data: any;
1383
+ statusCode: number;
1384
+ header: Record<string, string>;
1385
+ }>;
1386
+ declare function downloadFile(options?: DownloadFileOptions): Promise<{
1387
+ errMsg: string;
1388
+ tempFilePath: string;
1389
+ statusCode: number;
1390
+ }>;
1391
+ declare function uploadFile(options?: UploadFileOptions): Promise<{
1392
+ errMsg: string;
1393
+ data: string;
1394
+ statusCode: number;
1395
+ header: Record<string, string>;
1396
+ }>;
1397
+
1398
+ declare function showToast(options?: ShowToastOptions): Promise<any>;
1399
+ declare function showLoading(options?: ShowLoadingOptions): Promise<any>;
1400
+ declare function hideLoading(options?: WxAsyncOptions<WxBaseResult>): Promise<any>;
1401
+ declare function showShareMenu(options?: ShareMenuOptions): Promise<any>;
1402
+ declare function updateShareMenu(options?: ShareMenuOptions): Promise<any>;
1403
+ declare function openCustomerServiceChat(options?: OpenCustomerServiceChatOptions): Promise<{
1404
+ errMsg: string;
1405
+ }>;
1406
+ declare function makePhoneCall(options?: MakePhoneCallOptions): Promise<{
1407
+ errMsg: string;
1408
+ }>;
1409
+ declare function chooseAddress(options?: ChooseAddressOptions): Promise<{
1410
+ userName: string;
1411
+ postalCode: string;
1412
+ provinceName: string;
1413
+ cityName: string;
1414
+ countyName: string;
1415
+ detailInfo: string;
1416
+ nationalCode: string;
1417
+ telNumber: string;
1418
+ errMsg: string;
1419
+ }>;
1420
+ declare function chooseLocation(options?: ChooseLocationOptions): Promise<{
1421
+ name: string;
1422
+ address: string;
1423
+ latitude: number;
1424
+ longitude: number;
1425
+ errMsg: string;
1426
+ }>;
1427
+ declare function openLocation(options?: OpenLocationOptions): Promise<{
1428
+ errMsg: string;
1429
+ }>;
1430
+ declare function getImageInfo(options?: GetImageInfoOptions): Promise<{
1431
+ errMsg: string;
1432
+ width: number;
1433
+ height: number;
1434
+ path: any;
1435
+ type: string;
1436
+ orientation: string;
1437
+ }>;
1438
+ declare function getVideoInfo(options?: GetVideoInfoOptions): Promise<{
1439
+ errMsg: string;
1440
+ orientation: string;
1441
+ type: string;
1442
+ duration: number;
1443
+ size: number;
1444
+ width: number;
1445
+ height: number;
1446
+ bitrate: number;
1447
+ fps: number;
1448
+ }>;
1449
+ declare function showTabBar(options?: TabBarOptions): Promise<any>;
1450
+ declare function hideTabBar(options?: TabBarOptions): Promise<any>;
1451
+ declare function requestPayment(options?: RequestPaymentOptions): Promise<any>;
1452
+ declare function requestSubscribeMessage(options?: RequestSubscribeMessageOptions): Promise<RequestSubscribeMessageSuccessResult>;
1453
+ declare function showModal(options?: ShowModalOptions): Promise<any>;
1454
+ declare function showActionSheet(options?: ShowActionSheetOptions): Promise<any>;
1455
+ declare function chooseImage(options?: ChooseImageOptions): Promise<{
1456
+ errMsg: string;
1457
+ tempFilePaths: string[];
1458
+ tempFiles: {
1459
+ path: string;
1460
+ size: number;
1461
+ type: string;
1462
+ name: string;
1463
+ }[];
1464
+ }>;
1465
+ declare function chooseMedia(options?: ChooseMediaOptions): Promise<{
1466
+ errMsg: string;
1467
+ type: "image" | "video";
1468
+ tempFiles: {
1469
+ tempFilePath: string;
1470
+ size: number;
1471
+ fileType: "image" | "video";
1472
+ width: number;
1473
+ height: number;
1474
+ duration: number;
1475
+ }[];
1476
+ }>;
1477
+ declare function compressImage(options?: CompressImageOptions): Promise<{
1478
+ errMsg: string;
1479
+ tempFilePath: string;
1480
+ }>;
1481
+ declare function compressVideo(options?: CompressVideoOptions): Promise<{
1482
+ tempFilePath: any;
1483
+ size: number;
1484
+ duration: number;
1485
+ width: number;
1486
+ height: number;
1487
+ bitrate: number;
1488
+ fps: number;
1489
+ errMsg: string;
1490
+ }>;
1491
+ declare function chooseVideo(options?: ChooseVideoOptions): Promise<{
1492
+ tempFilePath: string;
1493
+ duration: number;
1494
+ size: number;
1495
+ height: number;
1496
+ width: number;
1497
+ errMsg: string;
1498
+ }>;
1499
+ declare function chooseMessageFile(options?: ChooseMessageFileOptions): Promise<{
1500
+ errMsg: string;
1501
+ tempFiles: {
1502
+ path: string;
1503
+ size: number;
1504
+ type: string;
1505
+ name: string;
1506
+ time: number;
1507
+ }[];
1508
+ }>;
1509
+ declare function chooseFile(options?: ChooseFileOptions): Promise<{
1510
+ errMsg: string;
1511
+ tempFiles: {
1512
+ path: string;
1513
+ size: number;
1514
+ type: string;
1515
+ name: string;
1516
+ time: number;
1517
+ }[];
1518
+ }>;
1519
+ declare function previewImage(options?: PreviewImageOptions): Promise<{
1520
+ errMsg: string;
1521
+ }>;
1522
+ declare function previewMedia(options?: PreviewMediaOptions): Promise<{
1523
+ errMsg: string;
1524
+ }>;
1525
+ declare function openVideoEditor(options?: OpenVideoEditorOptions): Promise<{
1526
+ errMsg: string;
1527
+ tempFilePath: any;
1528
+ }>;
1529
+ declare function saveImageToPhotosAlbum(options?: SaveImageToPhotosAlbumOptions): Promise<{
1530
+ errMsg: string;
1531
+ }>;
1532
+ declare function saveVideoToPhotosAlbum(options?: SaveVideoToPhotosAlbumOptions): Promise<{
1533
+ errMsg: string;
1534
+ }>;
1535
+ declare function saveFile(options?: SaveFileOptions): Promise<{
1536
+ errMsg: string;
1537
+ savedFilePath: string;
1538
+ }>;
1539
+ declare function saveFileToDisk(options?: SaveFileToDiskOptions): Promise<{
1540
+ errMsg: string;
1541
+ }>;
1542
+ declare function openDocument(options?: OpenDocumentOptions): Promise<{
1543
+ errMsg: string;
1544
+ }>;
1545
+ declare function scanCode(options?: ScanCodeOptions): Promise<{
1546
+ errMsg: string;
1547
+ result: string;
1548
+ scanType: string;
1549
+ charSet: string;
1550
+ path: string;
1551
+ rawData: string;
1552
+ }>;
1553
+ declare function setClipboardData(options?: SetClipboardDataOptions): Promise<{
1554
+ errMsg: string;
1555
+ }>;
1556
+ declare function getClipboardData(options?: GetClipboardDataOptions): Promise<{
1557
+ errMsg: string;
1558
+ data: string;
1559
+ }>;
1560
+
511
1561
  declare function setNavigationBarTitle(options: {
512
1562
  title: string;
513
1563
  }): Promise<void>;
@@ -521,6 +1571,22 @@ declare function setNavigationBarColor(options: {
521
1571
  }): Promise<void>;
522
1572
  declare function showNavigationBarLoading(): Promise<void>;
523
1573
  declare function hideNavigationBarLoading(): Promise<void>;
1574
+ declare function setBackgroundColor(options?: SetBackgroundColorOptions): Promise<{
1575
+ errMsg: string;
1576
+ }>;
1577
+ declare function setBackgroundTextStyle(options?: SetBackgroundTextStyleOptions): Promise<{
1578
+ errMsg: string;
1579
+ }>;
1580
+ declare function canIUse(schema: string): boolean;
1581
+ declare function createRewardedVideoAd(options?: AdBaseOptions): RewardedVideoAd;
1582
+ declare function createInterstitialAd(options?: AdBaseOptions): InterstitialAd;
1583
+ declare function getExtConfigSync(): {
1584
+ [x: string]: unknown;
1585
+ };
1586
+ declare function getExtConfig(options?: GetExtConfigOptions): Promise<any>;
1587
+ declare function getUpdateManager(): UpdateManager;
1588
+ declare function getLogManager(options?: LogManagerOptions): LogManager;
1589
+ declare function reportAnalytics(eventName: string, data?: Record<string, unknown>): void;
524
1590
 
525
1591
  interface RpxConfig {
526
1592
  designWidth?: number;
@@ -531,4 +1597,11 @@ declare function setupRpx(config?: RpxConfig): void;
531
1597
  declare function removeStyle(id: string): void;
532
1598
  declare function injectStyle(css: string, id?: string): () => void;
533
1599
 
534
- export { type ButtonFormConfig, type NavigationBarMetrics, type RenderContext, type RpxConfig, type TemplateRenderer, type TemplateScope, createRenderContext, createTemplate, defineComponent, ensureButtonDefined, hideNavigationBarLoading, initializePageRoutes, injectStyle, navigateBack, navigateTo, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStyle, renderTemplate, setButtonFormConfig, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setupRpx, showNavigationBarLoading, switchTab };
1600
+ type RuntimeWarningLevel = 'off' | 'warn' | 'error';
1601
+ interface RuntimeWarningOptions {
1602
+ level?: RuntimeWarningLevel;
1603
+ dedupe?: boolean;
1604
+ }
1605
+ declare function setRuntimeWarningOptions(options?: RuntimeWarningOptions): void;
1606
+
1607
+ export { type ButtonFormConfig, type NavigationBarMetrics, type RenderContext, type RpxConfig, type RuntimeWarningLevel, type RuntimeWarningOptions, type TemplateRenderer, type TemplateScope, authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };