@sigx/lynx-notifications 0.4.0 → 0.4.1
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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -25
- package/dist/index.js.map +1 -1
- package/dist/notifications.js +38 -0
- package/dist/notifications.js.map +1 -0
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Notifications } from './notifications';
|
|
2
|
-
export type { NotificationContent, ScheduleOptions } from './notifications';
|
|
1
|
+
export { Notifications } from './notifications.js';
|
|
2
|
+
export type { NotificationContent, ScheduleOptions } from './notifications.js';
|
|
3
3
|
export type { PermissionResponse } from '@sigx/lynx-core';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/notifications.ts
|
|
3
|
-
var n = "Notifications", r = {
|
|
4
|
-
schedule(t, r = {}) {
|
|
5
|
-
return e(n, "schedule", t, r);
|
|
6
|
-
},
|
|
7
|
-
cancel(t) {
|
|
8
|
-
return e(n, "cancel", t);
|
|
9
|
-
},
|
|
10
|
-
cancelAll() {
|
|
11
|
-
return e(n, "cancelAll");
|
|
12
|
-
},
|
|
13
|
-
requestPermission() {
|
|
14
|
-
return e(n, "requestPermission");
|
|
15
|
-
},
|
|
16
|
-
getPermissionStatus() {
|
|
17
|
-
return e(n, "getPermissionStatus");
|
|
18
|
-
},
|
|
19
|
-
isAvailable() {
|
|
20
|
-
return t(n);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { r as Notifications };
|
|
25
|
-
|
|
1
|
+
export { Notifications } from './notifications.js';
|
|
26
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { callAsync, isModuleAvailable } from '@sigx/lynx-core';
|
|
2
|
+
const MODULE = 'Notifications';
|
|
3
|
+
/**
|
|
4
|
+
* Local notification APIs.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Notifications } from '@sigx/lynx-notifications';
|
|
9
|
+
*
|
|
10
|
+
* const { status } = await Notifications.requestPermission();
|
|
11
|
+
* if (status === 'granted') {
|
|
12
|
+
* await Notifications.schedule({ title: 'Reminder', body: 'Check your tasks' }, { delay: 60 });
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const Notifications = {
|
|
17
|
+
schedule(content, options = {}) {
|
|
18
|
+
return callAsync(MODULE, 'schedule', content, options);
|
|
19
|
+
},
|
|
20
|
+
cancel(notificationId) {
|
|
21
|
+
return callAsync(MODULE, 'cancel', notificationId);
|
|
22
|
+
},
|
|
23
|
+
cancelAll() {
|
|
24
|
+
return callAsync(MODULE, 'cancelAll');
|
|
25
|
+
},
|
|
26
|
+
/** Request notification permission, showing the OS dialog if needed. */
|
|
27
|
+
requestPermission() {
|
|
28
|
+
return callAsync(MODULE, 'requestPermission');
|
|
29
|
+
},
|
|
30
|
+
/** Check current notification permission status without prompting. */
|
|
31
|
+
getPermissionStatus() {
|
|
32
|
+
return callAsync(MODULE, 'getPermissionStatus');
|
|
33
|
+
},
|
|
34
|
+
isAvailable() {
|
|
35
|
+
return isModuleAvailable(MODULE);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAG/D,MAAM,MAAM,GAAG,eAAe,CAAC;AAgB/B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,QAAQ,CAAC,OAA4B,EAAE,OAAO,GAAoB,EAAE;QAChE,OAAO,SAAS,CAAS,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,cAAsB;QACzB,OAAO,SAAS,CAAO,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC7D,CAAC;IAED,SAAS;QACL,OAAO,SAAS,CAAO,MAAM,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAED,wEAAwE;IACxE,iBAAiB;QACb,OAAO,SAAS,CAAqB,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACtE,CAAC;IAED,sEAAsE;IACtE,mBAAmB;QACf,OAAO,SAAS,CAAqB,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACxE,CAAC;IAED,WAAW;QACP,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigx/lynx-notifications",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Local push notifications for sigx-lynx",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"signalx-module.json"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@sigx/lynx-core": "^0.4.
|
|
22
|
+
"@sigx/lynx-core": "^0.4.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"typescript": "
|
|
26
|
-
"
|
|
25
|
+
"@typescript/native-preview": "7.0.0-dev.20260511.1",
|
|
26
|
+
"typescript": "^6.0.3"
|
|
27
27
|
},
|
|
28
28
|
"author": "Andreas Ekdahl",
|
|
29
29
|
"license": "MIT",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"notifications"
|
|
50
50
|
],
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "
|
|
53
|
-
"dev": "
|
|
52
|
+
"build": "node ../../scripts/clean.mjs dist && tsgo",
|
|
53
|
+
"dev": "tsgo --watch",
|
|
54
|
+
"clean": "node ../../scripts/clean.mjs dist .turbo"
|
|
54
55
|
}
|
|
55
56
|
}
|