@hamak/notification-spi 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/es2015/events/index.js +4 -0
- package/dist/es2015/events/notification-events.js +1 -0
- package/dist/es2015/index.js +12 -0
- package/dist/es2015/plugin/index.js +4 -0
- package/dist/es2015/plugin/plugin-config.js +4 -0
- package/dist/es2015/plugin/plugin-module.js +1 -0
- package/dist/events/index.d.ts +5 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +4 -0
- package/dist/events/notification-events.d.ts +38 -0
- package/dist/events/notification-events.d.ts.map +1 -0
- package/dist/events/notification-events.js +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/plugin/index.d.ts +6 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +4 -0
- package/dist/plugin/plugin-config.d.ts +45 -0
- package/dist/plugin/plugin-config.d.ts.map +1 -0
- package/dist/plugin/plugin-config.js +4 -0
- package/dist/plugin/plugin-module.d.ts +11 -0
- package/dist/plugin/plugin-module.d.ts.map +1 -0
- package/dist/plugin/plugin-module.js +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hamak/notification-spi
|
|
3
|
+
*
|
|
4
|
+
* Service Provider Interface for the notification system.
|
|
5
|
+
* Provides plugin configuration types and event definitions.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
// Export plugin configuration
|
|
10
|
+
export * from './plugin/index.js';
|
|
11
|
+
// Export event types
|
|
12
|
+
export * from './events/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { INotification } from '@hamak/notification-api';
|
|
2
|
+
/**
|
|
3
|
+
* Event types for notification system integration with hooks
|
|
4
|
+
*
|
|
5
|
+
* These events can be used with the microkernel hooks system
|
|
6
|
+
* to enable cross-plugin notification communication.
|
|
7
|
+
*/
|
|
8
|
+
export interface NotificationEvents {
|
|
9
|
+
/**
|
|
10
|
+
* Fired when a new notification is added
|
|
11
|
+
* Payload is the notification object
|
|
12
|
+
*/
|
|
13
|
+
'notification:added': INotification;
|
|
14
|
+
/**
|
|
15
|
+
* Fired when a notification is dismissed
|
|
16
|
+
* Payload is the notification ID
|
|
17
|
+
*/
|
|
18
|
+
'notification:dismissed': string;
|
|
19
|
+
/**
|
|
20
|
+
* Fired when all notifications are cleared
|
|
21
|
+
* No payload
|
|
22
|
+
*/
|
|
23
|
+
'notification:cleared': void;
|
|
24
|
+
/**
|
|
25
|
+
* Generic event for showing a notification from other plugins
|
|
26
|
+
* Payload is notification data without id/timestamp
|
|
27
|
+
*/
|
|
28
|
+
'notification:show': Omit<INotification, 'id' | 'timestamp'>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Type-safe event names
|
|
32
|
+
*/
|
|
33
|
+
export type NotificationEventName = keyof NotificationEvents;
|
|
34
|
+
/**
|
|
35
|
+
* Helper type to get event payload type by event name
|
|
36
|
+
*/
|
|
37
|
+
export type NotificationEventPayload<T extends NotificationEventName> = NotificationEvents[T];
|
|
38
|
+
//# sourceMappingURL=notification-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-events.d.ts","sourceRoot":"","sources":["../../src/events/notification-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,oBAAoB,EAAE,aAAa,CAAC;IAEpC;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,sBAAsB,EAAE,IAAI,CAAC;IAE7B;;;OAGG;IACH,mBAAmB,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,kBAAkB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,qBAAqB,IAClE,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hamak/notification-spi
|
|
3
|
+
*
|
|
4
|
+
* Service Provider Interface for the notification system.
|
|
5
|
+
* Provides plugin configuration types and event definitions.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export * from './plugin/index.js';
|
|
10
|
+
export * from './events/index.js';
|
|
11
|
+
export type { INotification, INotificationService, NotificationType, NotificationOptions, NotificationListener, NOTIFICATION_SERVICE_TOKEN, } from '@hamak/notification-api';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hamak/notification-spi
|
|
3
|
+
*
|
|
4
|
+
* Service Provider Interface for the notification system.
|
|
5
|
+
* Provides plugin configuration types and event definitions.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
// Export plugin configuration
|
|
10
|
+
export * from './plugin/index.js';
|
|
11
|
+
// Export event types
|
|
12
|
+
export * from './events/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for the notification plugin
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Position of the notification container in the UI
|
|
6
|
+
*/
|
|
7
|
+
export type NotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the notification plugin
|
|
10
|
+
*/
|
|
11
|
+
export interface NotificationPluginConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of notifications to keep in memory
|
|
14
|
+
* Older notifications will be automatically removed
|
|
15
|
+
* @default 50
|
|
16
|
+
*/
|
|
17
|
+
maxNotifications?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Default auto-dismiss duration in milliseconds
|
|
20
|
+
* Set to 0 to disable auto-dismiss by default
|
|
21
|
+
* @default 5000
|
|
22
|
+
*/
|
|
23
|
+
defaultDuration?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Position of the notification container in the UI
|
|
26
|
+
* @default 'top-right'
|
|
27
|
+
*/
|
|
28
|
+
position?: NotificationPosition;
|
|
29
|
+
/**
|
|
30
|
+
* Enable sound notifications
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
enableSound?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Enable persistence to localStorage
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
enablePersistence?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Key for localStorage persistence
|
|
41
|
+
* @default 'hamak:notifications'
|
|
42
|
+
*/
|
|
43
|
+
persistenceKey?: string;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=plugin-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-config.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
2
|
+
/**
|
|
3
|
+
* Type alias for notification plugin module
|
|
4
|
+
*
|
|
5
|
+
* Notification plugins follow the standard microkernel plugin lifecycle:
|
|
6
|
+
* - initialize: Register services, commands, and views
|
|
7
|
+
* - activate: Resolve dependencies and start functionality
|
|
8
|
+
* - deactivate: Cleanup (optional)
|
|
9
|
+
*/
|
|
10
|
+
export type NotificationPluginModule = PluginModule;
|
|
11
|
+
//# sourceMappingURL=plugin-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-module.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hamak/notification-spi",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Notification SPI - Service Provider Interfaces for notification plugin",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js",
|
|
13
|
+
"legacy": "./dist/es2015/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./es2015": {
|
|
16
|
+
"import": "./dist/es2015/index.js",
|
|
17
|
+
"default": "./dist/es2015/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/amah/app-framework.git",
|
|
26
|
+
"directory": "packages/notification/notification-spi"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc -p tsconfig.lib.json && tsc -p tsconfig.es2015.json",
|
|
33
|
+
"clean": "rm -rf dist"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"notification",
|
|
37
|
+
"spi",
|
|
38
|
+
"plugin",
|
|
39
|
+
"microkernel"
|
|
40
|
+
],
|
|
41
|
+
"author": "",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@hamak/notification-api": "0.4.0",
|
|
45
|
+
"@hamak/microkernel-spi": "0.4.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^3.2.4"
|
|
50
|
+
}
|
|
51
|
+
}
|