@nizza/core 0.4.0-alpha.1 → 0.4.0-alpha.2
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 +6 -6
- package/dist/index.mjs +324 -319
- package/dist/lib/constants/event.d.ts +6 -0
- package/dist/lib/constants/eventBus.d.ts +34 -0
- package/dist/lib/constants/index.d.ts +2 -1
- package/dist/lib/nizza-store/DefaultEventBus.d.ts +2 -2
- package/dist/lib/types/nizza/eventBus.d.ts +4 -4
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/constants/eventBusWildcards.d.ts +0 -16
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of common event wildcards used in the EventBus.
|
|
3
|
+
* This enumeration provides predefined wildcards for different
|
|
4
|
+
* event categories, facilitating event subscription and management.
|
|
5
|
+
*
|
|
6
|
+
* Each wildcard represents a specific category or group of events
|
|
7
|
+
* in the EventBus and is used as a pattern to match multiple events.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare const EventBusWildcards: {
|
|
11
|
+
ALL: string;
|
|
12
|
+
CORE: string;
|
|
13
|
+
LIVE_STREAMING_EVENT: string;
|
|
14
|
+
EVENT_CHAT: string;
|
|
15
|
+
EVENT_PRODUCTS: string;
|
|
16
|
+
CUSTOMIZE_LIVE: string;
|
|
17
|
+
PLAYER: string;
|
|
18
|
+
SNACK_SIZE_VIDEO: string;
|
|
19
|
+
SNACK_SIZE_VIDEO_ADMIN: string;
|
|
20
|
+
UI: string;
|
|
21
|
+
UTILS: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Enumeration that defines the names of events used in the application.
|
|
25
|
+
* This enumeration provides a list of event names used throughout
|
|
26
|
+
* the application to facilitate event communication and management.
|
|
27
|
+
*
|
|
28
|
+
* Each event name should be unique and represent a specific action that
|
|
29
|
+
* has occurred in the application.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export declare const EventNames: {
|
|
33
|
+
EVENT_STATUS_CHANGED: string;
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EventBus,
|
|
1
|
+
import { EventBus, EventBusListener, EventBusSubscription } from '../types';
|
|
2
2
|
export declare class DefaultEventBus implements EventBus {
|
|
3
3
|
private emitter;
|
|
4
4
|
constructor();
|
|
5
|
-
on(event: string, listener:
|
|
5
|
+
on(event: string, listener: EventBusListener): EventBusSubscription;
|
|
6
6
|
emit(event: string, data: any): void;
|
|
7
7
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface EventBusPayload {
|
|
2
2
|
name: string;
|
|
3
3
|
wildcard: string;
|
|
4
4
|
data: any;
|
|
5
5
|
attrs: Record<string, any>;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface EventBusSubscription {
|
|
8
8
|
off: () => void;
|
|
9
9
|
event: string;
|
|
10
10
|
}
|
|
11
|
-
export type
|
|
11
|
+
export type EventBusListener = (event: EventBusPayload) => void;
|
|
12
12
|
export interface EventBus {
|
|
13
|
-
on(event: string, listener:
|
|
13
|
+
on(event: string, listener: EventBusListener): EventBusSubscription;
|
|
14
14
|
emit(event: string, data: any): void;
|
|
15
15
|
}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enumeration of common shortcuts for event wildcards.
|
|
3
|
-
*/
|
|
4
|
-
export declare const EventBusWildcards: {
|
|
5
|
-
ALL: string;
|
|
6
|
-
CORE: string;
|
|
7
|
-
CUSTOMIZE_LIVE: string;
|
|
8
|
-
EVENT_CHAT: string;
|
|
9
|
-
EVENT_PRODUCTS: string;
|
|
10
|
-
LIVE_STREAMING_EVENT: string;
|
|
11
|
-
PLAYER: string;
|
|
12
|
-
SNACK_SIZE_VIDEO: string;
|
|
13
|
-
SNACK_SIZE_VIDEO_ADMIN: string;
|
|
14
|
-
UI: string;
|
|
15
|
-
UTILS: string;
|
|
16
|
-
};
|