@widget-js/core 0.7.2 → 0.7.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.cjs +2027 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1396 -0
- package/dist/index.js +1944 -0
- package/dist/index.js.map +1 -0
- package/package.json +15 -16
- package/dist/cjs/AppPermission.js +0 -8
- package/dist/cjs/api/ApiConstants.js +0 -11
- package/dist/cjs/api/AppApi.js +0 -51
- package/dist/cjs/api/BaseApi.js +0 -13
- package/dist/cjs/api/BroadcastApi.js +0 -22
- package/dist/cjs/api/BrowserWindowApi.js +0 -144
- package/dist/cjs/api/Channel.js +0 -22
- package/dist/cjs/api/ClipboardApi.js +0 -23
- package/dist/cjs/api/DeviceApi.js +0 -25
- package/dist/cjs/api/DialogApi.js +0 -22
- package/dist/cjs/api/ElectronApi.js +0 -15
- package/dist/cjs/api/FileApi.js +0 -21
- package/dist/cjs/api/HostedWidgetApi.js +0 -64
- package/dist/cjs/api/LogApi.js +0 -28
- package/dist/cjs/api/NotificationApi.js +0 -117
- package/dist/cjs/api/ShortcutApi.js +0 -23
- package/dist/cjs/api/StoreApi.js +0 -38
- package/dist/cjs/api/WidgetApi.js +0 -92
- package/dist/cjs/api/WidgetDataApi.js +0 -95
- package/dist/cjs/index.js +0 -51
- package/dist/cjs/lang/LanguageCode.js +0 -34
- package/dist/cjs/model/AppNotification.js +0 -33
- package/dist/cjs/model/BrowserWindowStatus.js +0 -11
- package/dist/cjs/model/HostedMode.js +0 -18
- package/dist/cjs/model/HostedWidget.js +0 -14
- package/dist/cjs/model/SocialInfo.js +0 -10
- package/dist/cjs/model/Widget.js +0 -118
- package/dist/cjs/model/WidgetData.js +0 -16
- package/dist/cjs/model/WidgetPackage.js +0 -98
- package/dist/cjs/model/WidgetParams.js +0 -151
- package/dist/cjs/model/event/AppMouseEvent.js +0 -2
- package/dist/cjs/model/event/BroadcastEvent.js +0 -11
- package/dist/cjs/model/event/NativeKeyboardEvent.js +0 -2
- package/dist/cjs/model/event/WebSocketEvent.js +0 -14
- package/dist/cjs/model/interface/IHostedWidget.js +0 -2
- package/dist/cjs/model/interface/Rectangle.js +0 -2
- package/dist/cjs/model/msic/graphics.js +0 -10
- package/dist/cjs/permission/permission.js +0 -2
- package/dist/cjs/router/encoding.js +0 -144
- package/dist/cjs/router/query.js +0 -84
- package/dist/cjs/utils/ElectronUtils.js +0 -32
- package/dist/cjs/utils/LanguageUtils.js +0 -36
- package/dist/cjs/utils/UrlUtils.js +0 -36
- package/dist/esm/AppPermission.js +0 -5
- package/dist/esm/api/ApiConstants.js +0 -7
- package/dist/esm/api/AppApi.js +0 -47
- package/dist/esm/api/BaseApi.js +0 -9
- package/dist/esm/api/BroadcastApi.js +0 -18
- package/dist/esm/api/BrowserWindowApi.js +0 -139
- package/dist/esm/api/Channel.js +0 -19
- package/dist/esm/api/ClipboardApi.js +0 -19
- package/dist/esm/api/DeviceApi.js +0 -21
- package/dist/esm/api/DialogApi.js +0 -19
- package/dist/esm/api/ElectronApi.js +0 -11
- package/dist/esm/api/FileApi.js +0 -18
- package/dist/esm/api/HostedWidgetApi.js +0 -60
- package/dist/esm/api/LogApi.js +0 -25
- package/dist/esm/api/NotificationApi.js +0 -113
- package/dist/esm/api/ShortcutApi.js +0 -19
- package/dist/esm/api/StoreApi.js +0 -35
- package/dist/esm/api/WidgetApi.js +0 -88
- package/dist/esm/api/WidgetDataApi.js +0 -88
- package/dist/esm/index.js +0 -35
- package/dist/esm/lang/LanguageCode.js +0 -33
- package/dist/esm/model/AppNotification.js +0 -29
- package/dist/esm/model/BrowserWindowStatus.js +0 -8
- package/dist/esm/model/HostedMode.js +0 -15
- package/dist/esm/model/HostedWidget.js +0 -10
- package/dist/esm/model/SocialInfo.js +0 -6
- package/dist/esm/model/Widget.js +0 -114
- package/dist/esm/model/WidgetData.js +0 -12
- package/dist/esm/model/WidgetPackage.js +0 -94
- package/dist/esm/model/WidgetParams.js +0 -147
- package/dist/esm/model/event/AppMouseEvent.js +0 -1
- package/dist/esm/model/event/BroadcastEvent.js +0 -7
- package/dist/esm/model/event/NativeKeyboardEvent.js +0 -1
- package/dist/esm/model/event/WebSocketEvent.js +0 -10
- package/dist/esm/model/interface/IHostedWidget.js +0 -1
- package/dist/esm/model/interface/Rectangle.js +0 -1
- package/dist/esm/model/msic/graphics.js +0 -7
- package/dist/esm/permission/permission.js +0 -1
- package/dist/esm/router/encoding.js +0 -135
- package/dist/esm/router/query.js +0 -79
- package/dist/esm/utils/ElectronUtils.js +0 -28
- package/dist/esm/utils/LanguageUtils.js +0 -32
- package/dist/esm/utils/UrlUtils.js +0 -32
- package/dist/types/AppPermission.d.ts +0 -4
- package/dist/types/api/ApiConstants.d.ts +0 -7
- package/dist/types/api/AppApi.d.ts +0 -29
- package/dist/types/api/BaseApi.d.ts +0 -5
- package/dist/types/api/BroadcastApi.d.ts +0 -21
- package/dist/types/api/BrowserWindowApi.d.ts +0 -111
- package/dist/types/api/Channel.d.ts +0 -18
- package/dist/types/api/ClipboardApi.d.ts +0 -10
- package/dist/types/api/DeviceApi.d.ts +0 -20
- package/dist/types/api/DialogApi.d.ts +0 -7
- package/dist/types/api/ElectronApi.d.ts +0 -4
- package/dist/types/api/FileApi.d.ts +0 -13
- package/dist/types/api/HostedWidgetApi.d.ts +0 -55
- package/dist/types/api/LogApi.d.ts +0 -9
- package/dist/types/api/NotificationApi.d.ts +0 -38
- package/dist/types/api/ShortcutApi.d.ts +0 -10
- package/dist/types/api/StoreApi.d.ts +0 -10
- package/dist/types/api/WidgetApi.d.ts +0 -48
- package/dist/types/api/WidgetDataApi.d.ts +0 -44
- package/dist/types/index.d.ts +0 -35
- package/dist/types/lang/LanguageCode.d.ts +0 -40
- package/dist/types/model/AppNotification.d.ts +0 -50
- package/dist/types/model/BrowserWindowStatus.d.ts +0 -9
- package/dist/types/model/HostedMode.d.ts +0 -14
- package/dist/types/model/HostedWidget.d.ts +0 -13
- package/dist/types/model/SocialInfo.d.ts +0 -6
- package/dist/types/model/Widget.d.ts +0 -136
- package/dist/types/model/WidgetData.d.ts +0 -35
- package/dist/types/model/WidgetPackage.d.ts +0 -101
- package/dist/types/model/WidgetParams.d.ts +0 -61
- package/dist/types/model/event/AppMouseEvent.d.ts +0 -14
- package/dist/types/model/event/BroadcastEvent.d.ts +0 -21
- package/dist/types/model/event/NativeKeyboardEvent.d.ts +0 -6
- package/dist/types/model/event/WebSocketEvent.d.ts +0 -8
- package/dist/types/model/interface/IHostedWidget.d.ts +0 -13
- package/dist/types/model/interface/Rectangle.d.ts +0 -18
- package/dist/types/model/msic/graphics.d.ts +0 -14
- package/dist/types/permission/permission.d.ts +0 -1
- package/dist/types/router/encoding.d.ts +0 -62
- package/dist/types/router/query.d.ts +0 -53
- package/dist/types/utils/ElectronUtils.d.ts +0 -10
- package/dist/types/utils/LanguageUtils.d.ts +0 -8
- package/dist/types/utils/UrlUtils.d.ts +0 -6
- package/dist/umd/index.js +0 -2
- package/dist/umd/index.js.LICENSE.txt +0 -6
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export type NotificationType = "countdown" | "advance-countdown" | "error" | "success" | "warning" | "info" | "reminder" | "url" | "call";
|
|
2
|
-
export declare enum NotificationSize {
|
|
3
|
-
SMALL = "small",
|
|
4
|
-
NORMAL = "normal",
|
|
5
|
-
LARGE = "large"
|
|
6
|
-
}
|
|
7
|
-
export interface NotificationOption {
|
|
8
|
-
type?: NotificationType;
|
|
9
|
-
title?: string;
|
|
10
|
-
message: string;
|
|
11
|
-
targetTime?: string;
|
|
12
|
-
duration?: number;
|
|
13
|
-
/**
|
|
14
|
-
* 图片名,目前只支持mingcute图标。
|
|
15
|
-
* https://www.mingcute.com/
|
|
16
|
-
*/
|
|
17
|
-
icon?: string;
|
|
18
|
-
color?: string;
|
|
19
|
-
confirmButtonText?: string;
|
|
20
|
-
cancelButtonText?: string;
|
|
21
|
-
cancelBroadcast?: string;
|
|
22
|
-
confirmBroadcast?: string;
|
|
23
|
-
size?: NotificationSize;
|
|
24
|
-
url?: string;
|
|
25
|
-
avatar?: string;
|
|
26
|
-
audio?: string;
|
|
27
|
-
lyric?: string;
|
|
28
|
-
backgroundColor?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare class AppNotification {
|
|
31
|
-
type: NotificationType;
|
|
32
|
-
message: string;
|
|
33
|
-
title?: string;
|
|
34
|
-
targetTime?: string;
|
|
35
|
-
duration: number;
|
|
36
|
-
icon?: string;
|
|
37
|
-
color?: string;
|
|
38
|
-
backgroundColor?: string;
|
|
39
|
-
confirmButtonText?: string;
|
|
40
|
-
cancelButtonText?: string;
|
|
41
|
-
cancelBroadcast?: string;
|
|
42
|
-
confirmBroadcast?: string;
|
|
43
|
-
size: NotificationSize;
|
|
44
|
-
url?: string;
|
|
45
|
-
avatar?: string;
|
|
46
|
-
audio?: string;
|
|
47
|
-
lyric?: string;
|
|
48
|
-
createdAt: string;
|
|
49
|
-
constructor(option: NotificationOption);
|
|
50
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import BrowserWindowStatus from "./BrowserWindowStatus";
|
|
2
|
-
export declare class HostedWidget {
|
|
3
|
-
id: string;
|
|
4
|
-
widgetName: string;
|
|
5
|
-
packageName: string;
|
|
6
|
-
hostedMode: number;
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
browserWindowStatus?: BrowserWindowStatus;
|
|
10
|
-
shortcut?: string;
|
|
11
|
-
proxy?: string;
|
|
12
|
-
isOverlap(): boolean;
|
|
13
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type SocialInfoType = "qq" | "wechat" | "qq-group" | "discord" | "telegram" | "tiktok" | "douyin" | "youtube" | "instagram" | "twitter" | "facebook" | "kuaishou" | "bilibili" | "github" | "email" | "gitee" | "homepage";
|
|
2
|
-
export declare class SocialInfo {
|
|
3
|
-
name: SocialInfoType;
|
|
4
|
-
content: string;
|
|
5
|
-
constructor(name: SocialInfoType, url: string);
|
|
6
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { HostedMode } from "./HostedMode";
|
|
2
|
-
import { WidgetPermission } from "../permission/permission";
|
|
3
|
-
import { LanguageCode, LanguageTextMap } from "../lang/LanguageCode";
|
|
4
|
-
type WidgetOptions = {
|
|
5
|
-
name: string;
|
|
6
|
-
title: LanguageTextMap;
|
|
7
|
-
description: LanguageTextMap;
|
|
8
|
-
keywords: WidgetKeyword[];
|
|
9
|
-
lang: LanguageCode;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
maxWidth?: number;
|
|
13
|
-
maxHeight?: number;
|
|
14
|
-
minWidth?: number;
|
|
15
|
-
minHeight?: number;
|
|
16
|
-
packageName?: string;
|
|
17
|
-
previewImage?: string;
|
|
18
|
-
/**
|
|
19
|
-
* 悬浮窗模式 是否可移动
|
|
20
|
-
*/
|
|
21
|
-
movable?: boolean;
|
|
22
|
-
supportHostedMode?: HostedMode;
|
|
23
|
-
backgroundThrottling?: boolean;
|
|
24
|
-
shortcut?: string;
|
|
25
|
-
/**
|
|
26
|
-
* 组件拉伸后,是否强制刷新组件
|
|
27
|
-
*/
|
|
28
|
-
refreshWhenResided?: boolean;
|
|
29
|
-
hideWhenBlur?: boolean;
|
|
30
|
-
routes: WidgetRoute[];
|
|
31
|
-
permissions?: WidgetPermission[];
|
|
32
|
-
broadcastChannels?: string[];
|
|
33
|
-
};
|
|
34
|
-
export declare class Widget {
|
|
35
|
-
readonly name: string;
|
|
36
|
-
/**
|
|
37
|
-
* 组件标题,显示在界面上的,
|
|
38
|
-
* https://zh.m.wikipedia.org/zh-hans/ISO_639-1
|
|
39
|
-
*/
|
|
40
|
-
readonly title: LanguageTextMap;
|
|
41
|
-
/**
|
|
42
|
-
* 组件介绍
|
|
43
|
-
*/
|
|
44
|
-
readonly description: LanguageTextMap;
|
|
45
|
-
readonly keywords: WidgetKeyword[];
|
|
46
|
-
/**
|
|
47
|
-
* 组件默认语言
|
|
48
|
-
*/
|
|
49
|
-
readonly lang: LanguageCode;
|
|
50
|
-
readonly width: number;
|
|
51
|
-
packageName?: string | null;
|
|
52
|
-
readonly height: number;
|
|
53
|
-
readonly maxWidth: number;
|
|
54
|
-
readonly maxHeight: number;
|
|
55
|
-
readonly minWidth: number;
|
|
56
|
-
readonly minHeight: number;
|
|
57
|
-
readonly movable: boolean;
|
|
58
|
-
readonly backgroundThrottling: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* 预览图片,可以是GIF
|
|
61
|
-
*/
|
|
62
|
-
readonly previewImage?: string;
|
|
63
|
-
readonly supportHostedMode: number;
|
|
64
|
-
readonly hideWhenBlur: boolean;
|
|
65
|
-
readonly shortcut?: string;
|
|
66
|
-
/**
|
|
67
|
-
* 组件拉伸后,是否强制刷新组件
|
|
68
|
-
*/
|
|
69
|
-
readonly refreshWhenResided: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* 组件其他页面的url在这注册
|
|
72
|
-
*/
|
|
73
|
-
readonly routes: WidgetRoute[];
|
|
74
|
-
readonly permissions: WidgetPermission[];
|
|
75
|
-
constructor(options: WidgetOptions);
|
|
76
|
-
getIndexRoute(): WidgetRoute;
|
|
77
|
-
getConfigRoute(): WidgetRoute | undefined;
|
|
78
|
-
isConfigurable(): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* 获取组件标题
|
|
81
|
-
* @param lang 语言环境,不传则获取默认语言
|
|
82
|
-
*/
|
|
83
|
-
getTitle(lang?: LanguageCode): string | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* 获取组件描述
|
|
86
|
-
* @param lang 语言环境,不传则获取默认标题
|
|
87
|
-
*/
|
|
88
|
-
getDescription(lang?: LanguageCode): string | undefined;
|
|
89
|
-
static parseJSON(json: string): Widget;
|
|
90
|
-
static parseObject(obj: any): Widget;
|
|
91
|
-
/**
|
|
92
|
-
* 是否支持悬浮窗
|
|
93
|
-
*/
|
|
94
|
-
isSupportOverlap(): boolean;
|
|
95
|
-
isResizable(): boolean;
|
|
96
|
-
isSupportBackground(): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* 是否支持普通模式
|
|
99
|
-
*/
|
|
100
|
-
isSupportNormal(): boolean;
|
|
101
|
-
isSupportWallpaper(): boolean;
|
|
102
|
-
isSupportScreen(): boolean;
|
|
103
|
-
}
|
|
104
|
-
export interface WidgetRoute {
|
|
105
|
-
name: string;
|
|
106
|
-
url: string;
|
|
107
|
-
meta?: {
|
|
108
|
-
[key: string]: string;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 使用自定义悬浮窗样式
|
|
112
|
-
*/
|
|
113
|
-
customOverlapView?: boolean;
|
|
114
|
-
windowOptions?: WindowOption;
|
|
115
|
-
}
|
|
116
|
-
export interface WindowOption {
|
|
117
|
-
width?: number;
|
|
118
|
-
height?: number;
|
|
119
|
-
maxHeight?: number;
|
|
120
|
-
maxWidth?: number;
|
|
121
|
-
minWidth?: number;
|
|
122
|
-
minHeight?: number;
|
|
123
|
-
}
|
|
124
|
-
export declare enum WidgetKeyword {
|
|
125
|
-
RECOMMEND = "recommend",
|
|
126
|
-
TOOLS = "tools",
|
|
127
|
-
EFFICIENCY = "efficiency",
|
|
128
|
-
PICTURE = "picture",
|
|
129
|
-
LIFE = "life",
|
|
130
|
-
SHORTCUT = "shortcut",
|
|
131
|
-
COUNTDOWN = "countdown",
|
|
132
|
-
TIMER = "timer",
|
|
133
|
-
INFO = "info",
|
|
134
|
-
DASHBOARD = "dashboard"
|
|
135
|
-
}
|
|
136
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 组件配置数据,用于存储组件自定义页面所设置的数据
|
|
3
|
-
*/
|
|
4
|
-
export declare class WidgetData {
|
|
5
|
-
/**
|
|
6
|
-
* 组件id
|
|
7
|
-
*/
|
|
8
|
-
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 组件名
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
13
|
-
/**
|
|
14
|
-
* 背景颜色
|
|
15
|
-
*/
|
|
16
|
-
backgroundColor?: string;
|
|
17
|
-
/**
|
|
18
|
-
* 文字颜色
|
|
19
|
-
*/
|
|
20
|
-
color?: string;
|
|
21
|
-
/**
|
|
22
|
-
* 字体大小
|
|
23
|
-
*/
|
|
24
|
-
fontSize?: number;
|
|
25
|
-
/**
|
|
26
|
-
* 字体
|
|
27
|
-
*/
|
|
28
|
-
fontFamily?: string;
|
|
29
|
-
/**
|
|
30
|
-
* 圆角半径
|
|
31
|
-
*/
|
|
32
|
-
borderRadius?: number;
|
|
33
|
-
constructor(name: string, id?: string);
|
|
34
|
-
parseJSON(json: {}): void;
|
|
35
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Widget } from "./Widget";
|
|
2
|
-
import { LanguageCode, LanguageTextMap } from "../lang/LanguageCode";
|
|
3
|
-
type WidgetPackageOptions = {
|
|
4
|
-
name: string;
|
|
5
|
-
version: string;
|
|
6
|
-
author: string;
|
|
7
|
-
homepage: string;
|
|
8
|
-
title: LanguageTextMap;
|
|
9
|
-
description: LanguageTextMap;
|
|
10
|
-
entry: string;
|
|
11
|
-
remoteEntry?: string;
|
|
12
|
-
remotePackage?: string;
|
|
13
|
-
icon?: string;
|
|
14
|
-
hash: boolean;
|
|
15
|
-
url: string;
|
|
16
|
-
lang?: LanguageCode;
|
|
17
|
-
widgets?: Widget[];
|
|
18
|
-
devOptions?: DevOptions;
|
|
19
|
-
};
|
|
20
|
-
export declare class WidgetPackage {
|
|
21
|
-
/**
|
|
22
|
-
* 组件包名,一般为域名倒置,e.g. com.example
|
|
23
|
-
*/
|
|
24
|
-
readonly name: string;
|
|
25
|
-
/**
|
|
26
|
-
* 组件包版本,e.g. 1.0.2
|
|
27
|
-
*/
|
|
28
|
-
readonly version: string;
|
|
29
|
-
/**
|
|
30
|
-
* 组件作者署名
|
|
31
|
-
*/
|
|
32
|
-
readonly author: string;
|
|
33
|
-
/**
|
|
34
|
-
* 组件首页
|
|
35
|
-
*/
|
|
36
|
-
readonly homepage?: string;
|
|
37
|
-
/**
|
|
38
|
-
* 组件描述
|
|
39
|
-
*/
|
|
40
|
-
readonly title: {
|
|
41
|
-
[key: LanguageCode | string]: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* 组件描述
|
|
45
|
-
*/
|
|
46
|
-
readonly description: {
|
|
47
|
-
[key: LanguageCode | string]: string;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* 组件入口文件,通常为 index.html
|
|
51
|
-
*/
|
|
52
|
-
readonly entry: string;
|
|
53
|
-
/**
|
|
54
|
-
* 组件包的远程入口地址,
|
|
55
|
-
*/
|
|
56
|
-
readonly remoteEntry?: string;
|
|
57
|
-
readonly remotePackage?: string;
|
|
58
|
-
/**
|
|
59
|
-
* 组件包图标
|
|
60
|
-
*/
|
|
61
|
-
readonly icon?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Hash路由模式,默认为true
|
|
64
|
-
*/
|
|
65
|
-
readonly hash: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* 可能是网络地址,或者本地路径(解压后的文件夹路径),
|
|
68
|
-
* 网络地址:https://www.bilibili.com
|
|
69
|
-
* 本地地址:file:///C:/Users/neo/Desktop
|
|
70
|
-
* 在测试时。地址通常为: http://127.0.0.1:8080
|
|
71
|
-
*/
|
|
72
|
-
readonly url: string;
|
|
73
|
-
readonly widgets: Widget[];
|
|
74
|
-
devOptions?: DevOptions;
|
|
75
|
-
constructor(options: WidgetPackageOptions);
|
|
76
|
-
static parseJSON(json: string): WidgetPackage;
|
|
77
|
-
static parseObject(obj: any): WidgetPackage;
|
|
78
|
-
/**
|
|
79
|
-
* 获取组件包标题
|
|
80
|
-
* @param lang 语言环境,不传则获取默认语言
|
|
81
|
-
*/
|
|
82
|
-
getTitle(lang?: LanguageCode): string | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* 获取组件包描述
|
|
85
|
-
* @param lang 语言环境,不传则获取默认标题
|
|
86
|
-
*/
|
|
87
|
-
getDescription(lang?: LanguageCode): string | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* 获取组件完整路径
|
|
90
|
-
* 如果url是http链接,直接返回链接
|
|
91
|
-
* 如果是本地组件:file://链接,则返回 url+entry,e.g. file://C:\users\neo\desktop\index.html#
|
|
92
|
-
*/
|
|
93
|
-
getIndexUrl(hash?: boolean): string;
|
|
94
|
-
}
|
|
95
|
-
export type DevOptions = {
|
|
96
|
-
folder?: string;
|
|
97
|
-
route?: boolean;
|
|
98
|
-
devUrl?: string;
|
|
99
|
-
remoteEntry?: string;
|
|
100
|
-
};
|
|
101
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { HostedMode } from "./HostedMode";
|
|
2
|
-
export declare class WidgetParams {
|
|
3
|
-
static readonly PARAM_PREFIX = "w_";
|
|
4
|
-
static readonly PARAM_ID = "id";
|
|
5
|
-
static readonly PARAM_WIDTH = "width";
|
|
6
|
-
static readonly PARAM_HEIGHT = "height";
|
|
7
|
-
static readonly PARAM_WIDTH_PX = "width_px";
|
|
8
|
-
static readonly PARAM_HEIGHT_PX = "height_px";
|
|
9
|
-
static readonly PARAM_X = "x";
|
|
10
|
-
static readonly PARAM_Y = "y";
|
|
11
|
-
static readonly PARAM_LANG = "lang";
|
|
12
|
-
static readonly PARAM_THEME = "theme";
|
|
13
|
-
static readonly PARAM_MODE = "mode";
|
|
14
|
-
static readonly PARAM_RADIUS = "radius";
|
|
15
|
-
static readonly PARAM_NAME = "name";
|
|
16
|
-
static readonly PARAM_TITLE = "title";
|
|
17
|
-
static readonly PARAM_PREVIEW = "preview";
|
|
18
|
-
static readonly PARAMS: string[];
|
|
19
|
-
id?: string;
|
|
20
|
-
width?: number;
|
|
21
|
-
widthPx?: number;
|
|
22
|
-
heightPx?: number;
|
|
23
|
-
height?: number;
|
|
24
|
-
x?: number;
|
|
25
|
-
y?: number;
|
|
26
|
-
preview?: boolean;
|
|
27
|
-
lang?: string;
|
|
28
|
-
theme?: ThemeMode;
|
|
29
|
-
mode?: HostedMode;
|
|
30
|
-
radius?: number;
|
|
31
|
-
name?: string;
|
|
32
|
-
title?: string;
|
|
33
|
-
/**
|
|
34
|
-
* 将组件参数转为url参数
|
|
35
|
-
* @param object
|
|
36
|
-
* @return URLSearchParams w_w=2&w_h=2&w_id=21&w_width=156&w_height=156
|
|
37
|
-
*/
|
|
38
|
-
toUrlParams(): URLSearchParams;
|
|
39
|
-
getPersistKey(): string;
|
|
40
|
-
/**
|
|
41
|
-
* 从当前地址解析组件参数:
|
|
42
|
-
* http://localhost:8080/#/widget/config/labor_progress?w_w=2&w_h=2&w_width=156&w_height=156
|
|
43
|
-
* =>
|
|
44
|
-
* {width:2,height:2,id:21,width_px:156,height_px:156}
|
|
45
|
-
*/
|
|
46
|
-
static fromCurrentLocation(): WidgetParams;
|
|
47
|
-
static fromLocation(url: string): WidgetParams;
|
|
48
|
-
private static setValue;
|
|
49
|
-
/**
|
|
50
|
-
* 从对象键值对中初始化组件参数
|
|
51
|
-
* {w_width:2,w_height:2,w_id:21,w_width_px:156,w_height_px:156}=>
|
|
52
|
-
* {width:2,height:2,id:21,width_px:156,height_px:156}
|
|
53
|
-
* @param object
|
|
54
|
-
*/
|
|
55
|
-
static fromObject(object: any): WidgetParams;
|
|
56
|
-
}
|
|
57
|
-
export declare enum ThemeMode {
|
|
58
|
-
AUTO = "auto",
|
|
59
|
-
LIGHT = "LIGHT",
|
|
60
|
-
DARK = "DARK"
|
|
61
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface AppMouseEvent {
|
|
2
|
-
handled: boolean;
|
|
3
|
-
wheelScrolled: boolean;
|
|
4
|
-
clicked: boolean;
|
|
5
|
-
isMouseButtonDown: boolean;
|
|
6
|
-
isMouseButtonUp: boolean;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
button: number;
|
|
9
|
-
clicks: number;
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
delta: number;
|
|
13
|
-
location: string;
|
|
14
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { WidgetApiEvent } from "../../api/WidgetApi";
|
|
2
|
-
import { AppApiEvent } from "../../api/AppApi";
|
|
3
|
-
interface BroadcastEventOptions {
|
|
4
|
-
event: WidgetApiEvent | AppApiEvent | string;
|
|
5
|
-
/**
|
|
6
|
-
* 发送人,用于标记发送源,一般为组件名,如:com.example.widgets.countdown
|
|
7
|
-
*/
|
|
8
|
-
sender?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 广播事件携带的数据,只支持部分数据类型。
|
|
11
|
-
* 情见:https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
12
|
-
*/
|
|
13
|
-
payload?: any;
|
|
14
|
-
}
|
|
15
|
-
export declare class BroadcastEvent {
|
|
16
|
-
readonly event: string;
|
|
17
|
-
readonly sender?: string;
|
|
18
|
-
payload?: any;
|
|
19
|
-
constructor(options: BroadcastEventOptions);
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HostedMode } from "../HostedMode";
|
|
2
|
-
export interface IHostedWidget {
|
|
3
|
-
hostedMode: HostedMode;
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
id: string;
|
|
7
|
-
getWidgetName(): string;
|
|
8
|
-
getWidth(): number;
|
|
9
|
-
getHeight(): number;
|
|
10
|
-
getWidgetPackageName(): string;
|
|
11
|
-
getTitle(): string;
|
|
12
|
-
getUrl(): string;
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface Rectangle {
|
|
2
|
-
/**
|
|
3
|
-
* The height of the rectangle (must be an integer).
|
|
4
|
-
*/
|
|
5
|
-
height: number;
|
|
6
|
-
/**
|
|
7
|
-
* The width of the rectangle (must be an integer).
|
|
8
|
-
*/
|
|
9
|
-
width: number;
|
|
10
|
-
/**
|
|
11
|
-
* The x coordinate of the origin of the rectangle (must be an integer).
|
|
12
|
-
*/
|
|
13
|
-
x: number;
|
|
14
|
-
/**
|
|
15
|
-
* The y coordinate of the origin of the rectangle (must be an integer).
|
|
16
|
-
*/
|
|
17
|
-
y: number;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type WidgetPermission = 'keyboard' | 'mouse' | 'clipboard' | 'notification' | 'storage' | 'network' | 'cpu' | 'system-info';
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encoding Rules ␣ = Space Path: ␣ " < > # ? { } Query: ␣ " < > # & = Hash: ␣ "
|
|
3
|
-
* < > `
|
|
4
|
-
*
|
|
5
|
-
* On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)
|
|
6
|
-
* defines some extra characters to be encoded. Most browsers do not encode them
|
|
7
|
-
* in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to
|
|
8
|
-
* also encode `!'()*`. Leaving un-encoded only ASCII alphanumeric(`a-zA-Z0-9`)
|
|
9
|
-
* plus `-._~`. This extra safety should be applied to query by patching the
|
|
10
|
-
* string returned by encodeURIComponent encodeURI also encodes `[\]^`. `\`
|
|
11
|
-
* should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\`
|
|
12
|
-
* into a `/` if directly typed in. The _backtick_ (`````) should also be
|
|
13
|
-
* encoded everywhere because some browsers like FF encode it when directly
|
|
14
|
-
* written while others don't. Safari and IE don't encode ``"<>{}``` in hash.
|
|
15
|
-
*/
|
|
16
|
-
export declare const PLUS_RE: RegExp;
|
|
17
|
-
/**
|
|
18
|
-
* Encode characters that need to be encoded on the hash section of the URL.
|
|
19
|
-
*
|
|
20
|
-
* @param text - string to encode
|
|
21
|
-
* @returns encoded string
|
|
22
|
-
*/
|
|
23
|
-
export declare function encodeHash(text: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Encode characters that need to be encoded query values on the query
|
|
26
|
-
* section of the URL.
|
|
27
|
-
*
|
|
28
|
-
* @param text - string to encode
|
|
29
|
-
* @returns encoded string
|
|
30
|
-
*/
|
|
31
|
-
export declare function encodeQueryValue(text: string | number): string;
|
|
32
|
-
/**
|
|
33
|
-
* Like `encodeQueryValue` but also encodes the `=` character.
|
|
34
|
-
*
|
|
35
|
-
* @param text - string to encode
|
|
36
|
-
*/
|
|
37
|
-
export declare function encodeQueryKey(text: string | number): string;
|
|
38
|
-
/**
|
|
39
|
-
* Encode characters that need to be encoded on the path section of the URL.
|
|
40
|
-
*
|
|
41
|
-
* @param text - string to encode
|
|
42
|
-
* @returns encoded string
|
|
43
|
-
*/
|
|
44
|
-
export declare function encodePath(text: string | number): string;
|
|
45
|
-
/**
|
|
46
|
-
* Encode characters that need to be encoded on the path section of the URL as a
|
|
47
|
-
* param. This function encodes everything {@link encodePath} does plus the
|
|
48
|
-
* slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
|
|
49
|
-
* string instead.
|
|
50
|
-
*
|
|
51
|
-
* @param text - string to encode
|
|
52
|
-
* @returns encoded string
|
|
53
|
-
*/
|
|
54
|
-
export declare function encodeParam(text: string | number | null | undefined): string;
|
|
55
|
-
/**
|
|
56
|
-
* Decode text using `decodeURIComponent`. Returns the original text if it
|
|
57
|
-
* fails.
|
|
58
|
-
*
|
|
59
|
-
* @param text - string to decode
|
|
60
|
-
* @returns decoded string
|
|
61
|
-
*/
|
|
62
|
-
export declare function decode(text: string | number): string;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Possible values in normalized {@link LocationQuery}. `null` renders the query
|
|
3
|
-
* param but without an `=`.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```
|
|
7
|
-
* ?isNull&isEmpty=&other=other
|
|
8
|
-
* gives
|
|
9
|
-
* `{ isNull: null, isEmpty: '', other: 'other' }`.
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export type LocationQueryValue = string | null;
|
|
15
|
-
/**
|
|
16
|
-
* Possible values when defining a query.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export type LocationQueryValueRaw = LocationQueryValue | number | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Normalized query object that appears in {@link RouteLocationNormalized}
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Loose {@link LocationQuery} object that can be passed to functions like
|
|
29
|
-
* {@link Router.push} and {@link Router.replace} or anywhere when creating a
|
|
30
|
-
* {@link RouteLocationRaw}
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Transforms a queryString into a {@link LocationQuery} object. Accept both, a
|
|
37
|
-
* version with the leading `?` and without Should work as URLSearchParams
|
|
38
|
-
* @internal
|
|
39
|
-
*
|
|
40
|
-
* @param search - search string to parse
|
|
41
|
-
* @returns a query object
|
|
42
|
-
*/
|
|
43
|
-
export declare function parseQuery(search: string): LocationQuery;
|
|
44
|
-
/**
|
|
45
|
-
* Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
|
|
46
|
-
* doesn't prepend a `?`
|
|
47
|
-
*
|
|
48
|
-
* @internal
|
|
49
|
-
*
|
|
50
|
-
* @param query - query object to stringify
|
|
51
|
-
* @returns string version of the query without the leading `?`
|
|
52
|
-
*/
|
|
53
|
-
export declare function stringifyQuery(query: LocationQueryRaw): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class ElectronUtils {
|
|
2
|
-
static hasElectronApi(): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* 获取ElectronAPI
|
|
5
|
-
* windows api
|
|
6
|
-
*/
|
|
7
|
-
static getAPI(): any;
|
|
8
|
-
static invokeMethod(channel: string, method: string, ...args: any[]): Promise<any>;
|
|
9
|
-
static invoke(channel: string, ...args: any[]): Promise<any>;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LanguageCode, LanguageTextMap } from "../lang/LanguageCode";
|
|
2
|
-
/**
|
|
3
|
-
* 根据语言环境获取文本
|
|
4
|
-
* @param langMap 对象
|
|
5
|
-
* @param {LanguageCode} langCode 语言环境 例如:zh-CN,en-US
|
|
6
|
-
* @param fallbackToBrowser
|
|
7
|
-
*/
|
|
8
|
-
export declare function getTextByLanguageCode(langMap: LanguageTextMap, langCode?: LanguageCode, fallbackToBrowser?: boolean): string | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WidgetPackage } from "../model/WidgetPackage";
|
|
2
|
-
import { WidgetParams } from "../model/WidgetParams";
|
|
3
|
-
export declare class UrlUtils {
|
|
4
|
-
static getWidgetUrl(widgetUrl: string, widgetPackage: WidgetPackage, widgetParams: WidgetParams): string;
|
|
5
|
-
static getWidgetPackageIndexUrl(url: string, entry: string, hash: boolean): string;
|
|
6
|
-
}
|