@widget-js/core 24.1.1-beta.77 → 24.1.1-beta.78

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
@@ -2778,6 +2778,8 @@ interface IWidgetApi {
2778
2778
  */
2779
2779
  getWidgetPackageUrl: (packageName: string) => Promise<string | null>;
2780
2780
  restartWidgets: (mode?: DeployMode) => Promise<void>;
2781
+ updateSyncInfo: () => Promise<void>;
2782
+ getSyncInfo: (widgetName?: string) => Promise<WidgetSyncInfo | null>;
2781
2783
  }
2782
2784
 
2783
2785
  type WidgetApiMethods = keyof IWidgetApi;
@@ -2788,6 +2790,8 @@ declare enum WidgetApiEvent {
2788
2790
  PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
2789
2791
  }
2790
2792
  declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidgetApi {
2793
+ getSyncInfo(widgetName?: string): Promise<WidgetSyncInfo | null>;
2794
+ updateSyncInfo(): Promise<void>;
2791
2795
  reload(id?: string): Promise<void>;
2792
2796
  getChannel(): string;
2793
2797
  registerWidgets(widgets: Widget[]): Promise<any>;
@@ -3201,6 +3205,10 @@ interface IWidgetOptions extends IWindowSize, IPageOptions {
3201
3205
  */
3202
3206
  disabled?: boolean;
3203
3207
  previewImage: string;
3208
+ /**
3209
+ * whether the widget data can be synchronized
3210
+ */
3211
+ synchronizable?: boolean;
3204
3212
  categories?: Category[];
3205
3213
  /**
3206
3214
  * 组件包所需的App版本
@@ -3248,6 +3256,7 @@ declare class Widget extends Page {
3248
3256
  * 如果为true,组件将不会添加到组件包中
3249
3257
  */
3250
3258
  readonly disabled?: boolean;
3259
+ readonly synchronizable?: boolean;
3251
3260
  /**
3252
3261
  * 配置页面路径,没有则不能修改
3253
3262
  */
@@ -3320,6 +3329,11 @@ interface AppMouseEvent {
3320
3329
  location: string;
3321
3330
  }
3322
3331
 
3332
+ interface WidgetSyncInfo {
3333
+ widgetName: string;
3334
+ latestSyncTime: Date;
3335
+ }
3336
+
3323
3337
  declare class ElectronUtils {
3324
3338
  static hasElectronApi(): boolean;
3325
3339
  /**
@@ -3767,4 +3781,4 @@ declare class GridSystem extends GridRect {
3767
3781
  getHeight(): number;
3768
3782
  }
3769
3783
 
3770
- export { type AddWidgetOption, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRuntimeInfo, BackgroundWidget, BaseApi, type BatteryData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CurrentLoadCpuData, type CurrentLoadData, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type Display, type DownloadUrlOptions, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, type Hardware, type HardwareSensor, type HardwareType, HostedMode, HttpApi, type HttpApiMethods, type IAppApi, 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 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 Node, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, ProcessApi, type ProcessApiMethods, type ProxyConfig, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type SensorType, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemFile, ThemeMode, TrayApiEvent, type TrayWidgetOptions, UserApi, UserApiEvent, type UserApiMethods, type UserData, 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, WidgetTheme, type WidgetThemeKey, type WidgetThemeProperty, WidgetUtils, delay, normalizeUrl, parseQuery, stringifyQuery };
3784
+ export { type AddWidgetOption, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRuntimeInfo, BackgroundWidget, BaseApi, type BatteryData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CurrentLoadCpuData, type CurrentLoadData, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type Display, type DownloadUrlOptions, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, type Hardware, type HardwareSensor, type HardwareType, HostedMode, HttpApi, type HttpApiMethods, type IAppApi, 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 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 Node, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, ProcessApi, type ProcessApiMethods, type ProxyConfig, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type SensorType, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemFile, ThemeMode, TrayApiEvent, type TrayWidgetOptions, UserApi, UserApiEvent, type UserApiMethods, type UserData, 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, delay, normalizeUrl, parseQuery, stringifyQuery };
package/dist/index.d.ts CHANGED
@@ -2778,6 +2778,8 @@ interface IWidgetApi {
2778
2778
  */
2779
2779
  getWidgetPackageUrl: (packageName: string) => Promise<string | null>;
2780
2780
  restartWidgets: (mode?: DeployMode) => Promise<void>;
2781
+ updateSyncInfo: () => Promise<void>;
2782
+ getSyncInfo: (widgetName?: string) => Promise<WidgetSyncInfo | null>;
2781
2783
  }
2782
2784
 
2783
2785
  type WidgetApiMethods = keyof IWidgetApi;
@@ -2788,6 +2790,8 @@ declare enum WidgetApiEvent {
2788
2790
  PACKAGE_INSTALLED = "event::cn.widgetjs.core.widget.package.installed"
2789
2791
  }
2790
2792
  declare class WidgetApiImpl extends BaseApi<WidgetApiMethods> implements IWidgetApi {
2793
+ getSyncInfo(widgetName?: string): Promise<WidgetSyncInfo | null>;
2794
+ updateSyncInfo(): Promise<void>;
2791
2795
  reload(id?: string): Promise<void>;
2792
2796
  getChannel(): string;
2793
2797
  registerWidgets(widgets: Widget[]): Promise<any>;
@@ -3201,6 +3205,10 @@ interface IWidgetOptions extends IWindowSize, IPageOptions {
3201
3205
  */
3202
3206
  disabled?: boolean;
3203
3207
  previewImage: string;
3208
+ /**
3209
+ * whether the widget data can be synchronized
3210
+ */
3211
+ synchronizable?: boolean;
3204
3212
  categories?: Category[];
3205
3213
  /**
3206
3214
  * 组件包所需的App版本
@@ -3248,6 +3256,7 @@ declare class Widget extends Page {
3248
3256
  * 如果为true,组件将不会添加到组件包中
3249
3257
  */
3250
3258
  readonly disabled?: boolean;
3259
+ readonly synchronizable?: boolean;
3251
3260
  /**
3252
3261
  * 配置页面路径,没有则不能修改
3253
3262
  */
@@ -3320,6 +3329,11 @@ interface AppMouseEvent {
3320
3329
  location: string;
3321
3330
  }
3322
3331
 
3332
+ interface WidgetSyncInfo {
3333
+ widgetName: string;
3334
+ latestSyncTime: Date;
3335
+ }
3336
+
3323
3337
  declare class ElectronUtils {
3324
3338
  static hasElectronApi(): boolean;
3325
3339
  /**
@@ -3767,4 +3781,4 @@ declare class GridSystem extends GridRect {
3767
3781
  getHeight(): number;
3768
3782
  }
3769
3783
 
3770
- export { type AddWidgetOption, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRuntimeInfo, BackgroundWidget, BaseApi, type BatteryData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CurrentLoadCpuData, type CurrentLoadData, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type Display, type DownloadUrlOptions, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, type Hardware, type HardwareSensor, type HardwareType, HostedMode, HttpApi, type HttpApiMethods, type IAppApi, 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 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 Node, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, ProcessApi, type ProcessApiMethods, type ProxyConfig, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type SensorType, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemFile, ThemeMode, TrayApiEvent, type TrayWidgetOptions, UserApi, UserApiEvent, type UserApiMethods, type UserData, 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, WidgetTheme, type WidgetThemeKey, type WidgetThemeProperty, WidgetUtils, delay, normalizeUrl, parseQuery, stringifyQuery };
3784
+ export { type AddWidgetOption, type AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, type AppApiMethods, AppConfig, AppEvent, type AppMouseEvent, AppNotification, AppReminderNotification, type AppRuntimeInfo, BackgroundWidget, BaseApi, type BatteryData, BroadcastApi, type BroadcastApiMethods, BroadcastEvent, type BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, type BrowserWindowApiMethods, type BrowserWindowOptions, type CallNotificationOption, type Category, Channel, ClipboardApi, ClipboardApiEvent, type ClipboardApiMethods, type CountdownNotificationOption, type CpuCacheData, type CpuCurrentSpeedData, type CpuData, type CurrentLoadCpuData, type CurrentLoadData, DefaultWidgetTheme, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, type DeployedWidgetApiMethods, type DevOptions, DeviceApi, type DeviceApiMethods, DialogApi, type DialogApiMethods, type DiskLayoutData, type Display, type DownloadUrlOptions, ElectronApi, ElectronUtils, FileApi, type FileApiMethods, type GraphicsControllerData, type GraphicsData, type GraphicsDisplayData, Gravity, GridRect, GridSystem, type Hardware, type HardwareSensor, type HardwareType, HostedMode, HttpApi, type HttpApiMethods, type IAppApi, 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 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 Node, type NormalizeOptions, NotificationApi, NotificationApiEvent, type NotificationApiMethods, type NotificationOption, NotificationSize, type NotificationType, type OsData, Page, type Point, type Position, ProcessApi, type ProcessApiMethods, type ProxyConfig, type ReadDirOptions, type Rectangle, type ReminderNotificationOption, type RemotePackageUrlInfo, type SaveWidgetOption, type SensorType, type SetPositionOptions, ShortcutApi, ShortcutApiEvent, type ShortcutApiMethods, type ShortcutDetails, type ShowMenuOption, type Size, type SmartData, SocialInfo, type SocialLink, type SocialType, StorageApi, type StorageApiMethods, StoreApi, type StoreApiMethods, SystemApi, SystemApiEvent, type SystemApiMethods, type SystemFile, ThemeMode, TrayApiEvent, type TrayWidgetOptions, UserApi, UserApiEvent, type UserApiMethods, type UserData, 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, delay, normalizeUrl, parseQuery, stringifyQuery };
package/dist/index.js CHANGED
@@ -1054,6 +1054,7 @@ var Widget = class _Widget extends Page {
1054
1054
  * 如果为true,组件将不会添加到组件包中
1055
1055
  */
1056
1056
  disabled;
1057
+ synchronizable;
1057
1058
  /**
1058
1059
  * 配置页面路径,没有则不能修改
1059
1060
  */
@@ -1072,6 +1073,7 @@ var Widget = class _Widget extends Page {
1072
1073
  this.socialLinks = options.socialLinks;
1073
1074
  this.disabled = options.disabled;
1074
1075
  this.trayOptions = options.trayOptions;
1076
+ this.synchronizable = options.synchronizable;
1075
1077
  this.requiredAppVersion = options.requiredAppVersion;
1076
1078
  this.routes = options.routes ?? [];
1077
1079
  }
@@ -2308,6 +2310,12 @@ var WidgetApiEvent = /* @__PURE__ */ ((WidgetApiEvent2) => {
2308
2310
  return WidgetApiEvent2;
2309
2311
  })(WidgetApiEvent || {});
2310
2312
  var WidgetApiImpl = class extends BaseApi {
2313
+ getSyncInfo(widgetName) {
2314
+ return this.invokeMethod("getSyncInfo", widgetName);
2315
+ }
2316
+ updateSyncInfo() {
2317
+ return this.invokeMethod("updateSyncInfo");
2318
+ }
2311
2319
  reload(id) {
2312
2320
  return this.invokeMethod("reload", id);
2313
2321
  }