@nizza/core 0.5.3 → 0.5.5
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 +1355 -1350
- package/dist/lib/event-buses/BroadcastChannelEventBus.d.ts +3 -1
- package/dist/lib/nizza-store/NizzaStore.d.ts +3 -5
- package/dist/lib/nizza-store/index.d.ts +1 -1
- package/dist/lib/nizza-store/{useNizza.d.ts → react-hooks.d.ts} +1 -0
- package/dist/lib/types/nizza/chat.d.ts +1 -0
- package/dist/lib/utils/createLazyLogger.d.ts +10 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/logger.d.ts +1 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/nizza-store/NizzaStore.v1.d.ts +0 -22
- package/dist/lib/nizza-store/NizzaStore.v2.d.ts +0 -4
- package/dist/lib/nizza-store/NizzaStore.v3.d.ts +0 -7
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { Logger } from 'loglevel';
|
|
1
2
|
import { Attributes, EventBus, EventBusListener, EventBusSubscription } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Implementation of EventBus using BroadcastChannel for cross-window communication.
|
|
4
5
|
*/
|
|
5
6
|
export declare class BroadcastChannelEventBus implements EventBus {
|
|
7
|
+
private logger;
|
|
6
8
|
private channel;
|
|
7
9
|
private listeners;
|
|
8
10
|
private eventQueue;
|
|
9
|
-
constructor(channelName: string);
|
|
11
|
+
constructor(channelName: string, logger: Logger);
|
|
10
12
|
/**
|
|
11
13
|
* Subscribe a listener function to a specific event with wildcards.
|
|
12
14
|
*
|
|
@@ -3,17 +3,17 @@ import { BroadcastChannelEventBus } from '../event-buses';
|
|
|
3
3
|
import { NizzaStore as INizzaStore, NizzaConfig, NizzaProductDataSource } from '../types';
|
|
4
4
|
import { Logger } from '../utils/logger';
|
|
5
5
|
export declare class NizzaStore implements INizzaStore {
|
|
6
|
-
static readonly version = "
|
|
6
|
+
static readonly version = "4";
|
|
7
7
|
private static _instance;
|
|
8
8
|
readonly instanceId: string;
|
|
9
|
+
readonly log: Logger;
|
|
10
|
+
readonly coreLogger: import("loglevel").Logger;
|
|
9
11
|
private _config;
|
|
10
12
|
private _account?;
|
|
11
13
|
private _productDataSource;
|
|
12
14
|
private _eventBus;
|
|
13
|
-
readonly log: Logger;
|
|
14
15
|
private constructor();
|
|
15
16
|
static instance(): NizzaStore;
|
|
16
|
-
private migrateFrom;
|
|
17
17
|
configure(config: NizzaConfig): Promise<void>;
|
|
18
18
|
private setAccount;
|
|
19
19
|
setProductDataSource(dataSource: NizzaProductDataSource): void;
|
|
@@ -25,5 +25,3 @@ export declare class NizzaStore implements INizzaStore {
|
|
|
25
25
|
get eventBus(): BroadcastChannelEventBus;
|
|
26
26
|
}
|
|
27
27
|
export declare const getNizza: () => NizzaStore;
|
|
28
|
-
export declare const logger: import("loglevel").Logger;
|
|
29
|
-
export declare const coreLogger: import("loglevel").Logger;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Logger as LogLevelLogger } from 'loglevel';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a lazily instantiated logger using Nizza's logging system. The actual logger
|
|
4
|
+
* is only created and registered the first time one of its methods is invoked. This lazy
|
|
5
|
+
* instantiation ensures efficient resource utilization by only initializing loggers when necessary.
|
|
6
|
+
*
|
|
7
|
+
* @param name The name of the logger, used for identification and filtering purposes.
|
|
8
|
+
* @returns A proxy to the lazily instantiated logger.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createLazyLogger(name: string): LogLevelLogger;
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import log from 'loglevel';
|
|
2
|
-
import { NizzaConfig, NizzaProductDataSource } from '../types';
|
|
3
|
-
import { BroadcastChannelEventBus } from '../event-buses';
|
|
4
|
-
export declare class NizzaStore {
|
|
5
|
-
private static _instance;
|
|
6
|
-
private _productDataSource;
|
|
7
|
-
private _configManager;
|
|
8
|
-
private _eventBus;
|
|
9
|
-
readonly instanceId: string;
|
|
10
|
-
readonly log: log.RootLogger;
|
|
11
|
-
private constructor();
|
|
12
|
-
static instance(): NizzaStore;
|
|
13
|
-
configure(config: NizzaConfig): Promise<this>;
|
|
14
|
-
get config(): NizzaConfig | null;
|
|
15
|
-
get account(): import("..").NizzaAccount;
|
|
16
|
-
get ok(): boolean;
|
|
17
|
-
get accountName(): string;
|
|
18
|
-
get productDataSource(): NizzaProductDataSource | null;
|
|
19
|
-
get eventBus(): BroadcastChannelEventBus;
|
|
20
|
-
setProductDataSource(dataSource: NizzaProductDataSource): void;
|
|
21
|
-
}
|
|
22
|
-
export declare const nizza: NizzaStore;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { NizzaConfig, NizzaProductDataSource, NizzaStore } from '../types';
|
|
2
|
-
export declare const configure: (config: NizzaConfig) => Promise<void>;
|
|
3
|
-
export declare const setProductDataSource: (dataSource: NizzaProductDataSource) => void;
|
|
4
|
-
export declare const nizza: import("./NizzaStore").NizzaStore | NizzaStore;
|
|
5
|
-
export declare const useNizza: any;
|
|
6
|
-
export declare const logger: any;
|
|
7
|
-
export declare const coreLogger: any;
|