@widget-js/core 0.10.31 → 0.11.4

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
@@ -1512,16 +1512,33 @@ interface ILogApi {
1512
1512
  type LogApiMethods = keyof ILogApi;
1513
1513
  declare const LogApi: ILogApi;
1514
1514
 
1515
+ interface SystemFile {
1516
+ isDir: boolean;
1517
+ name: string;
1518
+ absolutePath: string;
1519
+ /**
1520
+ * mine type
1521
+ */
1522
+ type: string;
1523
+ children?: SystemFile[];
1524
+ /**
1525
+ * 上传后的ID
1526
+ */
1527
+ uploadId?: string;
1528
+ }
1515
1529
  interface ReadDirOptions {
1516
1530
  ignoreDir?: boolean;
1517
1531
  traverseDir?: boolean;
1518
1532
  }
1519
1533
  interface IFileApi {
1520
- readDirectory(path: string, options?: ReadDirOptions): Promise<string[]>;
1534
+ readDirectory(path: string, options?: ReadDirOptions): Promise<SystemFile[]>;
1521
1535
  isDirectory(filePath: string): Promise<boolean>;
1522
1536
  getFileType(filePath: string): Promise<FileTypeResult>;
1537
+ downloadUrl(url: string): Promise<string>;
1538
+ exists(filePath: string): Promise<boolean>;
1539
+ delete(filePath: string): Promise<boolean>;
1523
1540
  }
1524
1541
  type FileApiMethods = keyof IFileApi;
1525
1542
  declare const FileApi: IFileApi;
1526
1543
 
1527
- export { AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, AppApiMethods, AppMouseEvent, AppNotification, BaseApi, BroadcastApi, BroadcastApiMethods, BroadcastEvent, BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, BrowserWindowApiMethods, Channel, ClipboardApi, ClipboardApiEvent, ClipboardApiMethods, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, DeployedWidgetApiMethods, DevOptions, DeviceApi, DeviceApiMethods, DialogApi, DialogApiMethods, ElectronApi, ElectronUtils, FileApi, FileApiMethods, Gravity, GridRect, GridSystem, HostedMode, IGridRect, IPage, IPageOptions, IWidgetDataApi, IWidgetOptions, IWindowSize, LanguageCode, LanguageTextMap, LocalPackageUrlInfo, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, LogApi, LogApiMethods, MetaInfo, NativeKeyboardEvent, NormalizeOptions, NotificationApi, NotificationApiEvent, NotificationApiMethods, NotificationOption, NotificationSize, NotificationType, OpenUrlOptions, Page, Point, Position, ProcessApi, ProcessApiMethods, ReadDirOptions, Rectangle, RemotePackageUrlInfo, SaveWidgetOption, SetPositionOptions, ShortcutApi, ShortcutApiEvent, ShortcutApiMethods, StoreApi, StoreApiMethods, ThemeMode, WebSocketEvent, WebSocketEventType, Widget, WidgetApi, WidgetApiEvent, WidgetApiMethods, WidgetData, WidgetDataApi, WidgetDataApiMethods, WidgetKeyword, WidgetPackage, WidgetPackageOptions, WidgetParams, WidgetPermission, WidgetRoute, WidgetUrlUtils, getTextByLanguageCode, normalizeUrl, parseQuery, stringifyQuery };
1544
+ export { AlignPosition, ApiConstants, AppApi, AppApiConstants, AppApiEvent, AppApiMethods, AppMouseEvent, AppNotification, BaseApi, BroadcastApi, BroadcastApiMethods, BroadcastEvent, BroadcastEventType, BrowserWindowApi, BrowserWindowApiEvent, BrowserWindowApiMethods, Channel, ClipboardApi, ClipboardApiEvent, ClipboardApiMethods, DeployMode, DeployedPage, DeployedWidget, DeployedWidgetApi, DeployedWidgetApiMethods, DevOptions, DeviceApi, DeviceApiMethods, DialogApi, DialogApiMethods, ElectronApi, ElectronUtils, FileApi, FileApiMethods, Gravity, GridRect, GridSystem, HostedMode, IGridRect, IPage, IPageOptions, IWidgetDataApi, IWidgetOptions, IWindowSize, LanguageCode, LanguageTextMap, LocalPackageUrlInfo, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, LogApi, LogApiMethods, MetaInfo, NativeKeyboardEvent, NormalizeOptions, NotificationApi, NotificationApiEvent, NotificationApiMethods, NotificationOption, NotificationSize, NotificationType, OpenUrlOptions, Page, Point, Position, ProcessApi, ProcessApiMethods, ReadDirOptions, Rectangle, RemotePackageUrlInfo, SaveWidgetOption, SetPositionOptions, ShortcutApi, ShortcutApiEvent, ShortcutApiMethods, StoreApi, StoreApiMethods, SystemFile, ThemeMode, WebSocketEvent, WebSocketEventType, Widget, WidgetApi, WidgetApiEvent, WidgetApiMethods, WidgetData, WidgetDataApi, WidgetDataApiMethods, WidgetKeyword, WidgetPackage, WidgetPackageOptions, WidgetParams, WidgetPermission, WidgetRoute, WidgetUrlUtils, getTextByLanguageCode, normalizeUrl, parseQuery, stringifyQuery };
package/dist/index.js CHANGED
@@ -2031,6 +2031,15 @@ var FileApiImpl = class extends BaseApi {
2031
2031
  readDirectory(path, options) {
2032
2032
  return this.invokeMethod("readDirectory", path, options);
2033
2033
  }
2034
+ delete(filePath) {
2035
+ return this.invokeMethod("delete", filePath);
2036
+ }
2037
+ downloadUrl(url) {
2038
+ return this.invokeMethod("downloadUrl", url);
2039
+ }
2040
+ exists(filePath) {
2041
+ return this.invokeMethod("exists", filePath);
2042
+ }
2034
2043
  };
2035
2044
  var FileApi = new FileApiImpl();
2036
2045
  export {