@widget-js/core 0.11.8 → 0.11.9
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.map +1 -1
- package/dist/index.d.ts +54 -53
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, CPUUsage, IOCounters, BlinkMemoryInfo, HeapStatistics, ProcessMemoryInfo, SystemMemoryInfo } from 'electron';
|
|
2
2
|
import { FileTypeResult } from 'file-type';
|
|
3
|
-
import {
|
|
3
|
+
import { FormatEnum, ColourspaceEnum, Channels, LevelMetadata } from 'sharp';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated use DeployedMode instead
|
|
@@ -1513,58 +1513,6 @@ interface ILogApi {
|
|
|
1513
1513
|
type LogApiMethods = keyof ILogApi;
|
|
1514
1514
|
declare const LogApi: ILogApi;
|
|
1515
1515
|
|
|
1516
|
-
interface SystemFile {
|
|
1517
|
-
isDir: boolean;
|
|
1518
|
-
name: string;
|
|
1519
|
-
absolutePath: string;
|
|
1520
|
-
/**
|
|
1521
|
-
* mine type
|
|
1522
|
-
*/
|
|
1523
|
-
type: string;
|
|
1524
|
-
children?: SystemFile[];
|
|
1525
|
-
/**
|
|
1526
|
-
* 上传后的ID
|
|
1527
|
-
*/
|
|
1528
|
-
uploadId?: string;
|
|
1529
|
-
}
|
|
1530
|
-
interface ReadDirOptions {
|
|
1531
|
-
ignoreDir?: boolean;
|
|
1532
|
-
traverseDir?: boolean;
|
|
1533
|
-
}
|
|
1534
|
-
interface IFileApi {
|
|
1535
|
-
readDirectory(path: string, options?: ReadDirOptions): Promise<SystemFile[]>;
|
|
1536
|
-
isDirectory(filePath: string): Promise<boolean>;
|
|
1537
|
-
getFileType(filePath: string): Promise<FileTypeResult>;
|
|
1538
|
-
downloadUrl(url: string, savePath: string, fileName: string): Promise<string>;
|
|
1539
|
-
exists(filePath: string): Promise<boolean>;
|
|
1540
|
-
delete(filePath: string): Promise<boolean>;
|
|
1541
|
-
/**
|
|
1542
|
-
* @param childPath
|
|
1543
|
-
* @example childPath = "/images/" will return "C:/Users/username/Documents/widgets/com/exmaple/widget/images"
|
|
1544
|
-
* @return folder relative to system user's documents folder
|
|
1545
|
-
*/
|
|
1546
|
-
getDocumentFolder(childPath?: string): Promise<string>;
|
|
1547
|
-
/**
|
|
1548
|
-
*
|
|
1549
|
-
* @param filePath
|
|
1550
|
-
*/
|
|
1551
|
-
getPictureMetadata(filePath: string): Promise<Metadata$1>;
|
|
1552
|
-
/**
|
|
1553
|
-
* 移动文件
|
|
1554
|
-
* @param form
|
|
1555
|
-
* @param to
|
|
1556
|
-
*/
|
|
1557
|
-
move(form: string, to: string): Promise<string>;
|
|
1558
|
-
/**
|
|
1559
|
-
* read file contents
|
|
1560
|
-
* @param filePath
|
|
1561
|
-
* @return base64 encoded string
|
|
1562
|
-
*/
|
|
1563
|
-
readFile(filePath: string): Promise<string>;
|
|
1564
|
-
}
|
|
1565
|
-
type FileApiMethods = keyof IFileApi;
|
|
1566
|
-
declare const FileApi: IFileApi;
|
|
1567
|
-
|
|
1568
1516
|
interface Metadata {
|
|
1569
1517
|
/** Number value of the EXIF Orientation header, if present */
|
|
1570
1518
|
orientation?: number | undefined;
|
|
@@ -1620,4 +1568,57 @@ interface Metadata {
|
|
|
1620
1568
|
formatMagick?: string | undefined;
|
|
1621
1569
|
}
|
|
1622
1570
|
|
|
1571
|
+
interface SystemFile {
|
|
1572
|
+
isDir: boolean;
|
|
1573
|
+
name: string;
|
|
1574
|
+
absolutePath: string;
|
|
1575
|
+
/**
|
|
1576
|
+
* mine type
|
|
1577
|
+
*/
|
|
1578
|
+
type: string;
|
|
1579
|
+
children?: SystemFile[];
|
|
1580
|
+
/**
|
|
1581
|
+
* 上传后的ID
|
|
1582
|
+
*/
|
|
1583
|
+
uploadId?: string;
|
|
1584
|
+
}
|
|
1585
|
+
interface ReadDirOptions {
|
|
1586
|
+
ignoreDir?: boolean;
|
|
1587
|
+
traverseDir?: boolean;
|
|
1588
|
+
}
|
|
1589
|
+
interface IFileApi {
|
|
1590
|
+
readDirectory(path: string, options?: ReadDirOptions): Promise<SystemFile[]>;
|
|
1591
|
+
isDirectory(filePath: string): Promise<boolean>;
|
|
1592
|
+
getFileType(filePath: string): Promise<FileTypeResult>;
|
|
1593
|
+
downloadUrl(url: string, savePath: string, fileName: string): Promise<string>;
|
|
1594
|
+
exists(filePath: string): Promise<boolean>;
|
|
1595
|
+
delete(filePath: string): Promise<boolean>;
|
|
1596
|
+
/**
|
|
1597
|
+
* @param childPath
|
|
1598
|
+
* @example childPath = "/images/" will return "C:/Users/username/Documents/widgets/com/exmaple/widget/images"
|
|
1599
|
+
* @see https://sharp.pixelplumbing.com/api-input
|
|
1600
|
+
* @return folder relative to system user's documents folder
|
|
1601
|
+
*/
|
|
1602
|
+
getDocumentFolder(childPath?: string): Promise<string>;
|
|
1603
|
+
/**
|
|
1604
|
+
*
|
|
1605
|
+
* @param filePath absolute path
|
|
1606
|
+
*/
|
|
1607
|
+
getPictureMetadata(filePath: string): Promise<Metadata>;
|
|
1608
|
+
/**
|
|
1609
|
+
* 移动文件
|
|
1610
|
+
* @param form
|
|
1611
|
+
* @param to
|
|
1612
|
+
*/
|
|
1613
|
+
move(form: string, to: string): Promise<string>;
|
|
1614
|
+
/**
|
|
1615
|
+
* read file contents
|
|
1616
|
+
* @param filePath
|
|
1617
|
+
* @return base64 encoded string
|
|
1618
|
+
*/
|
|
1619
|
+
readFile(filePath: string): Promise<string>;
|
|
1620
|
+
}
|
|
1621
|
+
type FileApiMethods = keyof IFileApi;
|
|
1622
|
+
declare const FileApi: IFileApi;
|
|
1623
|
+
|
|
1623
1624
|
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, Metadata, 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 };
|