@widget-js/core 24.1.1-beta.87 → 24.1.1-beta.89

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
@@ -92,6 +92,8 @@ interface ThemeColors {
92
92
  border: string;
93
93
  input: string;
94
94
  ring: string;
95
+ shadow: string;
96
+ innerShadow: string;
95
97
  }
96
98
  interface ThemeRadius {
97
99
  sm: string;
@@ -104,9 +106,14 @@ interface ThemeTypography {
104
106
  fontSize: string;
105
107
  }
106
108
  interface ThemeShadow {
107
- sm: string;
108
- md: string;
109
- lg: string;
109
+ sm: ThemeBoxShadow;
110
+ md: ThemeBoxShadow;
111
+ lg: ThemeBoxShadow;
112
+ }
113
+ interface ThemeBoxShadow {
114
+ offsetX: string;
115
+ offsetY: string;
116
+ blur: string;
110
117
  }
111
118
  interface IAppTheme {
112
119
  useGlobalTheme?: boolean;
@@ -161,6 +168,10 @@ interface IDeployedPage {
161
168
  height: number;
162
169
  width: number;
163
170
  proxy?: string;
171
+ minWidth?: number;
172
+ minHeight?: number;
173
+ maxWidth?: number;
174
+ maxHeight?: number;
164
175
  isIgnoreMouseEvents?: boolean;
165
176
  }
166
177
  declare class DeployedPage implements IDeployedPage {
@@ -178,6 +189,10 @@ declare class DeployedPage implements IDeployedPage {
178
189
  declare class DeployedWidget extends DeployedPage {
179
190
  shortcut?: string;
180
191
  deployMode: number;
192
+ minWidth?: number;
193
+ minHeight?: number;
194
+ maxWidth?: number;
195
+ maxHeight?: number;
181
196
  isOverlap(): boolean;
182
197
  }
183
198
 
@@ -252,6 +267,31 @@ declare class AppConfig {
252
267
  static readonly LAUNCH_AT_STARTUP = "CONFIG_LAUNCH_AT_STARTUP";
253
268
  }
254
269
 
270
+ interface AiConfig {
271
+ id: string;
272
+ model: string;
273
+ apiKey: string;
274
+ apiBaseUrl: string;
275
+ }
276
+ interface IAiApi {
277
+ addConfig: (config: AiConfig) => Promise<AiConfig>;
278
+ deleteConfig: (id: string) => Promise<void>;
279
+ updateConfig: (config: AiConfig) => Promise<void>;
280
+ getConfigList: () => Promise<AiConfig[]>;
281
+ setConfigList: (configs: AiConfig[]) => Promise<void>;
282
+ getConfig: (id: string) => Promise<AiConfig | undefined>;
283
+ }
284
+ /**
285
+ * AiApiEvent
286
+ */
287
+ declare enum AiApiEvent {
288
+ /**
289
+ * Configuration update event
290
+ */
291
+ CONFIG_UPDATED = "channel::cn.widgetjs.core.ai.config.updated"
292
+ }
293
+ type AiApiMethods = keyof IAiApi;
294
+
255
295
  interface Language {
256
296
  baseName: string;
257
297
  language: string;
@@ -570,34 +610,34 @@ interface AppRuntimeInfo {
570
610
 
571
611
  type AppRoutes = '/widget/search' | '/widget/package' | '/setting/common' | '/setting/theme' | '/setting/ai' | '/setting/proxy' | '/setting/info' | '/user/profile';
572
612
  /**
573
- * AppApi 接口定义了与应用程序相关的一系列方法。这些方法提供了应用程序配置管理、版本信息获取、路径获取以及应用内置窗口操作等功能。
613
+ * AppApi interface defines a series of methods related to the application. These methods provide functions such as application configuration management, version information retrieval, path retrieval, and application built-in window operations.
574
614
  * @see [Electron API App](https://www.electronjs.org/docs/latest/api/app)
575
615
  */
576
616
  interface IAppApi {
577
617
  /**
578
- * 设置配置
618
+ * Set configuration
579
619
  * @param key string
580
620
  * @param value string | number | boolean
581
621
  */
582
622
  setConfig: (key: string | AppApiConstants, value: string | number | boolean) => Promise<any>;
583
623
  /**
584
- * 获取配置
624
+ * Get configuration
585
625
  * @param key
586
626
  * @param defaultValue
587
627
  * @return Promise<string | number | boolean>
588
628
  */
589
629
  getConfig: <T extends string | number | boolean>(key: string | AppApiConstants, defaultValue: T) => Promise<T>;
590
630
  /**
591
- * 获取版本信息
592
- * @param type string - 可选。指定要获取的版本类型。
631
+ * Get version information
632
+ * @param type string - Optional. Specify the type of version to get.
593
633
  * <ol>
594
634
  * <li>`app`: Get app's version with Semantic Versioning format.
595
635
  * The version is different from Microsoft store's version.
596
636
  * For example, if the app's version is `24.1.1`, Microsoft store's version will be `24.1.1.0`</li>
597
- * <li>`electron`: 获取 Electron 框架的版本。</li>
598
- * <li>`chrome`: 获取 Electron 使用的 Chromium 版本。</li>
599
- * <li>`node`: 获取 Node.js 的版本。</li>
600
- * <li>`v8`: 获取 V8 引擎的版本。</li>
637
+ * <li>`electron`: Get the version of the Electron framework.</li>
638
+ * <li>`chrome`: Get the Chromium version used by Electron.</li>
639
+ * <li>`node`: Get the Node.js version.</li>
640
+ * <li>`v8`: Get the V8 engine version.</li>
601
641
  * </ol>
602
642
  * @return Promise<string>
603
643
  */
@@ -607,13 +647,13 @@ interface IAppApi {
607
647
  */
608
648
  getRuntimeInfo: () => Promise<AppRuntimeInfo>;
609
649
  /**
610
- * 获取Preload JS路径
650
+ * Get Preload JS path
611
651
  * @see [Using Preload Scripts](https://www.electronjs.org/docs/latest/tutorial/tutorial-preload)
612
652
  * @return Promise<string>
613
653
  */
614
654
  getPreloadPath: () => Promise<string>;
615
655
  /**
616
- * 获取应用安装路径
656
+ * Get application installation path
617
657
  * @return Promise<string>
618
658
  */
619
659
  getAppPath: () => Promise<string>;
@@ -725,23 +765,23 @@ type AppApiMethods = keyof IAppApi;
725
765
  */
726
766
  declare enum AppApiEvent {
727
767
  /**
728
- * 应用设置变更时触发
768
+ * Triggered when application settings change
729
769
  */
730
770
  CONFIG_CHANGED = "event::cn.widgetjs.core.app.config.changed",
731
771
  /**
732
- * 桌面组件网格窗口移动时触发
772
+ * Triggered when the desktop widget grid window moves
733
773
  */
734
774
  MOVING_GRID_WINDOW = "event::cn.widgetjs.core.app.moving.grid.window",
735
775
  /**
736
- * 桌面组件网格窗口停止移动时触发
776
+ * Triggered when the desktop widget grid window stops moving
737
777
  */
738
778
  STOP_MOVING_GRID_WINDOW = "event::cn.widgetjs.core.app.moving.grid.window.stop",
739
779
  /**
740
- * 应用代理发生变化
780
+ * Application proxy changed
741
781
  */
742
782
  PROXY_CHANGED = "event::cn.widgetjs.core.app.proxy.changed",
743
783
  /**
744
- * 应用语言发生变化
784
+ * Application language changed
745
785
  */
746
786
  LANGUAGE_CHANGED = "event::cn.widgetjs.core.app.language.changed"
747
787
  }
@@ -750,200 +790,527 @@ declare enum AppApiEvent {
750
790
  */
751
791
  declare enum AppApiConstants {
752
792
  /**
753
- * 桌面组件网格大小
793
+ * Desktop widget grid size
754
794
  */
755
795
  CONFIG_GRID_CELL_SIZE = "cn.widgetjs.config.grid.size",
756
796
  /**
757
- * 应用主题CSS设置
797
+ * Application theme CSS settings
758
798
  */
759
799
  CONFIG_WIDGET_THEME_CSS = "cn.widgetjs.config.widget.theme.css",
760
800
  /**
761
- * 应用全局代理设置
801
+ * Application global proxy settings
762
802
  */
763
803
  CONFIG_PROXY = "cn.widgetjs.config.app.proxy",
764
804
  CONFIG_DEV_MODE = "cn.widgetjs.config.app.dev.mode",
765
805
  /**
766
- * 应用语言设置
806
+ * Application language settings
767
807
  */
768
808
  CONFIG_LANGUAGE = "cn.widgetjs.config.app.language"
769
809
  }
770
810
 
771
- /**
772
- * DialogApi 提供文件、文件夹选择功能
773
- */
774
- interface IDialogApi {
775
- /**
776
- * 选取单个文件
777
- * @param extensions 允许的文件后缀格式,如:["txt","docx","gif"]
778
- */
779
- pickFile: (extensions?: string[]) => Promise<string | undefined>;
780
- /**
781
- * 选取文件夹
782
- */
783
- pickFolder: () => Promise<string | undefined>;
784
- }
785
- type DialogApiMethods = keyof IDialogApi;
811
+ type WidgetPermission = 'keyboard' | 'mouse' | 'clipboard' | 'notification' | 'storage' | 'network' | 'cpu' | 'system-info';
786
812
 
787
- /**
788
- * WidgetPackageApi 提供了组件包的升级、获取、安装等功能
789
- */
790
- interface IWidgetPackageApi {
791
- /**
792
- * 升级组件包
793
- * @param packageName 组件包名称
794
- * @param remoteUrlInfo
795
- */
796
- upgrade: (packageName: string, remoteUrlInfo: RemotePackageUrlInfo) => Promise<void>;
813
+ interface MetaInfo {
814
+ [key: string]: string | number | boolean;
815
+ }
816
+ interface IWindowSize {
817
+ width: number;
818
+ height: number;
819
+ maxWidth?: number;
820
+ maxHeight?: number;
821
+ minWidth?: number;
822
+ minHeight?: number;
823
+ }
824
+ interface IPageOptions extends IWindowSize {
825
+ name: string;
797
826
  /**
798
- * 获取组件包的首页url信息
799
- * @param packageName
827
+ * 当showInSearch为true时,此项必填
800
828
  */
801
- getIndexUrl: (packageName: string) => Promise<string | null>;
829
+ title: LanguageTextMap;
802
830
  /**
803
- * 获取组件包入口url信息
804
- * @param packageName
831
+ * 当showInSearch为true时,此项必填
805
832
  */
806
- getEntryUrl: (packageName: string) => Promise<string | null>;
833
+ description?: LanguageTextMap;
807
834
  /**
808
- * 通过包名获取组件包信息
809
- * @param name
835
+ * 当showInSearch为true时,此项必填
810
836
  */
811
- getPackage: (name: string) => Promise<WidgetPackage | undefined>;
837
+ keywords?: WidgetKeyword[];
838
+ lang: LanguageCode;
839
+ packageName?: string;
840
+ icon?: string;
812
841
  /**
813
- * 获取已经安装的组件包
842
+ * 当showInSearch为true时,此项必填
814
843
  */
815
- getPackages: () => Promise<WidgetPackage[]>;
844
+ previewImage?: string;
816
845
  /**
817
- * Install a widget package, if the package is a string, it will be treated as a path or http url to install the widget.zip file.
818
- * @param widgetPackage
846
+ * 是否在搜索中显示
819
847
  */
820
- install: (widgetPackage: WidgetPackage | string) => Promise<void>;
848
+ showInSearch?: boolean;
821
849
  /**
822
- * Uninstall a widget package by package name.
823
- * @param packageName
824
- * @param clearData Whether to clear the data of the widget package, default is false.
850
+ * 悬浮窗模式 是否可移动
851
+ * @deprecated
825
852
  */
826
- uninstall: (widgetPackage: WidgetPackage | string, clearData?: boolean) => Promise<void>;
827
- }
828
- type WidgetPackageApiMethods = keyof IWidgetPackageApi;
829
- /**
830
- * WidgetPackageApiEvent
831
- */
832
- declare enum WidgetPackageApiEvent {
853
+ movable?: boolean;
833
854
  /**
834
- * 组件包升级事件
855
+ * @deprecated
835
856
  */
836
- PACKAGE_UPGRADE = "event::cn.widgetjs.core.widget.package.upgraded",
857
+ resizable?: boolean;
837
858
  /**
838
- * 组件包安装事件
859
+ * @deprecated
839
860
  */
840
- PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
841
- }
842
-
843
- /**
844
- * LogApi提供了日志输出的方法,日志会保存在用户的`当前用户名/文档/桌面组件/logs/日期/组件包名.log`文件中
845
- */
846
- interface ILogApi {
847
- info: (...data: any[]) => void;
848
- error: (...data: any[]) => void;
849
- warn: (...data: any[]) => void;
850
- log: (...data: any[]) => void;
851
- json: (data: any) => void;
852
- }
853
- type LogApiMethods = keyof ILogApi;
854
-
855
- /**
856
- * ProcessApi 提供进程信息获取功能
857
- */
858
- interface IProcessApi {
859
- getBlinkMemoryInfo: () => Promise<Electron.BlinkMemoryInfo>;
860
- getHeapStatistics: () => Promise<Electron.HeapStatistics>;
861
+ backgroundThrottling?: boolean;
862
+ security?: boolean;
861
863
  /**
862
- * 获取系统版本信息
863
- * @example '10.0.17763'
864
+ * @deprecated
864
865
  */
865
- getSystemVersion: () => Promise<string>;
866
+ webviewTag?: boolean;
867
+ path: string;
866
868
  /**
867
- * 获取当前应用内存信息
869
+ * 是否只能添加一次
868
870
  */
869
- getProcessMemoryInfo: () => Promise<Electron.ProcessMemoryInfo>;
871
+ singleton?: boolean;
872
+ permissions?: WidgetPermission[];
873
+ meta?: MetaInfo;
874
+ broadcastChannels?: string[];
870
875
  }
871
- type ProcessApiMethods = keyof IProcessApi;
872
-
873
- /**
874
- * MouseApi
875
- */
876
- interface IMouseApi {
876
+ interface IPage {
877
+ readonly name: string;
877
878
  /**
878
- * Create a mouse screen edge hotspot, usually used for edge-hiding windows.
879
- * @param rect
879
+ * 窗口标题,显示在界面上的,
880
+ * https://zh.m.wikipedia.org/zh-hans/ISO_639-1
880
881
  */
881
- createHotspot: (rect: Rectangle) => Promise<void>;
882
+ readonly title: LanguageTextMap;
883
+ readonly permissions: WidgetPermission[];
884
+ readonly webviewTag: boolean;
882
885
  /**
883
- * Remove the mouse screen edge hotspot.
886
+ * 窗口介绍
884
887
  */
885
- removeHotspot: () => Promise<void>;
886
- }
887
- /**
888
- * SystemApiEvent
889
- */
890
- declare enum MouseApiEvent {
888
+ readonly description: LanguageTextMap;
889
+ readonly keywords: WidgetKeyword[];
891
890
  /**
892
- * Triggered when the mouse enters the hotspot area.
891
+ * 组件默认语言
893
892
  */
894
- HOTSPOT_ACTIVE = "event::cn.widgetjs.core.mouse.hotspot.active"
895
- }
896
- type MouseApiMethods = keyof IMouseApi;
897
-
898
- /**
899
- * @see https://electronjs.org/docs/api/structures/size
900
- */
901
- interface Size {
902
- height: number;
903
- width: number;
904
- }
905
-
906
- /**
907
- * @see https://electronjs.org/docs/api/structures/display
908
- */
909
- interface Display {
893
+ readonly lang: LanguageCode;
894
+ readonly width: number;
895
+ packageName?: string | null;
896
+ readonly height: number;
897
+ readonly maxWidth: number;
898
+ readonly maxHeight: number;
899
+ readonly minWidth: number;
900
+ readonly minHeight: number;
901
+ readonly movable: boolean;
902
+ readonly singleton: boolean;
903
+ readonly resizable: boolean;
904
+ readonly path: string;
905
+ readonly meta: {
906
+ [key: string]: string | number | boolean;
907
+ };
908
+ readonly backgroundThrottling: boolean;
910
909
  /**
911
- * Can be `available`, `unavailable`, `unknown`.
910
+ * 预览图片,可以是GIF
912
911
  */
913
- accelerometerSupport: ('available' | 'unavailable' | 'unknown');
912
+ readonly previewImage?: string;
913
+ }
914
+ declare class Page implements IPage {
914
915
  /**
915
- * the bounds of the display in DIP points.
916
+ * 页面名称,名称必须以包名开头,如果以.开头,会自动加上包名<br>
917
+ * 假设包名为`example.com`,以下两种写法等价
918
+ * @example example.com.countdown
919
+ * @example .countdown
916
920
  */
917
- bounds: Rectangle;
921
+ name: string;
918
922
  /**
919
- * The number of bits per pixel.
923
+ * 窗口标题,显示在界面上的,
924
+ * @see https://zh.m.wikipedia.org/zh-hans/ISO_639-1
920
925
  */
921
- colorDepth: number;
926
+ readonly title: LanguageTextMap;
922
927
  /**
923
- * represent a color space (three-dimensional object which contains all realizable
924
- * color combinations) for the purpose of color conversions
928
+ * 窗口介绍
925
929
  */
926
- colorSpace: string;
930
+ readonly description: LanguageTextMap;
931
+ readonly keywords: WidgetKeyword[];
932
+ readonly security: boolean;
933
+ readonly permissions: WidgetPermission[];
927
934
  /**
928
- * The number of bits per color component.
935
+ * 组件默认语言
929
936
  */
930
- depthPerComponent: number;
937
+ readonly lang: LanguageCode;
938
+ readonly width: number;
939
+ packageName?: string | null;
940
+ readonly height: number;
941
+ readonly maxWidth: number;
931
942
  /**
932
- * The display refresh rate.
943
+ * @deprecated
933
944
  */
934
- displayFrequency: number;
945
+ readonly webviewTag: boolean;
946
+ readonly maxHeight: number;
947
+ readonly minWidth: number;
948
+ readonly minHeight: number;
949
+ readonly movable: boolean;
950
+ readonly singleton: boolean;
951
+ readonly resizable: boolean;
952
+ readonly path: string;
953
+ readonly icon?: string;
954
+ readonly meta: MetaInfo;
955
+ readonly backgroundThrottling: boolean;
935
956
  /**
936
- * Unique identifier associated with the display.
957
+ * 预览图片,可以是GIF
937
958
  */
938
- id: number;
959
+ readonly previewImage?: string;
960
+ constructor(options: IPageOptions);
939
961
  /**
940
- * `true` for an internal display and `false` for an external display
962
+ * 获取组件标题
963
+ * @param lang 语言环境,不传则获取默认语言
941
964
  */
942
- internal: boolean;
965
+ getTitle(lang?: LanguageCode): string | undefined;
943
966
  /**
944
- * User-friendly label, determined by the platform.
967
+ * 获取组件描述
968
+ * @param lang 语言环境,不传则获取默认标题
945
969
  */
946
- label: string;
970
+ getDescription(lang?: LanguageCode): string | undefined;
971
+ static parseJSON(json: string): Page;
972
+ static parseObject(obj: any): Page;
973
+ isResizable(): boolean;
974
+ }
975
+
976
+ type SocialType = 'qq' | 'wechat' | 'qq-group' | 'discord' | 'telegram' | 'tiktok' | 'douyin' | 'youtube' | 'instagram' | 'twitter' | 'facebook' | 'kuaishou' | 'bilibili' | 'github' | 'email' | 'gitee' | 'homepage';
977
+ declare class SocialInfo {
978
+ content: string;
979
+ name: SocialType;
980
+ constructor(name: SocialType, content: string);
981
+ }
982
+ interface SocialLink {
983
+ name: SocialType;
984
+ link: string;
985
+ }
986
+
987
+ /**
988
+ * @see [Web Manifest Categories]https://developer.mozilla.org/en-US/docs/Web/Manifest/categories
989
+ * @see [W3C Categories](https://github.com/w3c/manifest/wiki/Categories)
990
+ */
991
+ type Category = 'news' | 'photo' | 'productivity' | 'social' | 'utilities' | 'weather'
992
+ /**
993
+ * @deprecated
994
+ */
995
+ | 'calendar' | 'fun'
996
+ /**
997
+ * @deprecated
998
+ */
999
+ | 'countdown' | 'time' | 'finance' | 'ai';
1000
+
1001
+ interface IWidgetOptions extends IWindowSize, IPageOptions {
1002
+ supportDeployMode?: DeployMode;
1003
+ configPagePath?: string;
1004
+ /**
1005
+ * 如果为true,组件将不会添加到组件包中
1006
+ */
1007
+ disabled?: boolean;
1008
+ previewImage: string;
1009
+ /**
1010
+ * whether the widget data can be synchronized
1011
+ */
1012
+ synchronizable?: boolean;
1013
+ categories?: Category[];
1014
+ /**
1015
+ * 组件包所需的App版本
1016
+ */
1017
+ requiredAppVersion?: string;
1018
+ description: LanguageTextMap;
1019
+ keywords: WidgetKeyword[];
1020
+ /**
1021
+ * @deprecated
1022
+ */
1023
+ routes?: WidgetRoute[];
1024
+ /**
1025
+ * 一般用于填写教程链接
1026
+ */
1027
+ socialLinks?: SocialLink[];
1028
+ browserWindowOptions?: Pick<BrowserWindowOptions, 'backgroundThrottling'>;
1029
+ trayOptions?: TrayWidgetOptions;
1030
+ }
1031
+ interface IBackgroundWidgetOptions extends Omit<IWidgetOptions, 'width' | 'height'> {
1032
+ width?: number;
1033
+ height?: number;
1034
+ browserWindowOptions?: BrowserWindowOptions;
1035
+ }
1036
+ /**
1037
+ * @deprecated
1038
+ */
1039
+ interface WidgetRoute {
1040
+ url: string;
1041
+ name: string;
1042
+ }
1043
+ interface TrayWidgetOptions {
1044
+ closeOnBlur?: boolean;
1045
+ hideOnBlur?: boolean;
1046
+ }
1047
+ declare class Widget extends Page {
1048
+ readonly previewImage: string;
1049
+ readonly categories?: Category[];
1050
+ readonly supportDeployMode: number;
1051
+ readonly trayOptions?: TrayWidgetOptions;
1052
+ /**
1053
+ * 组件包所需的App版本
1054
+ */
1055
+ readonly requiredAppVersion?: string;
1056
+ /**
1057
+ * 如果为true,组件将不会添加到组件包中
1058
+ */
1059
+ readonly disabled?: boolean;
1060
+ readonly synchronizable?: boolean;
1061
+ /**
1062
+ * 配置页面路径,没有则不能修改
1063
+ */
1064
+ readonly configPagePath?: string;
1065
+ /**
1066
+ * @deprecated
1067
+ */
1068
+ readonly routes: WidgetRoute[];
1069
+ protected browserWindowOptions?: BrowserWindowOptions;
1070
+ readonly socialLinks?: SocialLink[];
1071
+ constructor(options: IWidgetOptions);
1072
+ static parseJSON(json: string): Widget;
1073
+ static parseObject(obj: any): Widget;
1074
+ /**
1075
+ * 是否支持悬浮窗
1076
+ */
1077
+ isSupportOverlap(): boolean;
1078
+ isSupportBackground(): boolean;
1079
+ isSupportTray(): boolean;
1080
+ /**
1081
+ * 是否支持普通模式
1082
+ */
1083
+ isSupportNormal(): boolean;
1084
+ isConfigurable(): boolean;
1085
+ }
1086
+ declare class BackgroundWidget extends Widget {
1087
+ constructor(options: IBackgroundWidgetOptions);
1088
+ }
1089
+ declare enum WidgetKeyword {
1090
+ RECOMMEND = "recommend",
1091
+ TOOLS = "tools",
1092
+ EFFICIENCY = "efficiency",
1093
+ PICTURE = "picture",
1094
+ LIFE = "life",
1095
+ SHORTCUT = "shortcut",
1096
+ COUNTDOWN = "countdown",
1097
+ TIMER = "timer",
1098
+ INFO = "info",
1099
+ DASHBOARD = "dashboard"
1100
+ }
1101
+
1102
+ declare class WidgetParams {
1103
+ static readonly PARAM_PREFIX = "w_";
1104
+ static readonly PARAM_ID = "id";
1105
+ static readonly PARAM_LANG = "lang";
1106
+ static readonly PARAM_THEME = "theme";
1107
+ static readonly PARAM_MODE = "mode";
1108
+ static readonly PARAM_NAME = "name";
1109
+ static readonly PARAM_TITLE = "title";
1110
+ static readonly PARAM_PREVIEW = "preview";
1111
+ static readonly PARAMS: string[];
1112
+ id?: string;
1113
+ width?: number;
1114
+ widthPx?: number;
1115
+ heightPx?: number;
1116
+ height?: number;
1117
+ x?: number;
1118
+ y?: number;
1119
+ preview?: boolean;
1120
+ lang?: string;
1121
+ theme?: ThemeMode;
1122
+ mode?: DeployMode;
1123
+ radius?: number;
1124
+ name?: string;
1125
+ title?: string;
1126
+ /**
1127
+ * 将组件参数转为url参数
1128
+ * @param object
1129
+ * @return URLSearchParams w_w=2&w_h=2&w_id=21&w_width=156&w_height=156
1130
+ */
1131
+ toUrlParams(): URLSearchParams;
1132
+ getPersistKey(): string;
1133
+ /**
1134
+ * 从当前地址解析组件参数:
1135
+ * http://localhost:8080/#/widget/config/labor_progress?w_w=2&w_h=2&w_width=156&w_height=156
1136
+ * =>
1137
+ * {width:2,height:2,id:21,width_px:156,height_px:156}
1138
+ */
1139
+ static fromCurrentLocation(): WidgetParams;
1140
+ static fromLocation(url: string): WidgetParams;
1141
+ private static setValue;
1142
+ /**
1143
+ * 从对象键值对中初始化组件参数
1144
+ * {w_width:2,w_height:2,w_id:21,w_width_px:156,w_height_px:156}=>
1145
+ * {width:2,height:2,id:21,width_px:156,height_px:156}
1146
+ * @param object
1147
+ */
1148
+ static fromObject(object: any): WidgetParams;
1149
+ }
1150
+ declare enum ThemeMode {
1151
+ AUTO = "auto",
1152
+ LIGHT = "LIGHT",
1153
+ DARK = "DARK"
1154
+ }
1155
+
1156
+ declare abstract class BaseApi<T extends string> {
1157
+ abstract getChannel(): string;
1158
+ protected invokeMethod(method: T, ...args: any[]): Promise<any>;
1159
+ protected invoke(...args: any[]): Promise<any>;
1160
+ }
1161
+
1162
+ interface AddWidgetOption {
1163
+ widgetName: string;
1164
+ widgetTitle?: string;
1165
+ deployMode: DeployMode;
1166
+ packageJsonUrl?: string;
1167
+ hostname?: string;
1168
+ }
1169
+ type DeployedWidgetApiMethods = keyof IDeployedWidgetApi;
1170
+ declare class DeployedWidgetApiImpl extends BaseApi<DeployedWidgetApiMethods> implements IDeployedWidgetApi {
1171
+ getChannel(): string;
1172
+ /**
1173
+ * 移除组件
1174
+ * @param id
1175
+ */
1176
+ removeDeployedWidget(id?: string): Promise<any>;
1177
+ addWidget(options: AddWidgetOption): Promise<Widget[]>;
1178
+ createDesktopShortcut(widgetName: string): Promise<boolean>;
1179
+ /**
1180
+ * 通过组件名移除已添加的组件
1181
+ * @param name 组件名
1182
+ */
1183
+ removeDeployedWidgetByName(name: string): Promise<DeployedWidget[]>;
1184
+ /**
1185
+ * 获取已添加的组件
1186
+ * @param name 组件名,可以不传
1187
+ */
1188
+ getDeployedWidgets(name?: string): Promise<DeployedWidget[]>;
1189
+ getDeployedWidget(id: string): Promise<DeployedWidget>;
1190
+ /**
1191
+ * Opens the dev tools for a widget with the specified ID.
1192
+ *
1193
+ * @param {string} widgetId - The ID of the widget to open the dev tools for.
1194
+ * @return {Promise} A Promise that resolves when the dev tools are opened.
1195
+ */
1196
+ openDevTools(widgetId: string): Promise<any>;
1197
+ openConfigPage(widgetId?: string, params?: WidgetParams): Promise<any>;
1198
+ /**
1199
+ * 注册激活、呼出、置顶组件快捷键
1200
+ * @param widgetId 组件id
1201
+ * @param shortcut 如果传空或者不传,则会取消快捷键。更多快捷键配置,请查看Accelerator用法
1202
+ * https://www.electronjs.org/docs/latest/api/accelerator
1203
+ */
1204
+ registerActiveShortcut(widgetId: string, shortcut?: string): Promise<boolean>;
1205
+ setProxy(widgetId: string, proxy: string): Promise<boolean>;
1206
+ setSize(widgetId: string, width: number, height: number): Promise<void>;
1207
+ }
1208
+ declare const DeployedWidgetApi: DeployedWidgetApiImpl;
1209
+
1210
+ /**
1211
+ * DeployedWidgetApi provides methods for managing deployed widgets within the application.
1212
+ * It allows for the removal, retrieval, and configuration of deployed widgets,
1213
+ * as well as the ability to manipulate their settings and behavior.
1214
+ * @remarks
1215
+ */
1216
+ interface IDeployedWidgetApi {
1217
+ removeDeployedWidget: (id?: string) => Promise<void>;
1218
+ removeDeployedWidgetByName: (name: string) => Promise<DeployedWidget[]>;
1219
+ getDeployedWidgets: () => Promise<DeployedWidget[]>;
1220
+ openDevTools: (id: string) => Promise<void>;
1221
+ /**
1222
+ * @deprecated Use WidgetApi.openConfigPage instead
1223
+ * @param id
1224
+ */
1225
+ openConfigPage: (id?: string, params?: WidgetParams) => Promise<void>;
1226
+ registerActiveShortcut: (id: string, shortcut: string) => Promise<boolean>;
1227
+ /**
1228
+ * Set proxy for the widget, this will reload the widget after setting the proxy.
1229
+ * @param id
1230
+ * @param proxy
1231
+ */
1232
+ setProxy: (id: string, proxy: string) => Promise<boolean>;
1233
+ getDeployedWidget: (id: string) => Promise<DeployedWidget>;
1234
+ /**
1235
+ * Adds a new widget with the specified options.
1236
+ * If in browser environment, it will open widget://widgetjs.cn/widget?packageUrl=xxx&name=xxx&package
1237
+ * @param options - The options for the widget to be added.
1238
+ * @returns A promise that resolves with an array of added widgets.
1239
+ */
1240
+ addWidget: (options: AddWidgetOption) => Promise<Widget[]>;
1241
+ /**
1242
+ * Create a desktop shortcut
1243
+ * @param widgetName Widget name
1244
+ * @returns Returns true on success, false otherwise
1245
+ */
1246
+ createDesktopShortcut: (widgetName: string) => Promise<boolean>;
1247
+ /**
1248
+ * Set widget size
1249
+ * @param widgetId Widget ID
1250
+ * @param width Width
1251
+ * @param height Height
1252
+ */
1253
+ setSize: (widgetId: string, width: number, height: number) => Promise<void>;
1254
+ }
1255
+ /**
1256
+ * AiApiEvent
1257
+ */
1258
+ declare enum DeployedWidgetApiEvent {
1259
+ /**
1260
+ * Second instance start event
1261
+ */
1262
+ SECOND_INSTANCE = "channel::cn.widgetjs.core.deployed_widget.second_instance"
1263
+ }
1264
+
1265
+ /**
1266
+ * @see https://electronjs.org/docs/api/structures/size
1267
+ */
1268
+ interface Size {
1269
+ height: number;
1270
+ width: number;
1271
+ }
1272
+
1273
+ /**
1274
+ * @see https://electronjs.org/docs/api/structures/display
1275
+ */
1276
+ interface Display {
1277
+ /**
1278
+ * Can be `available`, `unavailable`, `unknown`.
1279
+ */
1280
+ accelerometerSupport: ('available' | 'unavailable' | 'unknown');
1281
+ /**
1282
+ * the bounds of the display in DIP points.
1283
+ */
1284
+ bounds: Rectangle;
1285
+ /**
1286
+ * The number of bits per pixel.
1287
+ */
1288
+ colorDepth: number;
1289
+ /**
1290
+ * represent a color space (three-dimensional object which contains all realizable
1291
+ * color combinations) for the purpose of color conversions
1292
+ */
1293
+ colorSpace: string;
1294
+ /**
1295
+ * The number of bits per color component.
1296
+ */
1297
+ depthPerComponent: number;
1298
+ /**
1299
+ * The display refresh rate.
1300
+ */
1301
+ displayFrequency: number;
1302
+ /**
1303
+ * Unique identifier associated with the display.
1304
+ */
1305
+ id: number;
1306
+ /**
1307
+ * `true` for an internal display and `false` for an external display
1308
+ */
1309
+ internal: boolean;
1310
+ /**
1311
+ * User-friendly label, determined by the platform.
1312
+ */
1313
+ label: string;
947
1314
  /**
948
1315
  * Whether or not the display is a monochrome display.
949
1316
  */
@@ -1052,6 +1419,22 @@ interface IDeviceApi {
1052
1419
  isCapsLockOn: () => Promise<boolean>;
1053
1420
  }
1054
1421
 
1422
+ /**
1423
+ * DialogApi provides file and folder selection functions
1424
+ */
1425
+ interface IDialogApi {
1426
+ /**
1427
+ * Pick a single file
1428
+ * @param extensions Allowed file extension formats, e.g., ["txt", "docx", "gif"]
1429
+ */
1430
+ pickFile: (extensions?: string[]) => Promise<string | undefined>;
1431
+ /**
1432
+ * Pick a folder
1433
+ */
1434
+ pickFolder: () => Promise<string | undefined>;
1435
+ }
1436
+ type DialogApiMethods = keyof IDialogApi;
1437
+
1055
1438
  interface Metadata {
1056
1439
  /** Number value of the EXIF Orientation header, if present */
1057
1440
  orientation?: number | undefined;
@@ -2225,8 +2608,63 @@ interface IFileApi {
2225
2608
  }
2226
2609
 
2227
2610
  /**
2228
- * MenuApi 接口定义了一系列用于控制窗口的方法,这些方法提供了窗口的显示、隐藏、移动、调整大小等功能
2229
- * @remarks 注意:桌面类型组件不支持窗口移动、调整大小、最大化、最小化等操作
2611
+ * LogApi provides log output methods, logs will be saved in the user's current username/Documents/widgets/logs/date/widget_package_name.log file
2612
+ */
2613
+ interface ILogApi {
2614
+ info: (...data: any[]) => void;
2615
+ error: (...data: any[]) => void;
2616
+ warn: (...data: any[]) => void;
2617
+ log: (...data: any[]) => void;
2618
+ json: (data: any) => void;
2619
+ }
2620
+ type LogApiMethods = keyof ILogApi;
2621
+
2622
+ /**
2623
+ * MouseApi
2624
+ */
2625
+ interface IMouseApi {
2626
+ /**
2627
+ * Create a mouse screen edge hotspot, usually used for edge-hiding windows.
2628
+ * @param rect
2629
+ */
2630
+ createHotspot: (rect: Rectangle) => Promise<void>;
2631
+ /**
2632
+ * Remove the mouse screen edge hotspot.
2633
+ */
2634
+ removeHotspot: () => Promise<void>;
2635
+ }
2636
+ /**
2637
+ * SystemApiEvent
2638
+ */
2639
+ declare enum MouseApiEvent {
2640
+ /**
2641
+ * Triggered when the mouse enters the hotspot area.
2642
+ */
2643
+ HOTSPOT_ACTIVE = "event::cn.widgetjs.core.mouse.hotspot.active"
2644
+ }
2645
+ type MouseApiMethods = keyof IMouseApi;
2646
+
2647
+ /**
2648
+ * ProcessApi provides process information retrieval functions
2649
+ */
2650
+ interface IProcessApi {
2651
+ getBlinkMemoryInfo: () => Promise<Electron.BlinkMemoryInfo>;
2652
+ getHeapStatistics: () => Promise<Electron.HeapStatistics>;
2653
+ /**
2654
+ * Get system version information
2655
+ * @example '10.0.17763'
2656
+ */
2657
+ getSystemVersion: () => Promise<string>;
2658
+ /**
2659
+ * Get current application memory information
2660
+ */
2661
+ getProcessMemoryInfo: () => Promise<Electron.ProcessMemoryInfo>;
2662
+ }
2663
+ type ProcessApiMethods = keyof IProcessApi;
2664
+
2665
+ /**
2666
+ * MenuApi interface defines a series of methods for controlling windows, providing functions such as showing, hiding, moving, and resizing windows
2667
+ * @remarks Note: Desktop-type widgets do not support window moving, resizing, maximizing, minimizing, etc.
2230
2668
  */
2231
2669
  interface IMenuApi {
2232
2670
  /**
@@ -2234,12 +2672,12 @@ interface IMenuApi {
2234
2672
  */
2235
2673
  addMenuItem: (menuItems: WidgetMenuItem[]) => Promise<void>;
2236
2674
  /**
2237
- * 添加上下文菜单项,最多支持二级菜单
2675
+ * Add context menu items, up to two levels of menus are supported
2238
2676
  * @param menuItems
2239
2677
  */
2240
2678
  addContextMenuItem: (menuItems: WidgetMenuItem[]) => Promise<void>;
2241
2679
  /**
2242
- * 移除上下文菜单项
2680
+ * Remove context menu items
2243
2681
  * @param menuItemIds
2244
2682
  */
2245
2683
  removeContextMenuItem: (menuItemIds: string[]) => Promise<void>;
@@ -2248,7 +2686,7 @@ interface IMenuApi {
2248
2686
  */
2249
2687
  removeMenuItem: (menuItemIds: string[]) => Promise<void>;
2250
2688
  /**
2251
- * 显示自定义菜单
2689
+ * Show custom menu
2252
2690
  * @param options ShowMenuOption
2253
2691
  */
2254
2692
  showMenu: (options: ShowMenuOption) => Promise<void>;
@@ -2369,522 +2807,256 @@ interface ITrayApi {
2369
2807
  */
2370
2808
  setTray: (options: AddTrayOptions) => Promise<void>;
2371
2809
  /**
2372
- * Remove the tray icon and free native resources.
2373
- * Resolves when the tray has been removed.
2374
- */
2375
- removeTray: () => Promise<void>;
2376
- /**
2377
- * Displays a balloon notification.
2378
- * @param options DisplayBalloonOptions
2379
- */
2380
- displayBalloon: (options: DisplayBalloonOptions) => Promise<void>;
2381
- /**
2382
- * Removes a balloon notification.
2383
- */
2384
- removeBalloon: () => Promise<void>;
2385
- /**
2386
- * Set the context menu for the tray icon.
2387
- * Replaces any previously set menu.
2388
- * @param menus Array of WidgetMenuItem describing the menu structure
2389
- */
2390
- setContextMenu: (menus: WidgetMenuItem[]) => Promise<void>;
2391
- /**
2392
- * Close any open context menu for the tray (if supported by the platform).
2393
- */
2394
- closeContextMenu: () => Promise<void>;
2395
- /**
2396
- * Programmatically pop up a context menu at the optional screen position.
2397
- * On some platforms the position may be ignored.
2398
- * @param menus menu items to show
2399
- * @param position optional screen point where the menu should appear
2400
- */
2401
- popUpContextMenu: (menus: WidgetMenuItem[], position?: Point) => Promise<void>;
2402
- /**
2403
- * Returns whether the underlying native tray object has been destroyed.
2404
- * Useful to check before calling other tray methods.
2405
- */
2406
- isDestroyed: () => Promise<boolean>;
2407
- /**
2408
- * Get the bounds of the tray icon on screen.
2409
- * Returns a Rectangle when available, or `null` if the bounds cannot be determined
2410
- * on the current platform or if the tray is not present.
2411
- */
2412
- getBounds: () => Promise<Rectangle | null>;
2413
- /**
2414
- * Bring the application to the foreground or focus the window associated with the tray.
2415
- * Exact behavior depends on platform and application window state.
2416
- */
2417
- focus: () => Promise<void>;
2418
- }
2419
- /**
2420
- * TrayApiEvent
2421
- *
2422
- * Events emitted from the tray icon. Channels are stable strings used for internal
2423
- * event routing; subscribers should listen to these channels to react to user
2424
- * interactions with the tray icon.
2425
- */
2426
- declare enum TrayApiEvent {
2427
- /**
2428
- * Emitted when the tray icon is clicked (usually left-button click).
2429
- * Channel: 'channel::cn.widgetjs.core.tray.click'
2430
- */
2431
- CLICK = "channel::cn.widgetjs.core.tray.click",
2432
- /**
2433
- * Emitted when the tray icon receives a right-button click.
2434
- * Channel: 'channel::cn.widgetjs.core.tray.right-click'
2435
- */
2436
- RIGHT_CLICK = "channel::cn.widgetjs.core.tray.right-click",
2437
- /**
2438
- * Emitted when the tray icon receives a middle-button click (if supported).
2439
- * Channel: 'channel::cn.widgetjs.core.tray.middle-click'
2440
- */
2441
- MIDDLE_CLICK = "channel::cn.widgetjs.core.tray.middle-click",
2442
- /**
2443
- * Emitted when the mouse pointer enters the tray icon area (hover start).
2444
- * Channel: 'channel::cn.widgetjs.core.tray.mouse-enter'
2445
- */
2446
- MOUSE_ENTER = "channel::cn.widgetjs.core.tray.mouse-enter",
2447
- /**
2448
- * Emitted when the mouse pointer leaves the tray icon area (hover end).
2449
- * Channel: 'channel::cn.widgetjs.core.tray.mouse-leave'
2450
- */
2451
- MOUSE_LEAVE = "channel::cn.widgetjs.core.tray.mouse-leave"
2452
- }
2453
- type TrayApiMethods = keyof ITrayApi;
2454
-
2455
- interface IUserApi {
2456
- /**
2457
- * Login with user info.
2458
- * @param token
2459
- */
2460
- login: (session: AuthSession) => Promise<void>;
2461
- /**
2462
- * Clear user auth token and user info.
2463
- */
2464
- logout: () => Promise<void>;
2465
- /**
2466
- * Get current logged in user info. If no user is logged in, return null.
2467
- */
2468
- getUser: () => Promise<AuthUser | null>;
2469
- updateSession: (session: AuthSession) => Promise<void>;
2470
- getSession: () => Promise<AuthSession | null>;
2471
- updateUser: (user: AuthUser) => Promise<void>;
2472
- }
2473
- /**
2474
- * ShortcutApiEvent
2475
- */
2476
- declare enum UserApiEvent {
2477
- /**
2478
- * 快捷键触发事件
2479
- */
2480
- USER_UPDATED = "channel::cn.widgetjs.core.user.updated",
2481
- SIGNED_OUT = "channel::cn.widgetjs.core.user.signed.out",
2482
- SIGNED_IN = "channel::cn.widgetjs.core.user.signed.in",
2483
- TOKEN_REFRESHED = "channel::cn.widgetjs.core.user.token.refreshed"
2484
- }
2485
- type UserApiMethods = keyof IUserApi;
2486
-
2487
- interface AiConfig {
2488
- id: string;
2489
- model: string;
2490
- apiKey: string;
2491
- apiBaseUrl: string;
2492
- }
2493
- interface IAiApi {
2494
- addConfig(config: AiConfig): Promise<AiConfig>;
2495
- deleteConfig(id: string): Promise<void>;
2496
- updateConfig(config: AiConfig): Promise<void>;
2497
- getConfigList(): Promise<AiConfig[]>;
2498
- setConfigList(configs: AiConfig[]): Promise<void>;
2499
- getConfig(id: string): Promise<AiConfig | undefined>;
2500
- }
2501
- /**
2502
- * AiApiEvent
2503
- */
2504
- declare enum AiApiEvent {
2505
- /**
2506
- * 配置更新事件
2507
- */
2508
- CONFIG_UPDATED = "channel::cn.widgetjs.core.ai.config.updated"
2509
- }
2510
- type AiApiMethods = keyof IAiApi;
2511
-
2512
- declare const AppApi: IAppApi;
2513
-
2514
- declare abstract class BaseApi<T extends string> {
2515
- abstract getChannel(): string;
2516
- protected invokeMethod(method: T, ...args: any[]): Promise<any>;
2517
- protected invoke(...args: any[]): Promise<any>;
2518
- }
2519
-
2520
- /**
2521
- * WidgetApi 接口定义了一系列用于控制组件的方法,这些方法提供了组件的注册、升级、获取、打开设置页面、重新加载等功能
2522
- */
2523
- interface IWidgetApi {
2524
- /**
2525
- * 注册组件
2526
- * @param widgets
2527
- */
2528
- registerWidgets: (widgets: Widget[]) => Promise<void>;
2529
- /**
2530
- * @deprecated
2531
- */
2532
- registerWidgetPackage: (widgetPackage: WidgetPackage) => Promise<void>;
2533
- /**
2534
- * ignore mouse events
2535
- * @param widgetId
2536
- * @param ignore
2537
- */
2538
- setIgnoreMouseEvents: (widgetId: string, ignore: boolean) => Promise<void>;
2539
- /**
2540
- * Check if the widget is ignoring mouse events.
2541
- * @param widgetId
2542
- */
2543
- isIgnoreMouseEvents: (widgetId?: string) => Promise<boolean>;
2544
- /**
2545
- * 设置组件是否可以左键拖动
2546
- * @param draggable boolean true-启用左键拖动 false-禁用左键拖动
2547
- * @remarks 注意:只对悬浮窗组件(DeployMode.OVERLAP)有效
2548
- */
2549
- setMouseDraggable: (draggable: boolean) => Promise<void>;
2550
- /**
2551
- * 升级组件包
2552
- * @param packageName 组件包名
2553
- */
2554
- upgradePackage: (packageName: string) => Promise<void>;
2555
- /**
2556
- * 获取所有组件
2557
- * @return Promise<Widget[]>
2558
- */
2559
- getWidgets: () => Promise<Widget[]>;
2560
- /**
2561
- * 通过组件名称获取组件
2562
- * @param name string 组件名
2563
- * @return Promise<Widget>
2564
- */
2565
- getWidget: (name: string) => Promise<Widget>;
2566
- /**
2567
- * @param name
2568
- * @deprecated
2569
- */
2570
- getWidgetPackage: (name: string) => Promise<WidgetPackage | undefined>;
2571
- /**
2572
- * @deprecated
2573
- */
2574
- getWidgetPackages: () => Promise<WidgetPackage[]>;
2575
- /**
2576
- * 打开组件设置页面
2577
- * @param id string 组件id
2810
+ * Remove the tray icon and free native resources.
2811
+ * Resolves when the tray has been removed.
2578
2812
  */
2579
- openConfigPage: (id?: string) => Promise<void>;
2813
+ removeTray: () => Promise<void>;
2580
2814
  /**
2581
- * @param name
2815
+ * Displays a balloon notification.
2816
+ * @param options DisplayBalloonOptions
2582
2817
  */
2583
- openConfigPageByName: (name: string) => Promise<void>;
2818
+ displayBalloon: (options: DisplayBalloonOptions) => Promise<void>;
2584
2819
  /**
2585
- * 重新加载组件
2820
+ * Removes a balloon notification.
2586
2821
  */
2587
- reload: (id?: string) => Promise<void>;
2822
+ removeBalloon: () => Promise<void>;
2588
2823
  /**
2589
- *
2590
- * @param packageName
2591
- * @deprecated
2824
+ * Set the context menu for the tray icon.
2825
+ * Replaces any previously set menu.
2826
+ * @param menus Array of WidgetMenuItem describing the menu structure
2592
2827
  */
2593
- getWidgetPackageUrl: (packageName: string) => Promise<string | null>;
2594
- restartWidgets: (mode?: DeployMode) => Promise<void>;
2595
- updateSyncInfo: () => Promise<void>;
2596
- getSyncInfo: (widgetName?: string) => Promise<WidgetSyncInfo | null>;
2597
- }
2598
-
2599
- type WidgetPermission = 'keyboard' | 'mouse' | 'clipboard' | 'notification' | 'storage' | 'network' | 'cpu' | 'system-info';
2600
-
2601
- interface MetaInfo {
2602
- [key: string]: string | number | boolean;
2603
- }
2604
- interface IWindowSize {
2605
- width: number;
2606
- height: number;
2607
- maxWidth?: number;
2608
- maxHeight?: number;
2609
- minWidth?: number;
2610
- minHeight?: number;
2611
- }
2612
- interface IPageOptions extends IWindowSize {
2613
- name: string;
2828
+ setContextMenu: (menus: WidgetMenuItem[]) => Promise<void>;
2614
2829
  /**
2615
- * 当showInSearch为true时,此项必填
2830
+ * Close any open context menu for the tray (if supported by the platform).
2616
2831
  */
2617
- title: LanguageTextMap;
2832
+ closeContextMenu: () => Promise<void>;
2618
2833
  /**
2619
- * 当showInSearch为true时,此项必填
2834
+ * Programmatically pop up a context menu at the optional screen position.
2835
+ * On some platforms the position may be ignored.
2836
+ * @param menus menu items to show
2837
+ * @param position optional screen point where the menu should appear
2620
2838
  */
2621
- description?: LanguageTextMap;
2839
+ popUpContextMenu: (menus: WidgetMenuItem[], position?: Point) => Promise<void>;
2622
2840
  /**
2623
- * 当showInSearch为true时,此项必填
2841
+ * Returns whether the underlying native tray object has been destroyed.
2842
+ * Useful to check before calling other tray methods.
2624
2843
  */
2625
- keywords?: WidgetKeyword[];
2626
- lang: LanguageCode;
2627
- packageName?: string;
2628
- icon?: string;
2844
+ isDestroyed: () => Promise<boolean>;
2629
2845
  /**
2630
- * 当showInSearch为true时,此项必填
2846
+ * Get the bounds of the tray icon on screen.
2847
+ * Returns a Rectangle when available, or `null` if the bounds cannot be determined
2848
+ * on the current platform or if the tray is not present.
2631
2849
  */
2632
- previewImage?: string;
2850
+ getBounds: () => Promise<Rectangle | null>;
2633
2851
  /**
2634
- * 是否在搜索中显示
2852
+ * Bring the application to the foreground or focus the window associated with the tray.
2853
+ * Exact behavior depends on platform and application window state.
2635
2854
  */
2636
- showInSearch?: boolean;
2855
+ focus: () => Promise<void>;
2856
+ }
2857
+ /**
2858
+ * TrayApiEvent
2859
+ *
2860
+ * Events emitted from the tray icon. Channels are stable strings used for internal
2861
+ * event routing; subscribers should listen to these channels to react to user
2862
+ * interactions with the tray icon.
2863
+ */
2864
+ declare enum TrayApiEvent {
2637
2865
  /**
2638
- * 悬浮窗模式 是否可移动
2639
- * @deprecated
2866
+ * Emitted when the tray icon is clicked (usually left-button click).
2867
+ * Channel: 'channel::cn.widgetjs.core.tray.click'
2640
2868
  */
2641
- movable?: boolean;
2869
+ CLICK = "channel::cn.widgetjs.core.tray.click",
2642
2870
  /**
2643
- * @deprecated
2871
+ * Emitted when the tray icon receives a right-button click.
2872
+ * Channel: 'channel::cn.widgetjs.core.tray.right-click'
2644
2873
  */
2645
- resizable?: boolean;
2874
+ RIGHT_CLICK = "channel::cn.widgetjs.core.tray.right-click",
2646
2875
  /**
2647
- * @deprecated
2876
+ * Emitted when the tray icon receives a middle-button click (if supported).
2877
+ * Channel: 'channel::cn.widgetjs.core.tray.middle-click'
2648
2878
  */
2649
- backgroundThrottling?: boolean;
2650
- security?: boolean;
2879
+ MIDDLE_CLICK = "channel::cn.widgetjs.core.tray.middle-click",
2651
2880
  /**
2652
- * @deprecated
2881
+ * Emitted when the mouse pointer enters the tray icon area (hover start).
2882
+ * Channel: 'channel::cn.widgetjs.core.tray.mouse-enter'
2653
2883
  */
2654
- webviewTag?: boolean;
2655
- path: string;
2884
+ MOUSE_ENTER = "channel::cn.widgetjs.core.tray.mouse-enter",
2656
2885
  /**
2657
- * 是否只能添加一次
2886
+ * Emitted when the mouse pointer leaves the tray icon area (hover end).
2887
+ * Channel: 'channel::cn.widgetjs.core.tray.mouse-leave'
2658
2888
  */
2659
- singleton?: boolean;
2660
- permissions?: WidgetPermission[];
2661
- meta?: MetaInfo;
2662
- broadcastChannels?: string[];
2889
+ MOUSE_LEAVE = "channel::cn.widgetjs.core.tray.mouse-leave"
2663
2890
  }
2664
- interface IPage {
2665
- readonly name: string;
2666
- /**
2667
- * 窗口标题,显示在界面上的,
2668
- * https://zh.m.wikipedia.org/zh-hans/ISO_639-1
2669
- */
2670
- readonly title: LanguageTextMap;
2671
- readonly permissions: WidgetPermission[];
2672
- readonly webviewTag: boolean;
2891
+ type TrayApiMethods = keyof ITrayApi;
2892
+
2893
+ interface IUserApi {
2673
2894
  /**
2674
- * 窗口介绍
2895
+ * Login with user info.
2896
+ * @param token
2675
2897
  */
2676
- readonly description: LanguageTextMap;
2677
- readonly keywords: WidgetKeyword[];
2898
+ login: (session: AuthSession) => Promise<void>;
2678
2899
  /**
2679
- * 组件默认语言
2900
+ * Clear user auth token and user info.
2680
2901
  */
2681
- readonly lang: LanguageCode;
2682
- readonly width: number;
2683
- packageName?: string | null;
2684
- readonly height: number;
2685
- readonly maxWidth: number;
2686
- readonly maxHeight: number;
2687
- readonly minWidth: number;
2688
- readonly minHeight: number;
2689
- readonly movable: boolean;
2690
- readonly singleton: boolean;
2691
- readonly resizable: boolean;
2692
- readonly path: string;
2693
- readonly meta: {
2694
- [key: string]: string | number | boolean;
2695
- };
2696
- readonly backgroundThrottling: boolean;
2902
+ logout: () => Promise<void>;
2697
2903
  /**
2698
- * 预览图片,可以是GIF
2904
+ * Get current logged in user info. If no user is logged in, return null.
2699
2905
  */
2700
- readonly previewImage?: string;
2906
+ getUser: () => Promise<AuthUser | null>;
2907
+ updateSession: (session: AuthSession) => Promise<void>;
2908
+ getSession: () => Promise<AuthSession | null>;
2909
+ updateUser: (user: AuthUser) => Promise<void>;
2701
2910
  }
2702
- declare class Page implements IPage {
2911
+ /**
2912
+ * ShortcutApiEvent
2913
+ */
2914
+ declare enum UserApiEvent {
2703
2915
  /**
2704
- * 页面名称,名称必须以包名开头,如果以.开头,会自动加上包名<br>
2705
- * 假设包名为`example.com`,以下两种写法等价
2706
- * @example example.com.countdown
2707
- * @example .countdown
2916
+ * User updated event
2708
2917
  */
2709
- name: string;
2918
+ USER_UPDATED = "channel::cn.widgetjs.core.user.updated",
2919
+ SIGNED_OUT = "channel::cn.widgetjs.core.user.signed.out",
2920
+ SIGNED_IN = "channel::cn.widgetjs.core.user.signed.in",
2921
+ TOKEN_REFRESHED = "channel::cn.widgetjs.core.user.token.refreshed"
2922
+ }
2923
+ type UserApiMethods = keyof IUserApi;
2924
+
2925
+ /**
2926
+ * WidgetPackageApi provides functions such as upgrading, retrieving, and installing widget packages
2927
+ */
2928
+ interface IWidgetPackageApi {
2710
2929
  /**
2711
- * 窗口标题,显示在界面上的,
2712
- * @see https://zh.m.wikipedia.org/zh-hans/ISO_639-1
2930
+ * Upgrade widget package
2931
+ * @param packageName Widget package name
2932
+ * @param remoteUrlInfo
2713
2933
  */
2714
- readonly title: LanguageTextMap;
2934
+ upgrade: (packageName: string, remoteUrlInfo: RemotePackageUrlInfo) => Promise<void>;
2715
2935
  /**
2716
- * 窗口介绍
2936
+ * Get index url information of the widget package
2937
+ * @param packageName
2717
2938
  */
2718
- readonly description: LanguageTextMap;
2719
- readonly keywords: WidgetKeyword[];
2720
- readonly security: boolean;
2721
- readonly permissions: WidgetPermission[];
2939
+ getIndexUrl: (packageName: string) => Promise<string | null>;
2722
2940
  /**
2723
- * 组件默认语言
2941
+ * Get entry url information of the widget package
2942
+ * @param packageName
2724
2943
  */
2725
- readonly lang: LanguageCode;
2726
- readonly width: number;
2727
- packageName?: string | null;
2728
- readonly height: number;
2729
- readonly maxWidth: number;
2944
+ getEntryUrl: (packageName: string) => Promise<string | null>;
2730
2945
  /**
2731
- * @deprecated
2946
+ * Get widget package information by package name
2947
+ * @param name
2732
2948
  */
2733
- readonly webviewTag: boolean;
2734
- readonly maxHeight: number;
2735
- readonly minWidth: number;
2736
- readonly minHeight: number;
2737
- readonly movable: boolean;
2738
- readonly singleton: boolean;
2739
- readonly resizable: boolean;
2740
- readonly path: string;
2741
- readonly icon?: string;
2742
- readonly meta: MetaInfo;
2743
- readonly backgroundThrottling: boolean;
2949
+ getPackage: (name: string) => Promise<WidgetPackage | undefined>;
2744
2950
  /**
2745
- * 预览图片,可以是GIF
2951
+ * Get installed widget packages
2746
2952
  */
2747
- readonly previewImage?: string;
2748
- constructor(options: IPageOptions);
2953
+ getPackages: () => Promise<WidgetPackage[]>;
2749
2954
  /**
2750
- * 获取组件标题
2751
- * @param lang 语言环境,不传则获取默认语言
2955
+ * Install a widget package, if the package is a string, it will be treated as a path or http url to install the widget.zip file.
2956
+ * @param widgetPackage
2752
2957
  */
2753
- getTitle(lang?: LanguageCode): string | undefined;
2958
+ install: (widgetPackage: WidgetPackage | string) => Promise<void>;
2754
2959
  /**
2755
- * 获取组件描述
2756
- * @param lang 语言环境,不传则获取默认标题
2960
+ * Uninstall a widget package by package name.
2961
+ * @param packageName
2962
+ * @param clearData Whether to clear the data of the widget package, default is false.
2757
2963
  */
2758
- getDescription(lang?: LanguageCode): string | undefined;
2759
- static parseJSON(json: string): Page;
2760
- static parseObject(obj: any): Page;
2761
- isResizable(): boolean;
2762
- }
2763
-
2764
- type SocialType = 'qq' | 'wechat' | 'qq-group' | 'discord' | 'telegram' | 'tiktok' | 'douyin' | 'youtube' | 'instagram' | 'twitter' | 'facebook' | 'kuaishou' | 'bilibili' | 'github' | 'email' | 'gitee' | 'homepage';
2765
- declare class SocialInfo {
2766
- content: string;
2767
- name: SocialType;
2768
- constructor(name: SocialType, content: string);
2769
- }
2770
- interface SocialLink {
2771
- name: SocialType;
2772
- link: string;
2964
+ uninstall: (widgetPackage: WidgetPackage | string, clearData?: boolean) => Promise<void>;
2773
2965
  }
2774
-
2775
- /**
2776
- * @see [Web Manifest Categories]https://developer.mozilla.org/en-US/docs/Web/Manifest/categories
2777
- * @see [W3C Categories](https://github.com/w3c/manifest/wiki/Categories)
2778
- */
2779
- type Category = 'news' | 'photo' | 'productivity' | 'social' | 'utilities' | 'weather'
2966
+ type WidgetPackageApiMethods = keyof IWidgetPackageApi;
2780
2967
  /**
2781
- * @deprecated
2968
+ * WidgetPackageApiEvent
2782
2969
  */
2783
- | 'calendar' | 'fun'
2970
+ declare enum WidgetPackageApiEvent {
2971
+ /**
2972
+ * Widget package upgraded event
2973
+ */
2974
+ PACKAGE_UPGRADE = "event::cn.widgetjs.core.widget.package.upgraded",
2975
+ /**
2976
+ * Widget package installed event
2977
+ */
2978
+ PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
2979
+ }
2980
+
2981
+ declare const AppApi: IAppApi;
2982
+
2784
2983
  /**
2785
- * @deprecated
2984
+ * WidgetApi interface defines a series of methods for controlling widgets, providing functions such as widget registration, upgrade, retrieval, opening settings page, reloading, etc.
2786
2985
  */
2787
- | 'countdown' | 'time' | 'finance' | 'ai';
2788
-
2789
- interface IWidgetOptions extends IWindowSize, IPageOptions {
2790
- supportDeployMode?: DeployMode;
2791
- configPagePath?: string;
2986
+ interface IWidgetApi {
2792
2987
  /**
2793
- * 如果为true,组件将不会添加到组件包中
2988
+ * Register widgets
2989
+ * @param widgets
2794
2990
  */
2795
- disabled?: boolean;
2796
- previewImage: string;
2991
+ registerWidgets: (widgets: Widget[]) => Promise<void>;
2797
2992
  /**
2798
- * whether the widget data can be synchronized
2993
+ * @deprecated
2799
2994
  */
2800
- synchronizable?: boolean;
2801
- categories?: Category[];
2995
+ registerWidgetPackage: (widgetPackage: WidgetPackage) => Promise<void>;
2802
2996
  /**
2803
- * 组件包所需的App版本
2997
+ * ignore mouse events
2998
+ * @param widgetId
2999
+ * @param ignore
2804
3000
  */
2805
- requiredAppVersion?: string;
2806
- description: LanguageTextMap;
2807
- keywords: WidgetKeyword[];
3001
+ setIgnoreMouseEvents: (widgetId: string, ignore: boolean) => Promise<void>;
2808
3002
  /**
2809
- * @deprecated
3003
+ * Check if the widget is ignoring mouse events.
3004
+ * @param widgetId
2810
3005
  */
2811
- routes?: WidgetRoute[];
3006
+ isIgnoreMouseEvents: (widgetId?: string) => Promise<boolean>;
2812
3007
  /**
2813
- * 一般用于填写教程链接
3008
+ * Set whether the widget can be dragged with the left mouse button
3009
+ * @param draggable boolean true-enable left click drag false-disable left click drag
3010
+ * @remarks Note: Only effective for floating window widgets (DeployMode.OVERLAP)
2814
3011
  */
2815
- socialLinks?: SocialLink[];
2816
- browserWindowOptions?: Pick<BrowserWindowOptions, 'backgroundThrottling'>;
2817
- trayOptions?: TrayWidgetOptions;
2818
- }
2819
- interface IBackgroundWidgetOptions extends Omit<IWidgetOptions, 'width' | 'height'> {
2820
- width?: number;
2821
- height?: number;
2822
- browserWindowOptions?: BrowserWindowOptions;
2823
- }
2824
- /**
2825
- * @deprecated
2826
- */
2827
- interface WidgetRoute {
2828
- url: string;
2829
- name: string;
2830
- }
2831
- interface TrayWidgetOptions {
2832
- closeOnBlur?: boolean;
2833
- hideOnBlur?: boolean;
2834
- }
2835
- declare class Widget extends Page {
2836
- readonly previewImage: string;
2837
- readonly categories?: Category[];
2838
- readonly supportDeployMode: number;
2839
- readonly trayOptions?: TrayWidgetOptions;
3012
+ setMouseDraggable: (draggable: boolean) => Promise<void>;
2840
3013
  /**
2841
- * 组件包所需的App版本
3014
+ * Upgrade widget package
3015
+ * @param packageName Widget package name
2842
3016
  */
2843
- readonly requiredAppVersion?: string;
3017
+ upgradePackage: (packageName: string) => Promise<void>;
2844
3018
  /**
2845
- * 如果为true,组件将不会添加到组件包中
3019
+ * Get all widgets
3020
+ * @return Promise<Widget[]>
2846
3021
  */
2847
- readonly disabled?: boolean;
2848
- readonly synchronizable?: boolean;
3022
+ getWidgets: () => Promise<Widget[]>;
2849
3023
  /**
2850
- * 配置页面路径,没有则不能修改
3024
+ * Get widget by widget name
3025
+ * @param name string Widget name
3026
+ * @return Promise<Widget>
2851
3027
  */
2852
- readonly configPagePath?: string;
3028
+ getWidget: (name: string) => Promise<Widget>;
2853
3029
  /**
3030
+ * @param name
2854
3031
  * @deprecated
2855
3032
  */
2856
- readonly routes: WidgetRoute[];
2857
- protected browserWindowOptions?: BrowserWindowOptions;
2858
- readonly socialLinks?: SocialLink[];
2859
- constructor(options: IWidgetOptions);
2860
- static parseJSON(json: string): Widget;
2861
- static parseObject(obj: any): Widget;
3033
+ getWidgetPackage: (name: string) => Promise<WidgetPackage | undefined>;
2862
3034
  /**
2863
- * 是否支持悬浮窗
3035
+ * @deprecated
2864
3036
  */
2865
- isSupportOverlap(): boolean;
2866
- isSupportBackground(): boolean;
2867
- isSupportTray(): boolean;
3037
+ getWidgetPackages: () => Promise<WidgetPackage[]>;
2868
3038
  /**
2869
- * 是否支持普通模式
3039
+ * Open widget settings page
3040
+ * @param id string Widget id
2870
3041
  */
2871
- isSupportNormal(): boolean;
2872
- isConfigurable(): boolean;
2873
- }
2874
- declare class BackgroundWidget extends Widget {
2875
- constructor(options: IBackgroundWidgetOptions);
2876
- }
2877
- declare enum WidgetKeyword {
2878
- RECOMMEND = "recommend",
2879
- TOOLS = "tools",
2880
- EFFICIENCY = "efficiency",
2881
- PICTURE = "picture",
2882
- LIFE = "life",
2883
- SHORTCUT = "shortcut",
2884
- COUNTDOWN = "countdown",
2885
- TIMER = "timer",
2886
- INFO = "info",
2887
- DASHBOARD = "dashboard"
3042
+ openConfigPage: (id?: string) => Promise<void>;
3043
+ /**
3044
+ * @param name
3045
+ */
3046
+ openConfigPageByName: (name: string) => Promise<void>;
3047
+ /**
3048
+ * Reload widget
3049
+ */
3050
+ reload: (id?: string) => Promise<void>;
3051
+ /**
3052
+ *
3053
+ * @param packageName
3054
+ * @deprecated
3055
+ */
3056
+ getWidgetPackageUrl: (packageName: string) => Promise<string | null>;
3057
+ restartWidgets: (mode?: DeployMode) => Promise<void>;
3058
+ updateSyncInfo: () => Promise<void>;
3059
+ getSyncInfo: (widgetName?: string) => Promise<WidgetSyncInfo | null>;
2888
3060
  }
2889
3061
 
2890
3062
  interface LocalPackageUrlInfo {
@@ -3050,7 +3222,8 @@ declare enum WidgetApiEvent {
3050
3222
  DATA_CHANGED = "event::cn.widgetjs.core.widget.data-changed",
3051
3223
  EDIT_DESKTOP_WIDGETS = "event::cn.widgetjs.core.widget.desktop.edit",
3052
3224
  PACKAGE_UPGRADE = "event::cn.widgetjs.core.widget.package.upgraded",
3053
- PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
3225
+ PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed",
3226
+ WIDGET_REMOVED = "event::cn.widgetjs.core.widget.removed"
3054
3227
  }
3055
3228
  declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidgetApi {
3056
3229
  getSyncInfo(widgetName?: string): Promise<WidgetSyncInfo | null>;
@@ -3090,27 +3263,27 @@ declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidget
3090
3263
  declare const WidgetApi: WidgetApiImpl;
3091
3264
 
3092
3265
  /**
3093
- * ShortcutApi 提供了注册快捷键的能力,当快捷键被触发时,会发送广播事件 {@link BroadcastEvent}
3266
+ * ShortcutApi provides the ability to register shortcuts. When a shortcut is triggered, a broadcast event {@link BroadcastEvent} will be sent.
3094
3267
  */
3095
3268
  interface IShortcutApi {
3096
3269
  /**
3097
- * 注册快捷键, 如果注册成功, 触发快捷键时,会发送广播事件 {@link BroadcastEvent}
3270
+ * Register shortcut, if successful, when the shortcut is triggered, a broadcast event {@link BroadcastEvent} will be sent.
3098
3271
  * @see [Electron Accelerator](https://www.electronjs.org/docs/latest/api/accelerator)
3099
3272
  * @param shortcut string
3100
- * @return Promise<boolean> true 注册成功,false 注册失败
3273
+ * @return Promise<boolean> true on success, false on failure
3101
3274
  * @example
3102
3275
  * ```typescript
3103
- * //Meta 通常为windows键
3276
+ * // Meta is usually the Windows key
3104
3277
  * ShortcutApi.register('Ctrl+Meta+Y')
3105
3278
  * ```
3106
3279
  */
3107
3280
  register: (shortcut: string) => Promise<boolean>;
3108
3281
  /**
3109
- * 注销快捷键
3282
+ * Unregister shortcut
3110
3283
  * @param shortcut string
3111
3284
  * @example
3112
3285
  * ```typescript
3113
- * //Meta 通常为windows键
3286
+ * // Meta is usually the Windows key
3114
3287
  * ShortcutApi.unregister('Ctrl+Meta+Y')
3115
3288
  * ```
3116
3289
  */
@@ -3121,7 +3294,7 @@ interface IShortcutApi {
3121
3294
  */
3122
3295
  declare enum ShortcutApiEvent {
3123
3296
  /**
3124
- * 快捷键触发事件
3297
+ * Shortcut triggered event
3125
3298
  */
3126
3299
  TRIGGERED = "channel::cn.widgetjs.core.shortcut.triggered"
3127
3300
  }
@@ -3141,173 +3314,173 @@ declare enum ClipboardApiEvent {
3141
3314
  declare const ClipboardApi: IClipboardApi;
3142
3315
 
3143
3316
  /**
3144
- * BrowserWindowApi 接口定义了一系列用于控制窗口的方法,这些方法提供了窗口的显示、隐藏、移动、调整大小等功能
3145
- * @remarks 注意:桌面类型组件不支持窗口移动、调整大小、最大化、最小化等操作
3317
+ * BrowserWindowApi interface defines a series of methods for controlling windows, providing functions such as showing, hiding, moving, and resizing windows
3318
+ * @remarks Note: Desktop-type widgets do not support window moving, resizing, maximizing, minimizing, etc.
3146
3319
  */
3147
3320
  interface IBrowserWindowApi {
3148
3321
  /**
3149
- * 设置是否忽略鼠标事件
3322
+ * Set whether to ignore mouse events
3150
3323
  * @param ignore boolean
3151
3324
  */
3152
3325
  setIgnoreMouseEvent: (ignore: boolean) => Promise<void>;
3153
3326
  /**
3154
- * 显示窗口
3327
+ * Show window
3155
3328
  */
3156
3329
  show: () => Promise<void>;
3157
3330
  /**
3158
- * 设置窗口是否有阴影
3331
+ * Set whether the window has a shadow
3159
3332
  * @param hasShadow boolean
3160
3333
  */
3161
3334
  setHasShadow: (hasShadow: boolean) => Promise<void>;
3162
3335
  /**
3163
- * 隐藏窗口
3336
+ * Hide window
3164
3337
  */
3165
3338
  hide: () => Promise<void>;
3166
3339
  /**
3167
- * 关闭窗口
3340
+ * Close window
3168
3341
  */
3169
3342
  close: () => Promise<void>;
3170
3343
  /**
3171
- * 以不激活窗口的方式显示窗口
3344
+ * Show window without activating it
3172
3345
  */
3173
3346
  showInactive: () => Promise<void>;
3174
3347
  /**
3175
- * 将窗口居中
3348
+ * Center window
3176
3349
  */
3177
3350
  center: () => Promise<void>;
3178
3351
  /**
3179
- * 最小化窗口
3352
+ * Minimize window
3180
3353
  */
3181
3354
  minimize: () => Promise<void>;
3182
3355
  /**
3183
- * 还原窗口
3356
+ * Restore window
3184
3357
  */
3185
3358
  restore: () => Promise<void>;
3186
3359
  /**
3187
- * 窗口是否最小后
3360
+ * Whether the window is minimized
3188
3361
  * @return Promise<boolean>
3189
3362
  */
3190
3363
  isMinimized: () => Promise<boolean>;
3191
3364
  /**
3192
- * 检查窗口是否最大化
3365
+ * Check if the window is maximized
3193
3366
  * @return Promise<boolean>
3194
3367
  */
3195
3368
  isMaximized: () => Promise<boolean>;
3196
3369
  /**
3197
- * 检查窗口是否可见
3370
+ * Check if the window is visible
3198
3371
  * @return Promise<boolean>
3199
3372
  */
3200
3373
  isVisible: () => Promise<boolean>;
3201
3374
  /**
3202
- * 检查窗口是否可调整大小
3375
+ * Check if the window is resizable
3203
3376
  * @since 24.1.1-beta.6
3204
3377
  * @return Promise<boolean>
3205
3378
  */
3206
3379
  isResizable: () => Promise<boolean>;
3207
3380
  /**
3208
- * 最大化窗口
3381
+ * Maximize window
3209
3382
  */
3210
3383
  maximize: () => Promise<void>;
3211
3384
  /**
3212
- * 停止拖动窗口
3385
+ * Stop dragging the window
3213
3386
  */
3214
3387
  stopDraggingWindow: () => Promise<void>;
3215
3388
  /**
3216
- * 开始拖动窗口
3389
+ * Start dragging the window
3217
3390
  */
3218
3391
  startDraggingWindow: () => Promise<void>;
3219
3392
  /**
3220
- * 检查窗口是否正在拖动
3393
+ * Check if the window is being dragged
3221
3394
  * @return Promise<boolean>
3222
3395
  */
3223
3396
  isDraggingWindow: () => Promise<boolean>;
3224
3397
  /**
3225
- * 设置窗口是否总在最前
3398
+ * Set whether the window is always on top
3226
3399
  * @param alwaysOnTop boolean
3227
3400
  */
3228
3401
  setAlwaysOnTop: (alwaysOnTop: boolean) => Promise<void>;
3229
3402
  /**
3230
- * 检查窗口是否总在最前
3403
+ * Check if the window is always on top
3231
3404
  * @return Promise<boolean>
3232
3405
  */
3233
3406
  isAlwaysOnTop: () => Promise<boolean>;
3234
3407
  /**
3235
- * 打开指定的 URL
3236
- * @param url string 要打开的 URL
3237
- * @param option OpenUrlOptions - 可选参数,用于配置 URL 打开的方式
3408
+ * Open specified URL
3409
+ * @param url string The URL to open
3410
+ * @param option OpenUrlOptions - Optional parameters for configuring how the URL is opened
3238
3411
  */
3239
3412
  openUrl: (url: string, option?: BrowserWindowOptions) => Promise<void>;
3240
3413
  /**
3241
- * 将窗口置于最前
3414
+ * Move the window to the top
3242
3415
  */
3243
3416
  moveTop: () => Promise<void>;
3244
3417
  /**
3245
- * 取消最大化窗口
3418
+ * Unmaximize window
3246
3419
  */
3247
3420
  unmaximize: () => Promise<void>;
3248
3421
  /**
3249
- * 重新加载窗口
3422
+ * Reload window
3250
3423
  */
3251
3424
  reload: () => Promise<void>;
3252
3425
  /**
3253
- * 设置窗口大小
3254
- * @param width boolean - 窗口宽度
3255
- * @param height boolean - 窗口高度
3256
- * @param animate boolean - 是否使用动画(可选)
3426
+ * Set window size
3427
+ * @param width boolean - Window width
3428
+ * @param height boolean - Window height
3429
+ * @param animate boolean - Whether to use animation (optional)
3257
3430
  */
3258
3431
  setSize: (width: number, height: number, animate?: boolean) => Promise<void>;
3259
3432
  /**
3260
- * 获取窗口大小
3433
+ * Get window size
3261
3434
  * @since 24.1.1-beta.6
3262
3435
  * @returns Promise<number[]>
3263
3436
  */
3264
3437
  getSize: () => Promise<number[]>;
3265
3438
  /**
3266
- * 打开开发者工具
3439
+ * Open developer tools
3267
3440
  */
3268
3441
  openDevTools: () => Promise<void>;
3269
3442
  /**
3270
- * 设置窗口位置
3271
- * @param {SetPositionOptions} options - 配置窗口位置的选项
3443
+ * Set window position
3444
+ * @param {SetPositionOptions} options - Options for configuring the window position
3272
3445
  */
3273
3446
  setPosition: (options: SetPositionOptions) => Promise<void>;
3274
3447
  /**
3275
- * 获取窗口位置
3276
- * @returns {Promise<Position>} 返回一个 Promise,解析为窗口的位置
3448
+ * Get window position
3449
+ * @returns {Promise<Position>} Returns a Promise that resolves to the window's position
3277
3450
  */
3278
3451
  getPosition: () => Promise<Position>;
3279
3452
  /**
3280
- * 使窗口失去焦点
3453
+ * Blur window
3281
3454
  */
3282
3455
  blur: () => Promise<void>;
3283
3456
  /**
3284
- * 聚焦窗口
3457
+ * Focus window
3285
3458
  */
3286
3459
  focus: () => Promise<void>;
3287
3460
  /**
3288
- * 设置窗口是否可调整大小
3289
- * @param resizable boolean - 是否可调整大小
3461
+ * Set whether the window is resizable
3462
+ * @param resizable boolean - Whether it is resizable
3290
3463
  */
3291
3464
  setResizable: (resizable: boolean) => Promise<void>;
3292
3465
  /**
3293
- * 设置窗口是否可移动
3294
- * @param movable boolean - 是否可移动
3466
+ * Set whether the window is movable
3467
+ * @param movable boolean - Whether it is movable
3295
3468
  */
3296
3469
  setMovable: (movable: boolean) => Promise<void>;
3297
3470
  /**
3298
- * 获取窗口边界
3471
+ * Get window bounds
3299
3472
  * @returns Promise<Rectangle>
3300
3473
  */
3301
3474
  getBounds: () => Promise<Rectangle>;
3302
3475
  /**
3303
- * 设置窗口边界
3304
- * @param {Partial<Rectangle>} bounds - 窗口的边界矩形
3305
- * @param {boolean} animate - 是否启用动画
3476
+ * Set window bounds
3477
+ * @param {Partial<Rectangle>} bounds - The bounds rectangle of the window
3478
+ * @param {boolean} animate - Whether to enable animation
3306
3479
  */
3307
3480
  setBounds: (bounds: Partial<Rectangle>, animate: boolean) => Promise<void>;
3308
3481
  /**
3309
- * 将窗口对齐到当前屏幕
3310
- * @param align string 对齐位置
3482
+ * Align the window to the current screen
3483
+ * @param align string Alignment position
3311
3484
  * <ol>
3312
3485
  * <li>'top-left'</li>
3313
3486
  * <li>'top-center'</li>
@@ -3319,42 +3492,42 @@ interface IBrowserWindowApi {
3319
3492
  */
3320
3493
  alignToScreen: (align: AlignPosition) => Promise<void>;
3321
3494
  /**
3322
- * 检查指定 URL 是否存在
3323
- * @param {string} url - 要检查的 URL
3495
+ * Check if the specified URL exists
3496
+ * @param {string} url - The URL to check
3324
3497
  * @return Promise<boolean>
3325
3498
  */
3326
3499
  existsByUrl: (url: string) => Promise<boolean>;
3327
3500
  /**
3328
- * 获取窗口的最大尺寸
3329
- * @returns {Promise<number[]>} 返回一个 Promise,解析为一个数组,包含窗口的最大宽度和高度
3501
+ * Get the maximum size of the window
3502
+ * @returns {Promise<number[]>} Returns a Promise that resolves to an array containing the maximum width and height of the window
3330
3503
  */
3331
3504
  getMaximumSize: () => Promise<number[]>;
3332
3505
  /**
3333
- * 获取窗口的最小尺寸
3334
- * @returns {Promise<number[]>} 返回一个 Promise,解析为一个数组,包含窗口的最小宽度和高度
3506
+ * Get the minimum size of the window
3507
+ * @returns {Promise<number[]>} Returns a Promise that resolves to an array containing the minimum width and height of the window
3335
3508
  */
3336
3509
  getMinimumSize: () => Promise<number[]>;
3337
3510
  /**
3338
- * 设置窗口的最大尺寸
3339
- * @param {number} width - 最大宽度
3340
- * @param {number} height - 最大高度
3511
+ * Set the maximum size of the window
3512
+ * @param {number} width - Maximum width
3513
+ * @param {number} height - Maximum height
3341
3514
  */
3342
3515
  setMaximumSize: (width: number, height: number) => Promise<void>;
3343
3516
  /**
3344
- * 设置窗口的最小尺寸
3345
- * @param {number} width - 最大宽度
3346
- * @param {number} height - 最大高度
3517
+ * Set the minimum size of the window
3518
+ * @param {number} width - Maximum width
3519
+ * @param {number} height - Maximum height
3347
3520
  */
3348
3521
  setMinimumSize: (width: number, height: number) => Promise<void>;
3349
3522
  /**
3350
- * 更改缩放等级 原始尺寸为 0,每升高或将顶代表缩放20%,大和小限制默认分区为 300% 50% 缩放公式为 scale := 1.2 ^ level.
3351
- * @param level number - 缩放等级,默认为 0
3523
+ * Change the zoom level. Original size is 0, each increment or decrement represents a 20% zoom. The default upper and lower limits are 300% and 50%. The zoom formula is scale := 1.2 ^ level.
3524
+ * @param level number - Zoom level, default is 0
3352
3525
  */
3353
3526
  setZoomLevel: (level: number) => Promise<void>;
3354
3527
  /**
3355
- * 更改缩放倍数 缩放系数是缩放百分比除以 100,即 300% = 3.0
3356
- * @param factor Double - 缩放系数,默认为 1.0
3357
- * @remarks 系数必须大于0.0
3528
+ * Change zoom factor. The zoom factor is the zoom percentage divided by 100, i.e., 300% = 3.0
3529
+ * @param factor Double - Zoom factor, default is 1.0
3530
+ * @remarks The factor must be greater than 0.0
3358
3531
  */
3359
3532
  setZoomFactor: (factor: number) => Promise<void>;
3360
3533
  /**
@@ -3550,139 +3723,6 @@ declare enum Channel {
3550
3723
  AI = "channel::cn.widgetjs.core.ai"
3551
3724
  }
3552
3725
 
3553
- declare class WidgetParams {
3554
- static readonly PARAM_PREFIX = "w_";
3555
- static readonly PARAM_ID = "id";
3556
- static readonly PARAM_LANG = "lang";
3557
- static readonly PARAM_THEME = "theme";
3558
- static readonly PARAM_MODE = "mode";
3559
- static readonly PARAM_NAME = "name";
3560
- static readonly PARAM_TITLE = "title";
3561
- static readonly PARAM_PREVIEW = "preview";
3562
- static readonly PARAMS: string[];
3563
- id?: string;
3564
- width?: number;
3565
- widthPx?: number;
3566
- heightPx?: number;
3567
- height?: number;
3568
- x?: number;
3569
- y?: number;
3570
- preview?: boolean;
3571
- lang?: string;
3572
- theme?: ThemeMode;
3573
- mode?: DeployMode;
3574
- radius?: number;
3575
- name?: string;
3576
- title?: string;
3577
- /**
3578
- * 将组件参数转为url参数
3579
- * @param object
3580
- * @return URLSearchParams w_w=2&w_h=2&w_id=21&w_width=156&w_height=156
3581
- */
3582
- toUrlParams(): URLSearchParams;
3583
- getPersistKey(): string;
3584
- /**
3585
- * 从当前地址解析组件参数:
3586
- * http://localhost:8080/#/widget/config/labor_progress?w_w=2&w_h=2&w_width=156&w_height=156
3587
- * =>
3588
- * {width:2,height:2,id:21,width_px:156,height_px:156}
3589
- */
3590
- static fromCurrentLocation(): WidgetParams;
3591
- static fromLocation(url: string): WidgetParams;
3592
- private static setValue;
3593
- /**
3594
- * 从对象键值对中初始化组件参数
3595
- * {w_width:2,w_height:2,w_id:21,w_width_px:156,w_height_px:156}=>
3596
- * {width:2,height:2,id:21,width_px:156,height_px:156}
3597
- * @param object
3598
- */
3599
- static fromObject(object: any): WidgetParams;
3600
- }
3601
- declare enum ThemeMode {
3602
- AUTO = "auto",
3603
- LIGHT = "LIGHT",
3604
- DARK = "DARK"
3605
- }
3606
-
3607
- /**
3608
- * DeployedWidgetApi provides methods for managing deployed widgets within the application.
3609
- * It allows for the removal, retrieval, and configuration of deployed widgets,
3610
- * as well as the ability to manipulate their settings and behavior.
3611
- * @remarks
3612
- */
3613
- interface IDeployedWidgetApi {
3614
- removeDeployedWidget: (id?: string) => Promise<void>;
3615
- removeDeployedWidgetByName: (name: string) => Promise<DeployedWidget[]>;
3616
- getDeployedWidgets: () => Promise<DeployedWidget[]>;
3617
- openDevTools: (id: string) => Promise<void>;
3618
- /**
3619
- * @deprecated 使用WidgetApi.openConfigPage代替
3620
- * @param id
3621
- */
3622
- openConfigPage: (id?: string, params?: WidgetParams) => Promise<void>;
3623
- registerActiveShortcut: (id: string, shortcut: string) => Promise<boolean>;
3624
- /**
3625
- * Set proxy for the widget, this will reload the widget after setting the proxy.
3626
- * @param id
3627
- * @param proxy
3628
- */
3629
- setProxy: (id: string, proxy: string) => Promise<boolean>;
3630
- getDeployedWidget: (id: string) => Promise<DeployedWidget>;
3631
- /**
3632
- * Adds a new widget with the specified options.
3633
- * If in browser environment, it will open widget://widgetjs.cn/widget?packageUrl=xxx&name=xxx&package
3634
- * @param options - The options for the widget to be added.
3635
- * @returns A promise that resolves with an array of added widgets.
3636
- */
3637
- addWidget: (options: AddWidgetOption) => Promise<Widget[]>;
3638
- }
3639
-
3640
- interface AddWidgetOption {
3641
- widgetName: string;
3642
- widgetTitle?: string;
3643
- deployMode: DeployMode;
3644
- packageJsonUrl?: string;
3645
- hostname?: string;
3646
- }
3647
- type DeployedWidgetApiMethods = keyof IDeployedWidgetApi;
3648
- declare class DeployedWidgetApiImpl extends BaseApi<DeployedWidgetApiMethods> implements IDeployedWidgetApi {
3649
- getChannel(): string;
3650
- /**
3651
- * 移除组件
3652
- * @param id
3653
- */
3654
- removeDeployedWidget(id?: string): Promise<any>;
3655
- addWidget(options: AddWidgetOption): Promise<Widget[]>;
3656
- /**
3657
- * 通过组件名移除已添加的组件
3658
- * @param name 组件名
3659
- */
3660
- removeDeployedWidgetByName(name: string): Promise<DeployedWidget[]>;
3661
- /**
3662
- * 获取已添加的组件
3663
- * @param name 组件名,可以不传
3664
- */
3665
- getDeployedWidgets(name?: string): Promise<DeployedWidget[]>;
3666
- getDeployedWidget(id: string): Promise<DeployedWidget>;
3667
- /**
3668
- * Opens the dev tools for a widget with the specified ID.
3669
- *
3670
- * @param {string} widgetId - The ID of the widget to open the dev tools for.
3671
- * @return {Promise} A Promise that resolves when the dev tools are opened.
3672
- */
3673
- openDevTools(widgetId: string): Promise<any>;
3674
- openConfigPage(widgetId?: string, params?: WidgetParams): Promise<any>;
3675
- /**
3676
- * 注册激活、呼出、置顶组件快捷键
3677
- * @param widgetId 组件id
3678
- * @param shortcut 如果传空或者不传,则会取消快捷键。更多快捷键配置,请查看Accelerator用法
3679
- * https://www.electronjs.org/docs/latest/api/accelerator
3680
- */
3681
- registerActiveShortcut(widgetId: string, shortcut?: string): Promise<boolean>;
3682
- setProxy(widgetId: string, proxy: string): Promise<boolean>;
3683
- }
3684
- declare const DeployedWidgetApi: DeployedWidgetApiImpl;
3685
-
3686
3726
  type DeviceApiMethods = keyof IDeviceApi;
3687
3727
  declare const DeviceApi: IDeviceApi;
3688
3728
 
@@ -3716,36 +3756,36 @@ declare const LogApi: ILogApi;
3716
3756
  declare const MouseApi: IMouseApi;
3717
3757
 
3718
3758
  /**
3719
- * NotificationApi提供了发送通知的能力
3759
+ * NotificationApi provides the ability to send notifications
3720
3760
  */
3721
3761
  interface INotificationApi {
3722
3762
  /**
3723
- * 发送自定义通知
3763
+ * Send custom notification
3724
3764
  * @param notification
3725
3765
  */
3726
3766
  send: (notification: AppNotification) => Promise<void>;
3727
3767
  /**
3728
- * 隐藏通知
3768
+ * Hide notification
3729
3769
  */
3730
3770
  hide: () => Promise<void>;
3731
3771
  /**
3732
3772
  * @param message string
3733
- * @param duration number 持续时间,单位毫秒,默认5000
3773
+ * @param duration number Duration in milliseconds, default 5000
3734
3774
  */
3735
3775
  success: (message: string, duration?: number) => Promise<void>;
3736
3776
  /**
3737
3777
  * @param message string
3738
- * @param duration number 持续时间,单位毫秒,默认5000
3778
+ * @param duration number Duration in milliseconds, default 5000
3739
3779
  */
3740
3780
  error: (message: string, duration?: number) => Promise<void>;
3741
3781
  /**
3742
3782
  * @param message string
3743
- * @param duration number 持续时间,单位毫秒,默认5000
3783
+ * @param duration number Duration in milliseconds, default 5000
3744
3784
  */
3745
3785
  warning: (message: string, duration?: number) => Promise<void>;
3746
3786
  /**
3747
3787
  * @param message string
3748
- * @param duration number 持续时间,单位毫秒,默认5000
3788
+ * @param duration number Duration in milliseconds, default 5000
3749
3789
  */
3750
3790
  info: (message: string, duration?: number) => Promise<void>;
3751
3791
  reminder: (option: ReminderNotificationOption) => Promise<void>;
@@ -3787,53 +3827,53 @@ declare const ProcessApi: IProcessApi;
3787
3827
 
3788
3828
  type BaseType = string | number | boolean;
3789
3829
  /**
3790
- * StorageApi 接口定义了用于存储和检索数据的方法,包括加密和解密功能。
3830
+ * StorageApi interface defines methods for storing and retrieving data, including encryption and decryption functions.
3791
3831
  */
3792
3832
  interface IStorageApi {
3793
3833
  /**
3794
- * 获取存储中的值。
3795
- * @param key 键名
3796
- * @param defaultValue 可选,默认值
3834
+ * Get value from storage.
3835
+ * @param key Key name
3836
+ * @param defaultValue Optional, default value
3797
3837
  */
3798
3838
  get: <T extends BaseType>(key: string, defaultValue?: T) => Promise<T | null>;
3799
3839
  /**
3800
- * 设置存储中的值。
3801
- * @param key 键名
3802
- * @param value 要存储的值,可以是 BaseType 或对象
3840
+ * Set value in storage.
3841
+ * @param key Key name
3842
+ * @param value Value to store, can be BaseType or object
3803
3843
  */
3804
3844
  set: (key: string, value: BaseType | object) => Promise<string>;
3805
3845
  /**
3806
- * 获取存储中的对象值。
3807
- * @param key 键名
3808
- * @param defaultValue 可选,默认值
3846
+ * Get object value from storage.
3847
+ * @param key Key name
3848
+ * @param defaultValue Optional, default value
3809
3849
  */
3810
3850
  getObject: <T>(key: string, defaultValue?: T) => Promise<T | undefined>;
3811
3851
  /**
3812
- * 删除存储中的值。
3813
- * @param key 键名
3852
+ * Delete value from storage.
3853
+ * @param key Key name
3814
3854
  */
3815
3855
  delete: (key: string) => Promise<void>;
3816
3856
  /**
3817
- * 使用 [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata) 生成的加密密钥对字符串进行加密。根据 Windows 文档:“通常,只有与加密数据的用户具有相同登录凭据的用户才可以解密数据”。因此,内容受到同一计算机上其他用户的保护,但不受同一用户空间中运行的其他应用程序的保护。
3818
- * @param value 要加密的字符串
3857
+ * Encrypt a string with the encryption key generated by [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata). According to Windows documentation: "Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data". Therefore, the content is protected from other users on the same computer, but not from other applications running in the same user space.
3858
+ * @param value String to encrypt
3819
3859
  * @see [Safe Storage](https://www.electronjs.org/docs/latest/api/safe-storage)
3820
3860
  */
3821
3861
  encryptString: (value: string) => Promise<string>;
3822
3862
  /**
3823
- * 对加密的字符串进行解密。
3824
- * @param value 要解密的字符串
3863
+ * Decrypt the encrypted string.
3864
+ * @param value String to decrypt
3825
3865
  */
3826
3866
  decryptString: (value: string) => Promise<string>;
3827
3867
  /**
3828
- * 对字符串进行加密并存储。
3829
- * @param key 键名
3830
- * @param value 要加密并存储的字符串
3868
+ * Encrypt string and store.
3869
+ * @param key Key name
3870
+ * @param value String to encrypt and store
3831
3871
  */
3832
3872
  encryptSet: (key: string, value: string) => Promise<string>;
3833
3873
  /**
3834
- * 获取加密存储中的字符串值。
3835
- * @param key 键名
3836
- * @param defaultValue 可选,默认值
3874
+ * Get string value from encrypted storage.
3875
+ * @param key Key name
3876
+ * @param defaultValue Optional, default value
3837
3877
  */
3838
3878
  decryptGet: (key: string, defaultValue?: string) => Promise<string | undefined>;
3839
3879
  }
@@ -4575,4 +4615,4 @@ declare class GridSystem extends GridRect {
4575
4615
  getHeight(): number;
4576
4616
  }
4577
4617
 
4578
- export { type AddTrayOptions, type AddWidgetOption, AiApiEvent, type AiApiMethods, type AiConfig, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRoutes, type AppRuntimeInfo, AppTheme, type AudioData, BackgroundWidget, BaseApi, type BaseboardData, type BatteryData, type BiosData, type BlockDevicesData, type BluetoothDeviceData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, type ChassisData, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CpuTemperatureData, type CurrentLoadCpuData, type CurrentLoadData, type DeepPartial, DefaultTheme, DefaultThemeDark, DefaultThemeLight, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type DisksIoData, type Display, type DisplayBalloonOptions, type DockerContainerData, type DockerContainerMountData, type DockerContainerProcessData, type DockerContainerStatsData, type DockerImageData, type DockerInfoData, type DockerVolumeData, type DownloadUrlOptions, type DynamicData, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type FsOpenFilesData, type FsSizeData, type FsStatsData, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, HostedMode, HttpApi, type HttpApiMethods, type IAiApi, type IAppApi, type IAppTheme, type IBackgroundWidgetOptions, type IDeviceApi, type IDialogApi, type IFileApi, type IGridRect, type ILogApi, type IMouseApi, type IPage, type IPageOptions, type IProcessApi, type ITrayApi, type IUserApi, type IWidgetDataApi, type IWidgetOptions, type IWidgetPackageApi, type IWidgetTheme, type IWindowSize, type InetChecksiteData, type InfoNotificationOption, type Language, type LanguageCode, LanguageMap, type LanguageTextMap, LanguageUtils, type LocalPackageUrlInfo, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, LogApi, type LogApiMethods, type MemData, type MemLayoutData, MenuApi, MenuApiEvent, type MenuApiMethods, type MetaInfo, type Metadata, MouseApi, MouseApiEvent, type MouseApiMethods, type NativeKeyboardEvent, type NetworkConnectionsData, type NetworkInterfacesData, type NetworkStatsData, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, type PrinterData, ProcessApi, type ProcessApiMethods, type ProcessesData, type ProcessesProcessData, type ProcessesProcessLoadData, type ProxyConfig, type RaspberryRevisionData, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type ServicesData, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, type StaticData, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemData, type SystemFile, type SystemInfoMethods, type SystemInfoResultMap, type ThemeColors, ThemeMode, type ThemeRadius, type ThemeShadow, type ThemeTypography, type TimeData, TrayApi, TrayApiEvent, type TrayApiMethods, type TrayWidgetOptions, type UsbData, UserApi, UserApiEvent, type UserApiMethods, type UserData, type UuidData, type VboxInfoData, type VersionData, WebSocketEvent, WebSocketEventType, Widget, WidgetApi, WidgetApiEvent, type WidgetApiMethods, WidgetData, WidgetDataApi, type WidgetDataApiMethods, WidgetKeyword, type WidgetMenuItem, WidgetPackage, WidgetPackageApi, WidgetPackageApiEvent, type WidgetPackageApiMethods, type WidgetPackageOptions, WidgetPackageUtils, WidgetParams, type WidgetPermission, type WidgetRoute, type WidgetSyncInfo, WidgetTheme, type WidgetThemeKey, type WidgetThemeProperty, WidgetUtils, type WifiConnectionData, type WifiInterfaceData, type WifiNetworkData, delay, normalizeUrl, parseQuery, stringifyQuery };
4618
+ export { type AddTrayOptions, type AddWidgetOption, AiApiEvent, type AiApiMethods, type AiConfig, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRoutes, type AppRuntimeInfo, AppTheme, type AudioData, BackgroundWidget, BaseApi, type BaseboardData, type BatteryData, type BiosData, type BlockDevicesData, type BluetoothDeviceData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, type ChassisData, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CpuTemperatureData, type CurrentLoadCpuData, type CurrentLoadData, type DeepPartial, DefaultTheme, DefaultThemeDark, DefaultThemeLight, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, DeployedWidgetApiEvent, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type DisksIoData, type Display, type DisplayBalloonOptions, type DockerContainerData, type DockerContainerMountData, type DockerContainerProcessData, type DockerContainerStatsData, type DockerImageData, type DockerInfoData, type DockerVolumeData, type DownloadUrlOptions, type DynamicData, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type FsOpenFilesData, type FsSizeData, type FsStatsData, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, HostedMode, HttpApi, type HttpApiMethods, type IAiApi, type IAppApi, type IAppTheme, type IBackgroundWidgetOptions, type IDeployedWidgetApi, type IDeviceApi, type IDialogApi, type IFileApi, type IGridRect, type ILogApi, type IMouseApi, type IPage, type IPageOptions, type IProcessApi, type ITrayApi, type IUserApi, type IWidgetDataApi, type IWidgetOptions, type IWidgetPackageApi, type IWidgetTheme, type IWindowSize, type InetChecksiteData, type InfoNotificationOption, type Language, type LanguageCode, LanguageMap, type LanguageTextMap, LanguageUtils, type LocalPackageUrlInfo, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, LogApi, type LogApiMethods, type MemData, type MemLayoutData, MenuApi, MenuApiEvent, type MenuApiMethods, type MetaInfo, type Metadata, MouseApi, MouseApiEvent, type MouseApiMethods, type NativeKeyboardEvent, type NetworkConnectionsData, type NetworkInterfacesData, type NetworkStatsData, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, type PrinterData, ProcessApi, type ProcessApiMethods, type ProcessesData, type ProcessesProcessData, type ProcessesProcessLoadData, type ProxyConfig, type RaspberryRevisionData, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type ServicesData, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, type StaticData, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemData, type SystemFile, type SystemInfoMethods, type SystemInfoResultMap, type ThemeBoxShadow, type ThemeColors, ThemeMode, type ThemeRadius, type ThemeShadow, type ThemeTypography, type TimeData, TrayApi, TrayApiEvent, type TrayApiMethods, type TrayWidgetOptions, type UsbData, UserApi, UserApiEvent, type UserApiMethods, type UserData, type UuidData, type VboxInfoData, type VersionData, WebSocketEvent, WebSocketEventType, Widget, WidgetApi, WidgetApiEvent, type WidgetApiMethods, WidgetData, WidgetDataApi, type WidgetDataApiMethods, WidgetKeyword, type WidgetMenuItem, WidgetPackage, WidgetPackageApi, WidgetPackageApiEvent, type WidgetPackageApiMethods, type WidgetPackageOptions, WidgetPackageUtils, WidgetParams, type WidgetPermission, type WidgetRoute, type WidgetSyncInfo, WidgetTheme, type WidgetThemeKey, type WidgetThemeProperty, WidgetUtils, type WifiConnectionData, type WifiInterfaceData, type WifiNetworkData, delay, normalizeUrl, parseQuery, stringifyQuery };