@widget-js/core 24.1.1-beta.88 → 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.cts CHANGED
@@ -168,6 +168,10 @@ interface IDeployedPage {
168
168
  height: number;
169
169
  width: number;
170
170
  proxy?: string;
171
+ minWidth?: number;
172
+ minHeight?: number;
173
+ maxWidth?: number;
174
+ maxHeight?: number;
171
175
  isIgnoreMouseEvents?: boolean;
172
176
  }
173
177
  declare class DeployedPage implements IDeployedPage {
@@ -185,6 +189,10 @@ declare class DeployedPage implements IDeployedPage {
185
189
  declare class DeployedWidget extends DeployedPage {
186
190
  shortcut?: string;
187
191
  deployMode: number;
192
+ minWidth?: number;
193
+ minHeight?: number;
194
+ maxWidth?: number;
195
+ maxHeight?: number;
188
196
  isOverlap(): boolean;
189
197
  }
190
198
 
@@ -278,7 +286,7 @@ interface IAiApi {
278
286
  */
279
287
  declare enum AiApiEvent {
280
288
  /**
281
- * 配置更新事件
289
+ * Configuration update event
282
290
  */
283
291
  CONFIG_UPDATED = "channel::cn.widgetjs.core.ai.config.updated"
284
292
  }
@@ -602,34 +610,34 @@ interface AppRuntimeInfo {
602
610
 
603
611
  type AppRoutes = '/widget/search' | '/widget/package' | '/setting/common' | '/setting/theme' | '/setting/ai' | '/setting/proxy' | '/setting/info' | '/user/profile';
604
612
  /**
605
- * 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.
606
614
  * @see [Electron API App](https://www.electronjs.org/docs/latest/api/app)
607
615
  */
608
616
  interface IAppApi {
609
617
  /**
610
- * 设置配置
618
+ * Set configuration
611
619
  * @param key string
612
620
  * @param value string | number | boolean
613
621
  */
614
622
  setConfig: (key: string | AppApiConstants, value: string | number | boolean) => Promise<any>;
615
623
  /**
616
- * 获取配置
624
+ * Get configuration
617
625
  * @param key
618
626
  * @param defaultValue
619
627
  * @return Promise<string | number | boolean>
620
628
  */
621
629
  getConfig: <T extends string | number | boolean>(key: string | AppApiConstants, defaultValue: T) => Promise<T>;
622
630
  /**
623
- * 获取版本信息
624
- * @param type string - 可选。指定要获取的版本类型。
631
+ * Get version information
632
+ * @param type string - Optional. Specify the type of version to get.
625
633
  * <ol>
626
634
  * <li>`app`: Get app's version with Semantic Versioning format.
627
635
  * The version is different from Microsoft store's version.
628
636
  * For example, if the app's version is `24.1.1`, Microsoft store's version will be `24.1.1.0`</li>
629
- * <li>`electron`: 获取 Electron 框架的版本。</li>
630
- * <li>`chrome`: 获取 Electron 使用的 Chromium 版本。</li>
631
- * <li>`node`: 获取 Node.js 的版本。</li>
632
- * <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>
633
641
  * </ol>
634
642
  * @return Promise<string>
635
643
  */
@@ -639,13 +647,13 @@ interface IAppApi {
639
647
  */
640
648
  getRuntimeInfo: () => Promise<AppRuntimeInfo>;
641
649
  /**
642
- * 获取Preload JS路径
650
+ * Get Preload JS path
643
651
  * @see [Using Preload Scripts](https://www.electronjs.org/docs/latest/tutorial/tutorial-preload)
644
652
  * @return Promise<string>
645
653
  */
646
654
  getPreloadPath: () => Promise<string>;
647
655
  /**
648
- * 获取应用安装路径
656
+ * Get application installation path
649
657
  * @return Promise<string>
650
658
  */
651
659
  getAppPath: () => Promise<string>;
@@ -757,23 +765,23 @@ type AppApiMethods = keyof IAppApi;
757
765
  */
758
766
  declare enum AppApiEvent {
759
767
  /**
760
- * 应用设置变更时触发
768
+ * Triggered when application settings change
761
769
  */
762
770
  CONFIG_CHANGED = "event::cn.widgetjs.core.app.config.changed",
763
771
  /**
764
- * 桌面组件网格窗口移动时触发
772
+ * Triggered when the desktop widget grid window moves
765
773
  */
766
774
  MOVING_GRID_WINDOW = "event::cn.widgetjs.core.app.moving.grid.window",
767
775
  /**
768
- * 桌面组件网格窗口停止移动时触发
776
+ * Triggered when the desktop widget grid window stops moving
769
777
  */
770
778
  STOP_MOVING_GRID_WINDOW = "event::cn.widgetjs.core.app.moving.grid.window.stop",
771
779
  /**
772
- * 应用代理发生变化
780
+ * Application proxy changed
773
781
  */
774
782
  PROXY_CHANGED = "event::cn.widgetjs.core.app.proxy.changed",
775
783
  /**
776
- * 应用语言发生变化
784
+ * Application language changed
777
785
  */
778
786
  LANGUAGE_CHANGED = "event::cn.widgetjs.core.app.language.changed"
779
787
  }
@@ -782,20 +790,20 @@ declare enum AppApiEvent {
782
790
  */
783
791
  declare enum AppApiConstants {
784
792
  /**
785
- * 桌面组件网格大小
793
+ * Desktop widget grid size
786
794
  */
787
795
  CONFIG_GRID_CELL_SIZE = "cn.widgetjs.config.grid.size",
788
796
  /**
789
- * 应用主题CSS设置
797
+ * Application theme CSS settings
790
798
  */
791
799
  CONFIG_WIDGET_THEME_CSS = "cn.widgetjs.config.widget.theme.css",
792
800
  /**
793
- * 应用全局代理设置
801
+ * Application global proxy settings
794
802
  */
795
803
  CONFIG_PROXY = "cn.widgetjs.config.app.proxy",
796
804
  CONFIG_DEV_MODE = "cn.widgetjs.config.app.dev.mode",
797
805
  /**
798
- * 应用语言设置
806
+ * Application language settings
799
807
  */
800
808
  CONFIG_LANGUAGE = "cn.widgetjs.config.app.language"
801
809
  }
@@ -1195,6 +1203,7 @@ declare class DeployedWidgetApiImpl extends BaseApi<DeployedWidgetApiMethods> im
1195
1203
  */
1196
1204
  registerActiveShortcut(widgetId: string, shortcut?: string): Promise<boolean>;
1197
1205
  setProxy(widgetId: string, proxy: string): Promise<boolean>;
1206
+ setSize(widgetId: string, width: number, height: number): Promise<void>;
1198
1207
  }
1199
1208
  declare const DeployedWidgetApi: DeployedWidgetApiImpl;
1200
1209
 
@@ -1210,7 +1219,7 @@ interface IDeployedWidgetApi {
1210
1219
  getDeployedWidgets: () => Promise<DeployedWidget[]>;
1211
1220
  openDevTools: (id: string) => Promise<void>;
1212
1221
  /**
1213
- * @deprecated 使用WidgetApi.openConfigPage代替
1222
+ * @deprecated Use WidgetApi.openConfigPage instead
1214
1223
  * @param id
1215
1224
  */
1216
1225
  openConfigPage: (id?: string, params?: WidgetParams) => Promise<void>;
@@ -1230,18 +1239,25 @@ interface IDeployedWidgetApi {
1230
1239
  */
1231
1240
  addWidget: (options: AddWidgetOption) => Promise<Widget[]>;
1232
1241
  /**
1233
- * 创建桌面快捷方式
1234
- * @param widgetName 组件名
1235
- * @returns 成功返回 true,否则返回 false
1242
+ * Create a desktop shortcut
1243
+ * @param widgetName Widget name
1244
+ * @returns Returns true on success, false otherwise
1236
1245
  */
1237
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>;
1238
1254
  }
1239
1255
  /**
1240
1256
  * AiApiEvent
1241
1257
  */
1242
1258
  declare enum DeployedWidgetApiEvent {
1243
1259
  /**
1244
- * 第二实例启动事件
1260
+ * Second instance start event
1245
1261
  */
1246
1262
  SECOND_INSTANCE = "channel::cn.widgetjs.core.deployed_widget.second_instance"
1247
1263
  }
@@ -1404,16 +1420,16 @@ interface IDeviceApi {
1404
1420
  }
1405
1421
 
1406
1422
  /**
1407
- * DialogApi 提供文件、文件夹选择功能
1423
+ * DialogApi provides file and folder selection functions
1408
1424
  */
1409
1425
  interface IDialogApi {
1410
1426
  /**
1411
- * 选取单个文件
1412
- * @param extensions 允许的文件后缀格式,如:["txt","docx","gif"]
1427
+ * Pick a single file
1428
+ * @param extensions Allowed file extension formats, e.g., ["txt", "docx", "gif"]
1413
1429
  */
1414
1430
  pickFile: (extensions?: string[]) => Promise<string | undefined>;
1415
1431
  /**
1416
- * 选取文件夹
1432
+ * Pick a folder
1417
1433
  */
1418
1434
  pickFolder: () => Promise<string | undefined>;
1419
1435
  }
@@ -2592,7 +2608,7 @@ interface IFileApi {
2592
2608
  }
2593
2609
 
2594
2610
  /**
2595
- * LogApi提供了日志输出的方法,日志会保存在用户的`当前用户名/文档/桌面组件/logs/日期/组件包名.log`文件中
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
2596
2612
  */
2597
2613
  interface ILogApi {
2598
2614
  info: (...data: any[]) => void;
@@ -2629,26 +2645,26 @@ declare enum MouseApiEvent {
2629
2645
  type MouseApiMethods = keyof IMouseApi;
2630
2646
 
2631
2647
  /**
2632
- * ProcessApi 提供进程信息获取功能
2648
+ * ProcessApi provides process information retrieval functions
2633
2649
  */
2634
2650
  interface IProcessApi {
2635
2651
  getBlinkMemoryInfo: () => Promise<Electron.BlinkMemoryInfo>;
2636
2652
  getHeapStatistics: () => Promise<Electron.HeapStatistics>;
2637
2653
  /**
2638
- * 获取系统版本信息
2654
+ * Get system version information
2639
2655
  * @example '10.0.17763'
2640
2656
  */
2641
2657
  getSystemVersion: () => Promise<string>;
2642
2658
  /**
2643
- * 获取当前应用内存信息
2659
+ * Get current application memory information
2644
2660
  */
2645
2661
  getProcessMemoryInfo: () => Promise<Electron.ProcessMemoryInfo>;
2646
2662
  }
2647
2663
  type ProcessApiMethods = keyof IProcessApi;
2648
2664
 
2649
2665
  /**
2650
- * MenuApi 接口定义了一系列用于控制窗口的方法,这些方法提供了窗口的显示、隐藏、移动、调整大小等功能
2651
- * @remarks 注意:桌面类型组件不支持窗口移动、调整大小、最大化、最小化等操作
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.
2652
2668
  */
2653
2669
  interface IMenuApi {
2654
2670
  /**
@@ -2656,12 +2672,12 @@ interface IMenuApi {
2656
2672
  */
2657
2673
  addMenuItem: (menuItems: WidgetMenuItem[]) => Promise<void>;
2658
2674
  /**
2659
- * 添加上下文菜单项,最多支持二级菜单
2675
+ * Add context menu items, up to two levels of menus are supported
2660
2676
  * @param menuItems
2661
2677
  */
2662
2678
  addContextMenuItem: (menuItems: WidgetMenuItem[]) => Promise<void>;
2663
2679
  /**
2664
- * 移除上下文菜单项
2680
+ * Remove context menu items
2665
2681
  * @param menuItemIds
2666
2682
  */
2667
2683
  removeContextMenuItem: (menuItemIds: string[]) => Promise<void>;
@@ -2670,7 +2686,7 @@ interface IMenuApi {
2670
2686
  */
2671
2687
  removeMenuItem: (menuItemIds: string[]) => Promise<void>;
2672
2688
  /**
2673
- * 显示自定义菜单
2689
+ * Show custom menu
2674
2690
  * @param options ShowMenuOption
2675
2691
  */
2676
2692
  showMenu: (options: ShowMenuOption) => Promise<void>;
@@ -2897,7 +2913,7 @@ interface IUserApi {
2897
2913
  */
2898
2914
  declare enum UserApiEvent {
2899
2915
  /**
2900
- * 快捷键触发事件
2916
+ * User updated event
2901
2917
  */
2902
2918
  USER_UPDATED = "channel::cn.widgetjs.core.user.updated",
2903
2919
  SIGNED_OUT = "channel::cn.widgetjs.core.user.signed.out",
@@ -2907,32 +2923,32 @@ declare enum UserApiEvent {
2907
2923
  type UserApiMethods = keyof IUserApi;
2908
2924
 
2909
2925
  /**
2910
- * WidgetPackageApi 提供了组件包的升级、获取、安装等功能
2926
+ * WidgetPackageApi provides functions such as upgrading, retrieving, and installing widget packages
2911
2927
  */
2912
2928
  interface IWidgetPackageApi {
2913
2929
  /**
2914
- * 升级组件包
2915
- * @param packageName 组件包名称
2930
+ * Upgrade widget package
2931
+ * @param packageName Widget package name
2916
2932
  * @param remoteUrlInfo
2917
2933
  */
2918
2934
  upgrade: (packageName: string, remoteUrlInfo: RemotePackageUrlInfo) => Promise<void>;
2919
2935
  /**
2920
- * 获取组件包的首页url信息
2936
+ * Get index url information of the widget package
2921
2937
  * @param packageName
2922
2938
  */
2923
2939
  getIndexUrl: (packageName: string) => Promise<string | null>;
2924
2940
  /**
2925
- * 获取组件包入口url信息
2941
+ * Get entry url information of the widget package
2926
2942
  * @param packageName
2927
2943
  */
2928
2944
  getEntryUrl: (packageName: string) => Promise<string | null>;
2929
2945
  /**
2930
- * 通过包名获取组件包信息
2946
+ * Get widget package information by package name
2931
2947
  * @param name
2932
2948
  */
2933
2949
  getPackage: (name: string) => Promise<WidgetPackage | undefined>;
2934
2950
  /**
2935
- * 获取已经安装的组件包
2951
+ * Get installed widget packages
2936
2952
  */
2937
2953
  getPackages: () => Promise<WidgetPackage[]>;
2938
2954
  /**
@@ -2953,11 +2969,11 @@ type WidgetPackageApiMethods = keyof IWidgetPackageApi;
2953
2969
  */
2954
2970
  declare enum WidgetPackageApiEvent {
2955
2971
  /**
2956
- * 组件包升级事件
2972
+ * Widget package upgraded event
2957
2973
  */
2958
2974
  PACKAGE_UPGRADE = "event::cn.widgetjs.core.widget.package.upgraded",
2959
2975
  /**
2960
- * 组件包安装事件
2976
+ * Widget package installed event
2961
2977
  */
2962
2978
  PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
2963
2979
  }
@@ -2965,11 +2981,11 @@ declare enum WidgetPackageApiEvent {
2965
2981
  declare const AppApi: IAppApi;
2966
2982
 
2967
2983
  /**
2968
- * WidgetApi 接口定义了一系列用于控制组件的方法,这些方法提供了组件的注册、升级、获取、打开设置页面、重新加载等功能
2984
+ * WidgetApi interface defines a series of methods for controlling widgets, providing functions such as widget registration, upgrade, retrieval, opening settings page, reloading, etc.
2969
2985
  */
2970
2986
  interface IWidgetApi {
2971
2987
  /**
2972
- * 注册组件
2988
+ * Register widgets
2973
2989
  * @param widgets
2974
2990
  */
2975
2991
  registerWidgets: (widgets: Widget[]) => Promise<void>;
@@ -2989,24 +3005,24 @@ interface IWidgetApi {
2989
3005
  */
2990
3006
  isIgnoreMouseEvents: (widgetId?: string) => Promise<boolean>;
2991
3007
  /**
2992
- * 设置组件是否可以左键拖动
2993
- * @param draggable boolean true-启用左键拖动 false-禁用左键拖动
2994
- * @remarks 注意:只对悬浮窗组件(DeployMode.OVERLAP)有效
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)
2995
3011
  */
2996
3012
  setMouseDraggable: (draggable: boolean) => Promise<void>;
2997
3013
  /**
2998
- * 升级组件包
2999
- * @param packageName 组件包名
3014
+ * Upgrade widget package
3015
+ * @param packageName Widget package name
3000
3016
  */
3001
3017
  upgradePackage: (packageName: string) => Promise<void>;
3002
3018
  /**
3003
- * 获取所有组件
3019
+ * Get all widgets
3004
3020
  * @return Promise<Widget[]>
3005
3021
  */
3006
3022
  getWidgets: () => Promise<Widget[]>;
3007
3023
  /**
3008
- * 通过组件名称获取组件
3009
- * @param name string 组件名
3024
+ * Get widget by widget name
3025
+ * @param name string Widget name
3010
3026
  * @return Promise<Widget>
3011
3027
  */
3012
3028
  getWidget: (name: string) => Promise<Widget>;
@@ -3020,8 +3036,8 @@ interface IWidgetApi {
3020
3036
  */
3021
3037
  getWidgetPackages: () => Promise<WidgetPackage[]>;
3022
3038
  /**
3023
- * 打开组件设置页面
3024
- * @param id string 组件id
3039
+ * Open widget settings page
3040
+ * @param id string Widget id
3025
3041
  */
3026
3042
  openConfigPage: (id?: string) => Promise<void>;
3027
3043
  /**
@@ -3029,7 +3045,7 @@ interface IWidgetApi {
3029
3045
  */
3030
3046
  openConfigPageByName: (name: string) => Promise<void>;
3031
3047
  /**
3032
- * 重新加载组件
3048
+ * Reload widget
3033
3049
  */
3034
3050
  reload: (id?: string) => Promise<void>;
3035
3051
  /**
@@ -3206,7 +3222,8 @@ declare enum WidgetApiEvent {
3206
3222
  DATA_CHANGED = "event::cn.widgetjs.core.widget.data-changed",
3207
3223
  EDIT_DESKTOP_WIDGETS = "event::cn.widgetjs.core.widget.desktop.edit",
3208
3224
  PACKAGE_UPGRADE = "event::cn.widgetjs.core.widget.package.upgraded",
3209
- 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"
3210
3227
  }
3211
3228
  declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidgetApi {
3212
3229
  getSyncInfo(widgetName?: string): Promise<WidgetSyncInfo | null>;
@@ -3246,27 +3263,27 @@ declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidget
3246
3263
  declare const WidgetApi: WidgetApiImpl;
3247
3264
 
3248
3265
  /**
3249
- * ShortcutApi 提供了注册快捷键的能力,当快捷键被触发时,会发送广播事件 {@link BroadcastEvent}
3266
+ * ShortcutApi provides the ability to register shortcuts. When a shortcut is triggered, a broadcast event {@link BroadcastEvent} will be sent.
3250
3267
  */
3251
3268
  interface IShortcutApi {
3252
3269
  /**
3253
- * 注册快捷键, 如果注册成功, 触发快捷键时,会发送广播事件 {@link BroadcastEvent}
3270
+ * Register shortcut, if successful, when the shortcut is triggered, a broadcast event {@link BroadcastEvent} will be sent.
3254
3271
  * @see [Electron Accelerator](https://www.electronjs.org/docs/latest/api/accelerator)
3255
3272
  * @param shortcut string
3256
- * @return Promise<boolean> true 注册成功,false 注册失败
3273
+ * @return Promise<boolean> true on success, false on failure
3257
3274
  * @example
3258
3275
  * ```typescript
3259
- * //Meta 通常为windows键
3276
+ * // Meta is usually the Windows key
3260
3277
  * ShortcutApi.register('Ctrl+Meta+Y')
3261
3278
  * ```
3262
3279
  */
3263
3280
  register: (shortcut: string) => Promise<boolean>;
3264
3281
  /**
3265
- * 注销快捷键
3282
+ * Unregister shortcut
3266
3283
  * @param shortcut string
3267
3284
  * @example
3268
3285
  * ```typescript
3269
- * //Meta 通常为windows键
3286
+ * // Meta is usually the Windows key
3270
3287
  * ShortcutApi.unregister('Ctrl+Meta+Y')
3271
3288
  * ```
3272
3289
  */
@@ -3277,7 +3294,7 @@ interface IShortcutApi {
3277
3294
  */
3278
3295
  declare enum ShortcutApiEvent {
3279
3296
  /**
3280
- * 快捷键触发事件
3297
+ * Shortcut triggered event
3281
3298
  */
3282
3299
  TRIGGERED = "channel::cn.widgetjs.core.shortcut.triggered"
3283
3300
  }
@@ -3297,173 +3314,173 @@ declare enum ClipboardApiEvent {
3297
3314
  declare const ClipboardApi: IClipboardApi;
3298
3315
 
3299
3316
  /**
3300
- * BrowserWindowApi 接口定义了一系列用于控制窗口的方法,这些方法提供了窗口的显示、隐藏、移动、调整大小等功能
3301
- * @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.
3302
3319
  */
3303
3320
  interface IBrowserWindowApi {
3304
3321
  /**
3305
- * 设置是否忽略鼠标事件
3322
+ * Set whether to ignore mouse events
3306
3323
  * @param ignore boolean
3307
3324
  */
3308
3325
  setIgnoreMouseEvent: (ignore: boolean) => Promise<void>;
3309
3326
  /**
3310
- * 显示窗口
3327
+ * Show window
3311
3328
  */
3312
3329
  show: () => Promise<void>;
3313
3330
  /**
3314
- * 设置窗口是否有阴影
3331
+ * Set whether the window has a shadow
3315
3332
  * @param hasShadow boolean
3316
3333
  */
3317
3334
  setHasShadow: (hasShadow: boolean) => Promise<void>;
3318
3335
  /**
3319
- * 隐藏窗口
3336
+ * Hide window
3320
3337
  */
3321
3338
  hide: () => Promise<void>;
3322
3339
  /**
3323
- * 关闭窗口
3340
+ * Close window
3324
3341
  */
3325
3342
  close: () => Promise<void>;
3326
3343
  /**
3327
- * 以不激活窗口的方式显示窗口
3344
+ * Show window without activating it
3328
3345
  */
3329
3346
  showInactive: () => Promise<void>;
3330
3347
  /**
3331
- * 将窗口居中
3348
+ * Center window
3332
3349
  */
3333
3350
  center: () => Promise<void>;
3334
3351
  /**
3335
- * 最小化窗口
3352
+ * Minimize window
3336
3353
  */
3337
3354
  minimize: () => Promise<void>;
3338
3355
  /**
3339
- * 还原窗口
3356
+ * Restore window
3340
3357
  */
3341
3358
  restore: () => Promise<void>;
3342
3359
  /**
3343
- * 窗口是否最小后
3360
+ * Whether the window is minimized
3344
3361
  * @return Promise<boolean>
3345
3362
  */
3346
3363
  isMinimized: () => Promise<boolean>;
3347
3364
  /**
3348
- * 检查窗口是否最大化
3365
+ * Check if the window is maximized
3349
3366
  * @return Promise<boolean>
3350
3367
  */
3351
3368
  isMaximized: () => Promise<boolean>;
3352
3369
  /**
3353
- * 检查窗口是否可见
3370
+ * Check if the window is visible
3354
3371
  * @return Promise<boolean>
3355
3372
  */
3356
3373
  isVisible: () => Promise<boolean>;
3357
3374
  /**
3358
- * 检查窗口是否可调整大小
3375
+ * Check if the window is resizable
3359
3376
  * @since 24.1.1-beta.6
3360
3377
  * @return Promise<boolean>
3361
3378
  */
3362
3379
  isResizable: () => Promise<boolean>;
3363
3380
  /**
3364
- * 最大化窗口
3381
+ * Maximize window
3365
3382
  */
3366
3383
  maximize: () => Promise<void>;
3367
3384
  /**
3368
- * 停止拖动窗口
3385
+ * Stop dragging the window
3369
3386
  */
3370
3387
  stopDraggingWindow: () => Promise<void>;
3371
3388
  /**
3372
- * 开始拖动窗口
3389
+ * Start dragging the window
3373
3390
  */
3374
3391
  startDraggingWindow: () => Promise<void>;
3375
3392
  /**
3376
- * 检查窗口是否正在拖动
3393
+ * Check if the window is being dragged
3377
3394
  * @return Promise<boolean>
3378
3395
  */
3379
3396
  isDraggingWindow: () => Promise<boolean>;
3380
3397
  /**
3381
- * 设置窗口是否总在最前
3398
+ * Set whether the window is always on top
3382
3399
  * @param alwaysOnTop boolean
3383
3400
  */
3384
3401
  setAlwaysOnTop: (alwaysOnTop: boolean) => Promise<void>;
3385
3402
  /**
3386
- * 检查窗口是否总在最前
3403
+ * Check if the window is always on top
3387
3404
  * @return Promise<boolean>
3388
3405
  */
3389
3406
  isAlwaysOnTop: () => Promise<boolean>;
3390
3407
  /**
3391
- * 打开指定的 URL
3392
- * @param url string 要打开的 URL
3393
- * @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
3394
3411
  */
3395
3412
  openUrl: (url: string, option?: BrowserWindowOptions) => Promise<void>;
3396
3413
  /**
3397
- * 将窗口置于最前
3414
+ * Move the window to the top
3398
3415
  */
3399
3416
  moveTop: () => Promise<void>;
3400
3417
  /**
3401
- * 取消最大化窗口
3418
+ * Unmaximize window
3402
3419
  */
3403
3420
  unmaximize: () => Promise<void>;
3404
3421
  /**
3405
- * 重新加载窗口
3422
+ * Reload window
3406
3423
  */
3407
3424
  reload: () => Promise<void>;
3408
3425
  /**
3409
- * 设置窗口大小
3410
- * @param width boolean - 窗口宽度
3411
- * @param height boolean - 窗口高度
3412
- * @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)
3413
3430
  */
3414
3431
  setSize: (width: number, height: number, animate?: boolean) => Promise<void>;
3415
3432
  /**
3416
- * 获取窗口大小
3433
+ * Get window size
3417
3434
  * @since 24.1.1-beta.6
3418
3435
  * @returns Promise<number[]>
3419
3436
  */
3420
3437
  getSize: () => Promise<number[]>;
3421
3438
  /**
3422
- * 打开开发者工具
3439
+ * Open developer tools
3423
3440
  */
3424
3441
  openDevTools: () => Promise<void>;
3425
3442
  /**
3426
- * 设置窗口位置
3427
- * @param {SetPositionOptions} options - 配置窗口位置的选项
3443
+ * Set window position
3444
+ * @param {SetPositionOptions} options - Options for configuring the window position
3428
3445
  */
3429
3446
  setPosition: (options: SetPositionOptions) => Promise<void>;
3430
3447
  /**
3431
- * 获取窗口位置
3432
- * @returns {Promise<Position>} 返回一个 Promise,解析为窗口的位置
3448
+ * Get window position
3449
+ * @returns {Promise<Position>} Returns a Promise that resolves to the window's position
3433
3450
  */
3434
3451
  getPosition: () => Promise<Position>;
3435
3452
  /**
3436
- * 使窗口失去焦点
3453
+ * Blur window
3437
3454
  */
3438
3455
  blur: () => Promise<void>;
3439
3456
  /**
3440
- * 聚焦窗口
3457
+ * Focus window
3441
3458
  */
3442
3459
  focus: () => Promise<void>;
3443
3460
  /**
3444
- * 设置窗口是否可调整大小
3445
- * @param resizable boolean - 是否可调整大小
3461
+ * Set whether the window is resizable
3462
+ * @param resizable boolean - Whether it is resizable
3446
3463
  */
3447
3464
  setResizable: (resizable: boolean) => Promise<void>;
3448
3465
  /**
3449
- * 设置窗口是否可移动
3450
- * @param movable boolean - 是否可移动
3466
+ * Set whether the window is movable
3467
+ * @param movable boolean - Whether it is movable
3451
3468
  */
3452
3469
  setMovable: (movable: boolean) => Promise<void>;
3453
3470
  /**
3454
- * 获取窗口边界
3471
+ * Get window bounds
3455
3472
  * @returns Promise<Rectangle>
3456
3473
  */
3457
3474
  getBounds: () => Promise<Rectangle>;
3458
3475
  /**
3459
- * 设置窗口边界
3460
- * @param {Partial<Rectangle>} bounds - 窗口的边界矩形
3461
- * @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
3462
3479
  */
3463
3480
  setBounds: (bounds: Partial<Rectangle>, animate: boolean) => Promise<void>;
3464
3481
  /**
3465
- * 将窗口对齐到当前屏幕
3466
- * @param align string 对齐位置
3482
+ * Align the window to the current screen
3483
+ * @param align string Alignment position
3467
3484
  * <ol>
3468
3485
  * <li>'top-left'</li>
3469
3486
  * <li>'top-center'</li>
@@ -3475,42 +3492,42 @@ interface IBrowserWindowApi {
3475
3492
  */
3476
3493
  alignToScreen: (align: AlignPosition) => Promise<void>;
3477
3494
  /**
3478
- * 检查指定 URL 是否存在
3479
- * @param {string} url - 要检查的 URL
3495
+ * Check if the specified URL exists
3496
+ * @param {string} url - The URL to check
3480
3497
  * @return Promise<boolean>
3481
3498
  */
3482
3499
  existsByUrl: (url: string) => Promise<boolean>;
3483
3500
  /**
3484
- * 获取窗口的最大尺寸
3485
- * @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
3486
3503
  */
3487
3504
  getMaximumSize: () => Promise<number[]>;
3488
3505
  /**
3489
- * 获取窗口的最小尺寸
3490
- * @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
3491
3508
  */
3492
3509
  getMinimumSize: () => Promise<number[]>;
3493
3510
  /**
3494
- * 设置窗口的最大尺寸
3495
- * @param {number} width - 最大宽度
3496
- * @param {number} height - 最大高度
3511
+ * Set the maximum size of the window
3512
+ * @param {number} width - Maximum width
3513
+ * @param {number} height - Maximum height
3497
3514
  */
3498
3515
  setMaximumSize: (width: number, height: number) => Promise<void>;
3499
3516
  /**
3500
- * 设置窗口的最小尺寸
3501
- * @param {number} width - 最大宽度
3502
- * @param {number} height - 最大高度
3517
+ * Set the minimum size of the window
3518
+ * @param {number} width - Maximum width
3519
+ * @param {number} height - Maximum height
3503
3520
  */
3504
3521
  setMinimumSize: (width: number, height: number) => Promise<void>;
3505
3522
  /**
3506
- * 更改缩放等级 原始尺寸为 0,每升高或将顶代表缩放20%,大和小限制默认分区为 300% 50% 缩放公式为 scale := 1.2 ^ level.
3507
- * @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
3508
3525
  */
3509
3526
  setZoomLevel: (level: number) => Promise<void>;
3510
3527
  /**
3511
- * 更改缩放倍数 缩放系数是缩放百分比除以 100,即 300% = 3.0
3512
- * @param factor Double - 缩放系数,默认为 1.0
3513
- * @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
3514
3531
  */
3515
3532
  setZoomFactor: (factor: number) => Promise<void>;
3516
3533
  /**
@@ -3739,36 +3756,36 @@ declare const LogApi: ILogApi;
3739
3756
  declare const MouseApi: IMouseApi;
3740
3757
 
3741
3758
  /**
3742
- * NotificationApi提供了发送通知的能力
3759
+ * NotificationApi provides the ability to send notifications
3743
3760
  */
3744
3761
  interface INotificationApi {
3745
3762
  /**
3746
- * 发送自定义通知
3763
+ * Send custom notification
3747
3764
  * @param notification
3748
3765
  */
3749
3766
  send: (notification: AppNotification) => Promise<void>;
3750
3767
  /**
3751
- * 隐藏通知
3768
+ * Hide notification
3752
3769
  */
3753
3770
  hide: () => Promise<void>;
3754
3771
  /**
3755
3772
  * @param message string
3756
- * @param duration number 持续时间,单位毫秒,默认5000
3773
+ * @param duration number Duration in milliseconds, default 5000
3757
3774
  */
3758
3775
  success: (message: string, duration?: number) => Promise<void>;
3759
3776
  /**
3760
3777
  * @param message string
3761
- * @param duration number 持续时间,单位毫秒,默认5000
3778
+ * @param duration number Duration in milliseconds, default 5000
3762
3779
  */
3763
3780
  error: (message: string, duration?: number) => Promise<void>;
3764
3781
  /**
3765
3782
  * @param message string
3766
- * @param duration number 持续时间,单位毫秒,默认5000
3783
+ * @param duration number Duration in milliseconds, default 5000
3767
3784
  */
3768
3785
  warning: (message: string, duration?: number) => Promise<void>;
3769
3786
  /**
3770
3787
  * @param message string
3771
- * @param duration number 持续时间,单位毫秒,默认5000
3788
+ * @param duration number Duration in milliseconds, default 5000
3772
3789
  */
3773
3790
  info: (message: string, duration?: number) => Promise<void>;
3774
3791
  reminder: (option: ReminderNotificationOption) => Promise<void>;
@@ -3810,53 +3827,53 @@ declare const ProcessApi: IProcessApi;
3810
3827
 
3811
3828
  type BaseType = string | number | boolean;
3812
3829
  /**
3813
- * StorageApi 接口定义了用于存储和检索数据的方法,包括加密和解密功能。
3830
+ * StorageApi interface defines methods for storing and retrieving data, including encryption and decryption functions.
3814
3831
  */
3815
3832
  interface IStorageApi {
3816
3833
  /**
3817
- * 获取存储中的值。
3818
- * @param key 键名
3819
- * @param defaultValue 可选,默认值
3834
+ * Get value from storage.
3835
+ * @param key Key name
3836
+ * @param defaultValue Optional, default value
3820
3837
  */
3821
3838
  get: <T extends BaseType>(key: string, defaultValue?: T) => Promise<T | null>;
3822
3839
  /**
3823
- * 设置存储中的值。
3824
- * @param key 键名
3825
- * @param value 要存储的值,可以是 BaseType 或对象
3840
+ * Set value in storage.
3841
+ * @param key Key name
3842
+ * @param value Value to store, can be BaseType or object
3826
3843
  */
3827
3844
  set: (key: string, value: BaseType | object) => Promise<string>;
3828
3845
  /**
3829
- * 获取存储中的对象值。
3830
- * @param key 键名
3831
- * @param defaultValue 可选,默认值
3846
+ * Get object value from storage.
3847
+ * @param key Key name
3848
+ * @param defaultValue Optional, default value
3832
3849
  */
3833
3850
  getObject: <T>(key: string, defaultValue?: T) => Promise<T | undefined>;
3834
3851
  /**
3835
- * 删除存储中的值。
3836
- * @param key 键名
3852
+ * Delete value from storage.
3853
+ * @param key Key name
3837
3854
  */
3838
3855
  delete: (key: string) => Promise<void>;
3839
3856
  /**
3840
- * 使用 [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata) 生成的加密密钥对字符串进行加密。根据 Windows 文档:“通常,只有与加密数据的用户具有相同登录凭据的用户才可以解密数据”。因此,内容受到同一计算机上其他用户的保护,但不受同一用户空间中运行的其他应用程序的保护。
3841
- * @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
3842
3859
  * @see [Safe Storage](https://www.electronjs.org/docs/latest/api/safe-storage)
3843
3860
  */
3844
3861
  encryptString: (value: string) => Promise<string>;
3845
3862
  /**
3846
- * 对加密的字符串进行解密。
3847
- * @param value 要解密的字符串
3863
+ * Decrypt the encrypted string.
3864
+ * @param value String to decrypt
3848
3865
  */
3849
3866
  decryptString: (value: string) => Promise<string>;
3850
3867
  /**
3851
- * 对字符串进行加密并存储。
3852
- * @param key 键名
3853
- * @param value 要加密并存储的字符串
3868
+ * Encrypt string and store.
3869
+ * @param key Key name
3870
+ * @param value String to encrypt and store
3854
3871
  */
3855
3872
  encryptSet: (key: string, value: string) => Promise<string>;
3856
3873
  /**
3857
- * 获取加密存储中的字符串值。
3858
- * @param key 键名
3859
- * @param defaultValue 可选,默认值
3874
+ * Get string value from encrypted storage.
3875
+ * @param key Key name
3876
+ * @param defaultValue Optional, default value
3860
3877
  */
3861
3878
  decryptGet: (key: string, defaultValue?: string) => Promise<string | undefined>;
3862
3879
  }