@widget-js/core 0.10.31 → 0.11.5
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.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -2
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1512,16 +1512,39 @@ 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<
|
|
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>;
|
|
1540
|
+
/**
|
|
1541
|
+
* read file contents
|
|
1542
|
+
* @param filePath
|
|
1543
|
+
* @return base64 encoded string
|
|
1544
|
+
*/
|
|
1545
|
+
readFile(filePath: string): Promise<string>;
|
|
1523
1546
|
}
|
|
1524
1547
|
type FileApiMethods = keyof IFileApi;
|
|
1525
1548
|
declare const FileApi: IFileApi;
|
|
1526
1549
|
|
|
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 };
|
|
1550
|
+
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,18 @@ 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
|
+
}
|
|
2043
|
+
readFile(filePath) {
|
|
2044
|
+
return this.invokeMethod("readFile", filePath);
|
|
2045
|
+
}
|
|
2034
2046
|
};
|
|
2035
2047
|
var FileApi = new FileApiImpl();
|
|
2036
2048
|
export {
|