@nizza/core 0.5.0-beta.1 → 0.5.0-beta.11
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/environments/environment.local.d.ts +21 -1
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1350 -1569
- package/dist/index.mjs.map +1 -1
- package/dist/lib/nizza-store/NizzaStore.d.ts +11 -4
- package/dist/lib/nizza-store/NizzaStore.v2.d.ts +2 -0
- package/dist/lib/types/nizza/globalStore.d.ts +6 -9
- package/dist/lib/utils/logger.d.ts +4 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
1
|
+
import { Logger } from 'loglevel';
|
|
2
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
3
|
+
import { NizzaConfig, NizzaProductDataSource, NizzaState, NizzaStore } from '../types';
|
|
4
|
+
export declare const logger: Logger;
|
|
5
|
+
export declare const coreLogger: Logger;
|
|
6
|
+
export declare let nizza: NizzaStore;
|
|
7
|
+
export declare let useNizza: UseBoundStore<StoreApi<NizzaState>>;
|
|
8
|
+
export declare function nizzaInit(): NizzaStore;
|
|
9
|
+
export declare function getInstance(): NizzaStore;
|
|
10
|
+
export declare function configure(config: NizzaConfig): Promise<void>;
|
|
11
|
+
export declare function setProductDataSource(dataSource: NizzaProductDataSource): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
1
2
|
import { NizzaAccount } from '../../accounts';
|
|
2
3
|
import { BroadcastChannelEventBus } from '../../event-buses';
|
|
3
|
-
import {
|
|
4
|
+
import { NizzaLogger } from '../../utils';
|
|
4
5
|
import { NizzaProductDataSource } from './productDataSource';
|
|
5
6
|
export interface GlobalStoreConfig {
|
|
6
7
|
account: string;
|
|
@@ -8,19 +9,16 @@ export interface GlobalStoreConfig {
|
|
|
8
9
|
}
|
|
9
10
|
export interface GlobalState {
|
|
10
11
|
config: GlobalStoreConfig | null;
|
|
11
|
-
ok: boolean;
|
|
12
12
|
account?: any;
|
|
13
|
-
accountName?: string;
|
|
14
13
|
productDataSource?: any;
|
|
15
14
|
}
|
|
16
15
|
export interface GlobalStore {
|
|
17
16
|
version: string;
|
|
17
|
+
store: UseBoundStore<StoreApi<any>>;
|
|
18
18
|
instanceId: string;
|
|
19
|
-
|
|
20
|
-
log: Logger;
|
|
19
|
+
log: NizzaLogger;
|
|
21
20
|
eventBus: BroadcastChannelEventBus;
|
|
22
|
-
|
|
23
|
-
readonly productDataSource?: any;
|
|
21
|
+
state: GlobalState;
|
|
24
22
|
configure: (config: GlobalStoreConfig) => Promise<void>;
|
|
25
23
|
setProductDataSource: (dataSource: any) => void;
|
|
26
24
|
}
|
|
@@ -34,9 +32,8 @@ export interface NizzaState extends GlobalState {
|
|
|
34
32
|
productDataSource?: NizzaProductDataSource;
|
|
35
33
|
}
|
|
36
34
|
export interface NizzaStore extends GlobalStore {
|
|
35
|
+
store: UseBoundStore<StoreApi<NizzaState>>;
|
|
37
36
|
state: NizzaState;
|
|
38
37
|
configure: (config: NizzaConfig) => Promise<void>;
|
|
39
38
|
setProductDataSource: (dataSource: NizzaProductDataSource) => void;
|
|
40
|
-
readonly account?: NizzaAccount;
|
|
41
|
-
readonly productDataSource?: NizzaProductDataSource;
|
|
42
39
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Logger as LogLevelLogger } from 'loglevel';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class NizzaLogger {
|
|
3
|
+
private static instance;
|
|
3
4
|
private defaultLevel;
|
|
4
5
|
private namePrefix;
|
|
5
|
-
constructor(
|
|
6
|
+
private constructor();
|
|
7
|
+
static create(namePrefix?: string): NizzaLogger;
|
|
6
8
|
createLogger(context: string): LogLevelLogger;
|
|
7
9
|
}
|
package/dist/package.json
CHANGED