@nizza/core 0.4.5-alpha.5 → 0.4.5-alpha.6
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/lib/event-buses/BroadcastChannelEventBus.d.ts +1 -1
- package/dist/lib/nizza-store/ConfigManager.d.ts +3 -3
- package/dist/lib/nizza-store/NizzaStore.d.ts +1 -15
- package/dist/lib/nizza-store/NizzaStore.v1.d.ts +3 -3
- package/dist/lib/types/nizza/globalStore.d.ts +41 -0
- package/dist/lib/types/nizza/index.d.ts +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/types/nizza/nizzaGlobalObject.d.ts +0 -15
|
@@ -6,7 +6,7 @@ export declare class BroadcastChannelEventBus implements EventBus {
|
|
|
6
6
|
private channel;
|
|
7
7
|
private listeners;
|
|
8
8
|
private eventQueue;
|
|
9
|
-
constructor();
|
|
9
|
+
constructor(channelName: string);
|
|
10
10
|
/**
|
|
11
11
|
* Subscribe a listener function to a specific event with wildcards.
|
|
12
12
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NizzaAccount } from '../accounts';
|
|
2
|
-
import {
|
|
2
|
+
import { NizzaConfig } from '../types';
|
|
3
3
|
export declare class ConfigManager {
|
|
4
4
|
private _config;
|
|
5
5
|
private _account;
|
|
6
6
|
constructor();
|
|
7
|
-
configure(config:
|
|
8
|
-
get config():
|
|
7
|
+
configure(config: NizzaConfig): Promise<void>;
|
|
8
|
+
get config(): NizzaConfig | null;
|
|
9
9
|
get account(): NizzaAccount;
|
|
10
10
|
get ok(): boolean;
|
|
11
11
|
get accountName(): string;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NizzaConfiguration, NizzaProductDataSource, NizzaState } from '../types';
|
|
3
|
-
import { Logger } from '../utils/logger';
|
|
4
|
-
export type NizzaStore = ReturnType<typeof createStore>;
|
|
5
|
-
declare const createStore: () => {
|
|
6
|
-
state: NizzaState;
|
|
7
|
-
configure: (config: NizzaConfiguration) => Promise<void>;
|
|
8
|
-
setProductDataSource: (dataSource: NizzaProductDataSource) => void;
|
|
9
|
-
instanceId: string;
|
|
10
|
-
log: Logger;
|
|
11
|
-
eventBus: BroadcastChannelEventBus;
|
|
12
|
-
readonly account: import("../accounts").NizzaAccount | undefined;
|
|
13
|
-
readonly productDataSource: NizzaProductDataSource | undefined;
|
|
14
|
-
};
|
|
1
|
+
import { NizzaStore } from '../types';
|
|
15
2
|
export declare const nizza: NizzaStore;
|
|
16
3
|
export declare const logger: import("loglevel").Logger;
|
|
17
4
|
export declare const coreLogger: import("loglevel").Logger;
|
|
18
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import log from 'loglevel';
|
|
2
|
-
import {
|
|
2
|
+
import { NizzaConfig, NizzaProductDataSource } from '../types';
|
|
3
3
|
import { BroadcastChannelEventBus } from '../event-buses';
|
|
4
4
|
export declare class NizzaStore {
|
|
5
5
|
private static _instance;
|
|
@@ -10,8 +10,8 @@ export declare class NizzaStore {
|
|
|
10
10
|
readonly log: log.RootLogger;
|
|
11
11
|
private constructor();
|
|
12
12
|
static instance(): NizzaStore;
|
|
13
|
-
configure(config:
|
|
14
|
-
get config():
|
|
13
|
+
configure(config: NizzaConfig): Promise<this>;
|
|
14
|
+
get config(): NizzaConfig | null;
|
|
15
15
|
get account(): import("..").NizzaAccount;
|
|
16
16
|
get ok(): boolean;
|
|
17
17
|
get accountName(): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { NizzaAccount } from '../../accounts';
|
|
2
|
+
import { BroadcastChannelEventBus } from '../../event-buses';
|
|
3
|
+
import { Logger } from '../../utils';
|
|
4
|
+
import { NizzaProductDataSource } from './productDataSource';
|
|
5
|
+
export interface GlobalStoreConfig {
|
|
6
|
+
account: string;
|
|
7
|
+
getProductDataSource?: () => Promise<any> | any;
|
|
8
|
+
}
|
|
9
|
+
export interface GlobalState {
|
|
10
|
+
config: GlobalStoreConfig | null;
|
|
11
|
+
ok: boolean;
|
|
12
|
+
account?: any;
|
|
13
|
+
accountName?: string;
|
|
14
|
+
productDataSource?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface GlobalStore {
|
|
17
|
+
state: GlobalState;
|
|
18
|
+
instanceId: string;
|
|
19
|
+
log: Logger;
|
|
20
|
+
eventBus: BroadcastChannelEventBus;
|
|
21
|
+
readonly account?: any;
|
|
22
|
+
readonly productDataSource?: any;
|
|
23
|
+
configure: (config: GlobalStoreConfig) => Promise<void>;
|
|
24
|
+
setProductDataSource: (dataSource: any) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface NizzaConfig extends GlobalStoreConfig {
|
|
27
|
+
account: string;
|
|
28
|
+
getProductDataSource?: () => Promise<NizzaProductDataSource> | NizzaProductDataSource;
|
|
29
|
+
}
|
|
30
|
+
export interface NizzaState extends GlobalState {
|
|
31
|
+
config: NizzaConfig | null;
|
|
32
|
+
account?: NizzaAccount;
|
|
33
|
+
productDataSource?: NizzaProductDataSource;
|
|
34
|
+
}
|
|
35
|
+
export interface NizzaStore extends GlobalStore {
|
|
36
|
+
state: NizzaState;
|
|
37
|
+
configure: (config: NizzaConfig) => Promise<void>;
|
|
38
|
+
setProductDataSource: (dataSource: NizzaProductDataSource) => void;
|
|
39
|
+
readonly account?: NizzaAccount;
|
|
40
|
+
readonly productDataSource?: NizzaProductDataSource;
|
|
41
|
+
}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NizzaAccount } from '../../accounts';
|
|
2
|
-
import { NizzaProductDataSource } from './productDataSource';
|
|
3
|
-
export type NizzaState = {
|
|
4
|
-
config: NizzaConfiguration | null;
|
|
5
|
-
ok: boolean;
|
|
6
|
-
account?: NizzaAccount;
|
|
7
|
-
accountName?: string;
|
|
8
|
-
productDataSource?: NizzaProductDataSource;
|
|
9
|
-
};
|
|
10
|
-
export interface NizzaConfiguration {
|
|
11
|
-
account: string;
|
|
12
|
-
getProductDataSource?: () => Promise<NizzaProductDataSource> | NizzaProductDataSource;
|
|
13
|
-
}
|
|
14
|
-
export interface NizzaCredentials {
|
|
15
|
-
}
|