@widget-js/core 0.1.6 → 0.1.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.
Files changed (72) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/api/ApiConstants.js +8 -8
  3. package/dist/cjs/api/AppApi.js +31 -31
  4. package/dist/cjs/api/BroadcastApi.js +20 -20
  5. package/dist/cjs/api/BrowserWindowApi.js +42 -24
  6. package/dist/cjs/api/Channel.js +11 -11
  7. package/dist/cjs/api/ElectronApi.js +13 -13
  8. package/dist/cjs/api/NotificationApi.js +83 -83
  9. package/dist/cjs/api/WidgetApi.js +58 -49
  10. package/dist/cjs/index.js +35 -34
  11. package/dist/cjs/model/HostedMode.js +14 -0
  12. package/dist/cjs/model/Notification.js +15 -15
  13. package/dist/cjs/model/SocialInfo.js +10 -10
  14. package/dist/cjs/model/Widget.js +79 -79
  15. package/dist/cjs/model/WidgetData.js +16 -16
  16. package/dist/cjs/model/WidgetPackage.js +21 -6
  17. package/dist/cjs/model/WidgetParams.js +139 -144
  18. package/dist/cjs/model/event/BroadcastEvent.js +14 -14
  19. package/dist/cjs/model/event/WebSocketEvent.js +14 -14
  20. package/dist/cjs/model/interface/IHostedWidget.js +2 -0
  21. package/dist/cjs/repository/WidgetDataRepository.js +71 -71
  22. package/dist/cjs/router/encoding.js +144 -144
  23. package/dist/cjs/router/query.js +84 -84
  24. package/dist/cjs/utils/ElectronUtils.js +24 -24
  25. package/dist/esm/api/ApiConstants.js +4 -4
  26. package/dist/esm/api/AppApi.js +27 -27
  27. package/dist/esm/api/BroadcastApi.js +16 -16
  28. package/dist/esm/api/BrowserWindowApi.js +38 -20
  29. package/dist/esm/api/Channel.js +8 -8
  30. package/dist/esm/api/ElectronApi.js +9 -9
  31. package/dist/esm/api/NotificationApi.js +79 -79
  32. package/dist/esm/api/WidgetApi.js +54 -45
  33. package/dist/esm/index.js +19 -18
  34. package/dist/esm/model/HostedMode.js +11 -0
  35. package/dist/esm/model/Notification.js +11 -11
  36. package/dist/esm/model/SocialInfo.js +6 -6
  37. package/dist/esm/model/Widget.js +75 -75
  38. package/dist/esm/model/WidgetData.js +12 -12
  39. package/dist/esm/model/WidgetPackage.js +17 -2
  40. package/dist/esm/model/WidgetParams.js +135 -140
  41. package/dist/esm/model/event/BroadcastEvent.js +10 -10
  42. package/dist/esm/model/event/WebSocketEvent.js +10 -10
  43. package/dist/esm/model/interface/IHostedWidget.js +1 -0
  44. package/dist/esm/repository/WidgetDataRepository.js +64 -64
  45. package/dist/esm/router/encoding.js +135 -135
  46. package/dist/esm/router/query.js +79 -79
  47. package/dist/esm/utils/ElectronUtils.js +20 -20
  48. package/dist/types/api/ApiConstants.d.ts +4 -4
  49. package/dist/types/api/AppApi.d.ts +10 -10
  50. package/dist/types/api/BroadcastApi.d.ts +6 -6
  51. package/dist/types/api/BrowserWindowApi.d.ts +27 -10
  52. package/dist/types/api/Channel.d.ts +7 -7
  53. package/dist/types/api/ElectronApi.d.ts +4 -4
  54. package/dist/types/api/NotificationApi.d.ts +14 -14
  55. package/dist/types/api/WidgetApi.d.ts +30 -24
  56. package/dist/types/index.d.ts +19 -18
  57. package/dist/types/model/HostedMode.d.ts +10 -0
  58. package/dist/types/model/Notification.d.ts +16 -16
  59. package/dist/types/model/SocialInfo.d.ts +6 -6
  60. package/dist/types/model/Widget.d.ts +96 -85
  61. package/dist/types/model/WidgetData.d.ts +35 -35
  62. package/dist/types/model/WidgetPackage.d.ts +43 -41
  63. package/dist/types/model/WidgetParams.d.ts +60 -63
  64. package/dist/types/model/event/BroadcastEvent.d.ts +12 -12
  65. package/dist/types/model/event/WebSocketEvent.d.ts +8 -8
  66. package/dist/types/model/interface/IHostedWidget.d.ts +13 -0
  67. package/dist/types/repository/WidgetDataRepository.d.ts +26 -26
  68. package/dist/types/router/encoding.d.ts +62 -62
  69. package/dist/types/router/query.d.ts +53 -53
  70. package/dist/types/utils/ElectronUtils.d.ts +8 -8
  71. package/dist/umd/index.js +1 -1
  72. package/package.json +2 -2
@@ -1,27 +1,27 @@
1
- import { ElectronUtils } from "../utils/ElectronUtils";
2
- import { Channel } from "./Channel";
3
- export class AppApi {
4
- static async setConfig(key, value) {
5
- await ElectronUtils.getAPI().invoke(Channel.APP, this.SET_CONFIG, key, value);
6
- }
7
- static async getConfig(key, defaultValue) {
8
- const value = await ElectronUtils.getAPI().invoke(Channel.APP, this.GET_CONFIG, key);
9
- if (value === null || value === undefined) {
10
- return defaultValue;
11
- }
12
- if (typeof defaultValue == "boolean") {
13
- return value === "true";
14
- }
15
- return value;
16
- }
17
- static openAddWidgetWindow() {
18
- ElectronUtils.getAPI().invoke(Channel.APP, this.OPEN_ADD_WIDGET_WINDOW);
19
- }
20
- static openSettingWindow() {
21
- ElectronUtils.getAPI().invoke(Channel.APP, this.OPEN_SETTING_WINDOW);
22
- }
23
- }
24
- AppApi.SET_CONFIG = "SET_CONFIG";
25
- AppApi.GET_CONFIG = "GET_CONFIG";
26
- AppApi.OPEN_ADD_WIDGET_WINDOW = "open-add-widget-window";
27
- AppApi.OPEN_SETTING_WINDOW = "open-setting-window";
1
+ import { ElectronUtils } from "../utils/ElectronUtils";
2
+ import { Channel } from "./Channel";
3
+ export class AppApi {
4
+ static async setConfig(key, value) {
5
+ await ElectronUtils.getAPI().invoke(Channel.APP, this.SET_CONFIG, key, value);
6
+ }
7
+ static async getConfig(key, defaultValue) {
8
+ const value = await ElectronUtils.getAPI().invoke(Channel.APP, this.GET_CONFIG, key);
9
+ if (value === null || value === undefined) {
10
+ return defaultValue;
11
+ }
12
+ if (typeof defaultValue == "boolean") {
13
+ return value === "true";
14
+ }
15
+ return value;
16
+ }
17
+ static openAddWidgetWindow() {
18
+ ElectronUtils.getAPI().invoke(Channel.APP, this.OPEN_ADD_WIDGET_WINDOW);
19
+ }
20
+ static openSettingWindow() {
21
+ ElectronUtils.getAPI().invoke(Channel.APP, this.OPEN_SETTING_WINDOW);
22
+ }
23
+ }
24
+ AppApi.SET_CONFIG = "SET_CONFIG";
25
+ AppApi.GET_CONFIG = "GET_CONFIG";
26
+ AppApi.OPEN_ADD_WIDGET_WINDOW = "open-add-widget-window";
27
+ AppApi.OPEN_SETTING_WINDOW = "open-setting-window";
@@ -1,16 +1,16 @@
1
- import { ElectronUtils } from "../utils/ElectronUtils";
2
- import { Channel } from "./Channel";
3
- import { ElectronApi } from "./ElectronApi";
4
- export class BroadcastApi {
5
- static async sendBroadcastEvent(event) {
6
- await ElectronUtils.getAPI().invoke(Channel.BROADCAST, JSON.stringify(event));
7
- }
8
- static async registerBroadcast(callback) {
9
- await ElectronApi.addIpcListener(Channel.BROADCAST, (json) => {
10
- callback(JSON.parse(json));
11
- });
12
- }
13
- static async unregisterBroadcast() {
14
- await ElectronApi.removeIpcListener(Channel.BROADCAST);
15
- }
16
- }
1
+ import { ElectronUtils } from "../utils/ElectronUtils";
2
+ import { Channel } from "./Channel";
3
+ import { ElectronApi } from "./ElectronApi";
4
+ export class BroadcastApi {
5
+ static async sendBroadcastEvent(event) {
6
+ await ElectronUtils.getAPI().invoke(Channel.BROADCAST, JSON.stringify(event));
7
+ }
8
+ static async registerBroadcast(callback) {
9
+ await ElectronApi.addIpcListener(Channel.BROADCAST, (json) => {
10
+ callback(JSON.parse(json));
11
+ });
12
+ }
13
+ static async unregisterBroadcast() {
14
+ await ElectronApi.removeIpcListener(Channel.BROADCAST);
15
+ }
16
+ }
@@ -1,20 +1,38 @@
1
- import { Channel } from "./Channel";
2
- import { ElectronUtils } from "../utils/ElectronUtils";
3
- export class BrowserWindowApi {
4
- static async setIgnoreMouseEvent(ignore) {
5
- await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.IGNORE_MOUSE_EVENT, ignore);
6
- }
7
- static async setWindowVisibility(show) {
8
- await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.WINDOW_VISIBILITY, show);
9
- }
10
- static async setAlwaysOnTop(alwaysOnTop) {
11
- await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.ALWAYS_ON_TOP, alwaysOnTop);
12
- }
13
- static async openUrl(url) {
14
- await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.OPEN_URL, url);
15
- }
16
- }
17
- BrowserWindowApi.IGNORE_MOUSE_EVENT = "ignore-mouse-event";
18
- BrowserWindowApi.WINDOW_VISIBILITY = "window-visibility";
19
- BrowserWindowApi.ALWAYS_ON_TOP = "always-on-top";
20
- BrowserWindowApi.OPEN_URL = "open-url";
1
+ import { Channel } from "./Channel";
2
+ import { ElectronUtils } from "../utils/ElectronUtils";
3
+ export class BrowserWindowApi {
4
+ static async setIgnoreMouseEvent(ignore) {
5
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.IGNORE_MOUSE_EVENT, ignore);
6
+ }
7
+ static async setWindowVisibility(show) {
8
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.WINDOW_VISIBILITY, show);
9
+ }
10
+ static async setAlwaysOnTop(alwaysOnTop) {
11
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.ALWAYS_ON_TOP, alwaysOnTop);
12
+ }
13
+ static async isAlwaysOnTop() {
14
+ return await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.IS_ALWAYS_ON_TOP);
15
+ }
16
+ static async openUrl(url) {
17
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.OPEN_URL, url);
18
+ }
19
+ /**
20
+ * 设置窗口位置
21
+ * @param x
22
+ * @param y
23
+ * @param animation 动画只在mac系统有效
24
+ */
25
+ static async setPosition(x, y, animation) {
26
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.SET_POSITION, x, y, animation);
27
+ }
28
+ static async getPosition() {
29
+ return await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.GET_POSITION);
30
+ }
31
+ }
32
+ BrowserWindowApi.IGNORE_MOUSE_EVENT = "ignore-mouse-event";
33
+ BrowserWindowApi.WINDOW_VISIBILITY = "window-visibility";
34
+ BrowserWindowApi.ALWAYS_ON_TOP = "always-on-top";
35
+ BrowserWindowApi.IS_ALWAYS_ON_TOP = "is-always-on-top";
36
+ BrowserWindowApi.OPEN_URL = "open-url";
37
+ BrowserWindowApi.SET_POSITION = "set-position";
38
+ BrowserWindowApi.GET_POSITION = "get-position";
@@ -1,8 +1,8 @@
1
- export var Channel;
2
- (function (Channel) {
3
- Channel["NOTIFICATION"] = "channel::cn.widgetjs.core.notification";
4
- Channel["BROWSER_WINDOW"] = "channel::cn.widgetjs.core.browser_window";
5
- Channel["BROADCAST"] = "channel::cn.widgetjs.core.broadcast";
6
- Channel["WIDGET"] = "channel::cn.widgetjs.core.widget";
7
- Channel["APP"] = "channel::cn.widgetjs.core.app";
8
- })(Channel || (Channel = {}));
1
+ export var Channel;
2
+ (function (Channel) {
3
+ Channel["NOTIFICATION"] = "channel::cn.widgetjs.core.notification";
4
+ Channel["BROWSER_WINDOW"] = "channel::cn.widgetjs.core.browser_window";
5
+ Channel["BROADCAST"] = "channel::cn.widgetjs.core.broadcast";
6
+ Channel["WIDGET"] = "channel::cn.widgetjs.core.widget";
7
+ Channel["APP"] = "channel::cn.widgetjs.core.app";
8
+ })(Channel || (Channel = {}));
@@ -1,9 +1,9 @@
1
- import { ElectronUtils } from "../utils/ElectronUtils";
2
- export class ElectronApi {
3
- static async addIpcListener(key, f) {
4
- await ElectronUtils.getAPI().addIpcListener(key, f);
5
- }
6
- static async removeIpcListener(key) {
7
- await ElectronUtils.getAPI().removeIpcListener(key);
8
- }
9
- }
1
+ import { ElectronUtils } from "../utils/ElectronUtils";
2
+ export class ElectronApi {
3
+ static async addIpcListener(key, f) {
4
+ await ElectronUtils.getAPI().addIpcListener(key, f);
5
+ }
6
+ static async removeIpcListener(key) {
7
+ await ElectronUtils.getAPI().removeIpcListener(key);
8
+ }
9
+ }
@@ -1,79 +1,79 @@
1
- import { Notification } from "../model/Notification";
2
- import { Channel } from "./Channel";
3
- import { ElectronUtils } from "../utils/ElectronUtils";
4
- export class NotificationApi {
5
- static async call(duration = 5000) {
6
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
7
- title: "章鱼哥",
8
- type: "call",
9
- message: "下班提醒",
10
- duration: duration
11
- }));
12
- }
13
- static async advanceCountdown(message, targetTime, title) {
14
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
15
- title,
16
- message,
17
- targetTime,
18
- type: "advance-countdown"
19
- }));
20
- }
21
- static async countdown(message, targetTime) {
22
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
23
- message,
24
- targetTime,
25
- type: "countdown"
26
- }));
27
- }
28
- static async success(message, duration = 5000) {
29
- if (ElectronUtils.hasElectronApi()) {
30
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
31
- message,
32
- type: "success",
33
- duration
34
- }));
35
- }
36
- else {
37
- this.callback("success", message, duration);
38
- }
39
- }
40
- static async error(message, duration = 5000) {
41
- if (ElectronUtils.hasElectronApi()) {
42
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
43
- message,
44
- type: "error",
45
- duration
46
- }));
47
- }
48
- else {
49
- this.callback("error", message, duration);
50
- }
51
- }
52
- static async warning(message, duration = 5000) {
53
- if (ElectronUtils.hasElectronApi()) {
54
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
55
- message,
56
- type: "warning",
57
- duration
58
- }));
59
- }
60
- else {
61
- this.callback("warning", message, duration);
62
- }
63
- }
64
- static async message(message, duration = 5000) {
65
- if (ElectronUtils.hasElectronApi()) {
66
- ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
67
- message,
68
- type: "message",
69
- duration
70
- }));
71
- }
72
- else {
73
- this.callback("message", message, duration);
74
- }
75
- }
76
- static setDebugNotification(callback) {
77
- this.callback = callback;
78
- }
79
- }
1
+ import { Notification } from "../model/Notification";
2
+ import { Channel } from "./Channel";
3
+ import { ElectronUtils } from "../utils/ElectronUtils";
4
+ export class NotificationApi {
5
+ static async call(duration = 5000) {
6
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
7
+ title: "章鱼哥",
8
+ type: "call",
9
+ message: "下班提醒",
10
+ duration: duration
11
+ }));
12
+ }
13
+ static async advanceCountdown(message, targetTime, title) {
14
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
15
+ title,
16
+ message,
17
+ targetTime,
18
+ type: "advance-countdown"
19
+ }));
20
+ }
21
+ static async countdown(message, targetTime) {
22
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
23
+ message,
24
+ targetTime,
25
+ type: "countdown"
26
+ }));
27
+ }
28
+ static async success(message, duration = 5000) {
29
+ if (ElectronUtils.hasElectronApi()) {
30
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
31
+ message,
32
+ type: "success",
33
+ duration
34
+ }));
35
+ }
36
+ else {
37
+ this.callback("success", message, duration);
38
+ }
39
+ }
40
+ static async error(message, duration = 5000) {
41
+ if (ElectronUtils.hasElectronApi()) {
42
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
43
+ message,
44
+ type: "error",
45
+ duration
46
+ }));
47
+ }
48
+ else {
49
+ this.callback("error", message, duration);
50
+ }
51
+ }
52
+ static async warning(message, duration = 5000) {
53
+ if (ElectronUtils.hasElectronApi()) {
54
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
55
+ message,
56
+ type: "warning",
57
+ duration
58
+ }));
59
+ }
60
+ else {
61
+ this.callback("warning", message, duration);
62
+ }
63
+ }
64
+ static async message(message, duration = 5000) {
65
+ if (ElectronUtils.hasElectronApi()) {
66
+ ElectronUtils.getAPI().invoke(Channel.NOTIFICATION, new Notification({
67
+ message,
68
+ type: "message",
69
+ duration
70
+ }));
71
+ }
72
+ else {
73
+ this.callback("message", message, duration);
74
+ }
75
+ }
76
+ static setDebugNotification(callback) {
77
+ this.callback = callback;
78
+ }
79
+ }
@@ -1,45 +1,54 @@
1
- import { Widget } from "../model/Widget";
2
- import { ElectronUtils } from "../utils/ElectronUtils";
3
- import { Channel } from "./Channel";
4
- export class WidgetApi {
5
- static async registerWidgets(widgets) {
6
- await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.REGISTER_WIDGETS, JSON.stringify(widgets));
7
- }
8
- static async registerWidgetPackage(widgetPackage) {
9
- await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.REGISTER_WIDGET_PACKAGE, JSON.stringify(widgetPackage));
10
- }
11
- static async getWidgets() {
12
- const data = await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGETS);
13
- const widgets = [];
14
- if (data) {
15
- const arr = JSON.parse(data);
16
- for (const i in arr) {
17
- widgets.push(Widget.parseObject(arr[i]));
18
- }
19
- }
20
- return widgets;
21
- }
22
- static async getWidgetPackages() {
23
- return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGES);
24
- }
25
- /**
26
- *
27
- * @param name package name
28
- */
29
- static async getWidget(name) {
30
- return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET, name);
31
- }
32
- /**
33
- *
34
- * @param name package name
35
- */
36
- static async getWidgetPackage(name) {
37
- return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGE, name);
38
- }
39
- }
40
- WidgetApi.REGISTER_WIDGETS = "register-widgets";
41
- WidgetApi.REGISTER_WIDGET_PACKAGE = "register-widget-package";
42
- WidgetApi.GET_WIDGETS = "get-widgets";
43
- WidgetApi.GET_WIDGET = "get-widget";
44
- WidgetApi.GET_WIDGET_PACKAGE = "get-widget-package";
45
- WidgetApi.GET_WIDGET_PACKAGES = "get-widget-packages";
1
+ import { Widget } from "../model/Widget";
2
+ import { ElectronUtils } from "../utils/ElectronUtils";
3
+ import { WidgetPackage } from "../model/WidgetPackage";
4
+ import { Channel } from "./Channel";
5
+ export class WidgetApi {
6
+ static async registerWidgets(widgets) {
7
+ await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.REGISTER_WIDGETS, JSON.stringify(widgets));
8
+ }
9
+ static async registerWidgetPackage(widgetPackage) {
10
+ await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.REGISTER_WIDGET_PACKAGE, JSON.stringify(widgetPackage));
11
+ }
12
+ static async getWidgets() {
13
+ const data = await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGETS);
14
+ const widgets = [];
15
+ if (data) {
16
+ const arr = JSON.parse(data);
17
+ for (const i in arr) {
18
+ widgets.push(Widget.parseObject(arr[i]));
19
+ }
20
+ }
21
+ return widgets;
22
+ }
23
+ static async getWidgetPackages() {
24
+ return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGES);
25
+ }
26
+ /**
27
+ *
28
+ * @param name package name
29
+ */
30
+ static async getWidget(name) {
31
+ return Widget.parseObject(await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET, name));
32
+ }
33
+ /**
34
+ *
35
+ * @param name package name
36
+ */
37
+ static async getWidgetPackage(name) {
38
+ return WidgetPackage.parseObject(await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGE, name));
39
+ }
40
+ /**
41
+ * 移除组件
42
+ * @param id
43
+ */
44
+ static async removeHostedWidget(id) {
45
+ return ElectronUtils.getAPI().invoke(Channel.WIDGET, this.REMOVE_HOSTED_WIDGET, id);
46
+ }
47
+ }
48
+ WidgetApi.REGISTER_WIDGETS = "register-widgets";
49
+ WidgetApi.REGISTER_WIDGET_PACKAGE = "register-widget-package";
50
+ WidgetApi.GET_WIDGETS = "get-widgets";
51
+ WidgetApi.GET_WIDGET = "get-widget";
52
+ WidgetApi.GET_WIDGET_PACKAGE = "get-widget-package";
53
+ WidgetApi.GET_WIDGET_PACKAGES = "get-widget-packages";
54
+ WidgetApi.REMOVE_HOSTED_WIDGET = "remove-hosted-widget";
package/dist/esm/index.js CHANGED
@@ -1,18 +1,19 @@
1
- export * from "./model/Widget";
2
- export * from "./model/event/BroadcastEvent";
3
- export * from "./model/event/WebSocketEvent";
4
- export * from "./model/WidgetData";
5
- export * from "./model/WidgetParams";
6
- export * from "./model/Notification";
7
- export * from "./model/WidgetPackage";
8
- export * from "./api/ElectronApi";
9
- export * from "./repository/WidgetDataRepository";
10
- export * from "./api/BrowserWindowApi";
11
- export * from "./api/NotificationApi";
12
- export * from "./api/Channel";
13
- export * from "./api/WidgetApi";
14
- export * from "./api/ApiConstants";
15
- export * from "./api/BroadcastApi";
16
- export * from "./api/AppApi";
17
- export * from "./utils/ElectronUtils";
18
- export * from "./router/query";
1
+ export * from "./model/Widget";
2
+ export * from "./model/event/BroadcastEvent";
3
+ export * from "./model/event/WebSocketEvent";
4
+ export * from "./model/WidgetData";
5
+ export * from "./model/WidgetParams";
6
+ export * from "./model/Notification";
7
+ export * from "./model/HostedMode";
8
+ export * from "./model/WidgetPackage";
9
+ export * from "./api/ElectronApi";
10
+ export * from "./repository/WidgetDataRepository";
11
+ export * from "./api/BrowserWindowApi";
12
+ export * from "./api/NotificationApi";
13
+ export * from "./api/Channel";
14
+ export * from "./api/WidgetApi";
15
+ export * from "./api/ApiConstants";
16
+ export * from "./api/BroadcastApi";
17
+ export * from "./api/AppApi";
18
+ export * from "./utils/ElectronUtils";
19
+ export * from "./router/query";
@@ -0,0 +1,11 @@
1
+ export var HostedMode;
2
+ (function (HostedMode) {
3
+ HostedMode[HostedMode["NORMAL"] = 1] = "NORMAL";
4
+ /**
5
+ * 悬浮窗
6
+ */
7
+ HostedMode[HostedMode["OVERLAP"] = 16] = "OVERLAP";
8
+ HostedMode[HostedMode["WALLPAPER"] = 256] = "WALLPAPER";
9
+ HostedMode[HostedMode["SCREEN"] = 4096] = "SCREEN";
10
+ HostedMode[HostedMode["ALL"] = 4369] = "ALL";
11
+ })(HostedMode || (HostedMode = {}));
@@ -1,11 +1,11 @@
1
- export class Notification {
2
- constructor(option) {
3
- var _a, _b;
4
- this.type = "message";
5
- this.type = (_a = option.type) !== null && _a !== void 0 ? _a : "message";
6
- this.title = option.title;
7
- this.message = option.message;
8
- this.targetTime = option.targetTime;
9
- this.duration = (_b = option.duration) !== null && _b !== void 0 ? _b : 5000;
10
- }
11
- }
1
+ export class Notification {
2
+ constructor(option) {
3
+ var _a, _b;
4
+ this.type = "message";
5
+ this.type = (_a = option.type) !== null && _a !== void 0 ? _a : "message";
6
+ this.title = option.title;
7
+ this.message = option.message;
8
+ this.targetTime = option.targetTime;
9
+ this.duration = (_b = option.duration) !== null && _b !== void 0 ? _b : 5000;
10
+ }
11
+ }
@@ -1,6 +1,6 @@
1
- export class SocialInfo {
2
- constructor(name, url) {
3
- this.name = name;
4
- this.content = url;
5
- }
6
- }
1
+ export class SocialInfo {
2
+ constructor(name, url) {
3
+ this.name = name;
4
+ this.content = url;
5
+ }
6
+ }