@nizza/core 0.4.0-alpha.0 → 0.4.0-alpha.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.cjs +11 -5
- package/dist/index.mjs +3635 -2827
- package/dist/lib/constants/eventBusWildcards.d.ts +16 -0
- package/dist/lib/constants/index.d.ts +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/mobx/index.d.ts +0 -1
- package/dist/lib/nizza-store/ConfigManager.d.ts +13 -0
- package/dist/lib/nizza-store/DefaultEventBus.d.ts +7 -0
- package/dist/lib/{mobx → nizza-store}/NizzaStore.d.ts +6 -6
- package/dist/lib/nizza-store/helpers.d.ts +1 -0
- package/dist/lib/nizza-store/index.d.ts +1 -0
- package/dist/lib/types/nizza/eventBus.d.ts +15 -0
- package/dist/lib/types/nizza/index.d.ts +1 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/mobx/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NizzaAccount } from '../accounts';
|
|
2
|
+
import { NizzaConfiguration } from '../types';
|
|
3
|
+
export declare class ConfigManager {
|
|
4
|
+
private _config;
|
|
5
|
+
private _account;
|
|
6
|
+
constructor();
|
|
7
|
+
configure(config: NizzaConfiguration): Promise<void>;
|
|
8
|
+
get config(): NizzaConfiguration | null;
|
|
9
|
+
get account(): NizzaAccount;
|
|
10
|
+
get ok(): boolean;
|
|
11
|
+
get accountName(): string;
|
|
12
|
+
setAccount(account: NizzaAccount): void;
|
|
13
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { NizzaAccount } from '../accounts';
|
|
2
1
|
import { NizzaConfiguration, NizzaProductDataSource } from '../types';
|
|
2
|
+
import { DefaultEventBus } from './DefaultEventBus';
|
|
3
3
|
export declare class NizzaStore {
|
|
4
4
|
private static _instance;
|
|
5
|
-
private _config;
|
|
6
|
-
private _account;
|
|
7
5
|
private _productDataSource;
|
|
6
|
+
private _configManager;
|
|
7
|
+
private _eventBus;
|
|
8
8
|
readonly instanceId: string;
|
|
9
9
|
private constructor();
|
|
10
10
|
static instance(): NizzaStore;
|
|
11
11
|
configure(config: NizzaConfiguration): Promise<this>;
|
|
12
|
-
get
|
|
12
|
+
get config(): NizzaConfiguration | null;
|
|
13
|
+
get account(): import("..").NizzaAccount;
|
|
13
14
|
get ok(): boolean;
|
|
14
15
|
get accountName(): string;
|
|
15
16
|
get productDataSource(): NizzaProductDataSource | null;
|
|
16
|
-
get
|
|
17
|
+
get eventBus(): DefaultEventBus;
|
|
17
18
|
setProductDataSource(dataSource: NizzaProductDataSource): void;
|
|
18
|
-
private validateRequiredProps;
|
|
19
19
|
}
|
|
20
20
|
export declare const nizza: NizzaStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateRequiredProps(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NizzaStore';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface EBPayload {
|
|
2
|
+
name: string;
|
|
3
|
+
wildcard: string;
|
|
4
|
+
data: any;
|
|
5
|
+
attrs: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
export interface EBSubscription {
|
|
8
|
+
off: () => void;
|
|
9
|
+
event: string;
|
|
10
|
+
}
|
|
11
|
+
export type EBListener = (event: EBPayload) => void;
|
|
12
|
+
export interface EventBus {
|
|
13
|
+
on(event: string, listener: EBListener): EBSubscription;
|
|
14
|
+
emit(event: string, data: any): void;
|
|
15
|
+
}
|
package/dist/package.json
CHANGED