@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 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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
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
- import { callAsync as e, isModuleAvailable as t } from "@sigx/lynx-core";
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","names":[],"sources":["../src/notifications.ts"],"sourcesContent":["import { callAsync, isModuleAvailable } from '@sigx/lynx-core';\nimport type { PermissionResponse } from '@sigx/lynx-core';\n\nconst MODULE = 'Notifications';\n\nexport interface NotificationContent {\n title: string;\n body: string;\n /** Optional data payload */\n data?: Record<string, string>;\n}\n\nexport interface ScheduleOptions {\n /** Delay in seconds from now */\n delay?: number;\n /** Repeat interval: 'minute', 'hour', 'day', 'week' */\n repeat?: 'minute' | 'hour' | 'day' | 'week';\n}\n\n/**\n * Local notification APIs.\n *\n * @example\n * ```ts\n * import { Notifications } from '@sigx/lynx-notifications';\n *\n * const { status } = await Notifications.requestPermission();\n * if (status === 'granted') {\n * await Notifications.schedule({ title: 'Reminder', body: 'Check your tasks' }, { delay: 60 });\n * }\n * ```\n */\nexport const Notifications = {\n schedule(content: NotificationContent, options: ScheduleOptions = {}): Promise<string> {\n return callAsync<string>(MODULE, 'schedule', content, options);\n },\n\n cancel(notificationId: string): Promise<void> {\n return callAsync<void>(MODULE, 'cancel', notificationId);\n },\n\n cancelAll(): Promise<void> {\n return callAsync<void>(MODULE, 'cancelAll');\n },\n\n /** Request notification permission, showing the OS dialog if needed. */\n requestPermission(): Promise<PermissionResponse> {\n return callAsync<PermissionResponse>(MODULE, 'requestPermission');\n },\n\n /** Check current notification permission status without prompting. */\n getPermissionStatus(): Promise<PermissionResponse> {\n return callAsync<PermissionResponse>(MODULE, 'getPermissionStatus');\n },\n\n isAvailable(): boolean {\n return isModuleAvailable(MODULE);\n },\n} as const;\n"],"mappings":";;AAGA,IAAM,IAAS,iBA6BF,IAAgB;CACzB,SAAS,GAA8B,IAA2B,EAAE,EAAmB;EACnF,OAAO,EAAkB,GAAQ,YAAY,GAAS,EAAQ;;CAGlE,OAAO,GAAuC;EAC1C,OAAO,EAAgB,GAAQ,UAAU,EAAe;;CAG5D,YAA2B;EACvB,OAAO,EAAgB,GAAQ,YAAY;;CAI/C,oBAAiD;EAC7C,OAAO,EAA8B,GAAQ,oBAAoB;;CAIrE,sBAAmD;EAC/C,OAAO,EAA8B,GAAQ,sBAAsB;;CAGvE,cAAuB;EACnB,OAAO,EAAkB,EAAO;;CAEvC"}
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.0",
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.0"
22
+ "@sigx/lynx-core": "^0.4.1"
23
23
  },
24
24
  "devDependencies": {
25
- "typescript": "^6.0.3",
26
- "@sigx/vite": "^0.4.3"
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": "vite build && tsgo --emitDeclarationOnly",
53
- "dev": "vite build --watch"
52
+ "build": "node ../../scripts/clean.mjs dist && tsgo",
53
+ "dev": "tsgo --watch",
54
+ "clean": "node ../../scripts/clean.mjs dist .turbo"
54
55
  }
55
56
  }