@nanostores/logger 0.2.2 → 0.2.3
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.
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import type { AnyStore, MapStore } from 'nanostores'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
LoggerOptions,
|
|
5
|
-
LoggerOptionsMessages
|
|
6
|
-
} from '../build-logger/index.js'
|
|
7
|
-
|
|
8
|
-
interface CreatorLoggerOptionsMessages extends LoggerOptionsMessages {
|
|
3
|
+
interface CreatorLoggerOptionsMessages {
|
|
9
4
|
/**
|
|
10
5
|
* Disable build logs.
|
|
11
6
|
*/
|
|
12
7
|
build?: boolean
|
|
13
8
|
}
|
|
14
9
|
|
|
15
|
-
export interface CreatorLoggerOptions
|
|
10
|
+
export interface CreatorLoggerOptions {
|
|
16
11
|
messages?: CreatorLoggerOptionsMessages
|
|
17
12
|
|
|
18
13
|
/**
|
|
@@ -22,7 +17,7 @@ export interface CreatorLoggerOptions extends LoggerOptions {
|
|
|
22
17
|
* @param store Store built by the creator.
|
|
23
18
|
* @returns Custom store name.
|
|
24
19
|
*/
|
|
25
|
-
nameGetter
|
|
20
|
+
nameGetter?: (creatorName: string, store: MapStore) => string
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
interface EventBuildStartPayload {
|
|
@@ -32,7 +27,7 @@ interface EventBuildStartPayload {
|
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
interface BuildCreatorLoggerEvents {
|
|
35
|
-
build
|
|
30
|
+
build: (payload: EventBuildPayloadBase) => void
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
/**
|
|
@@ -58,5 +53,5 @@ export function buildCreatorLogger(
|
|
|
58
53
|
store: AnyStore,
|
|
59
54
|
storeName: string,
|
|
60
55
|
events: BuildCreatorLoggerEvents,
|
|
61
|
-
opts?:
|
|
56
|
+
opts?: CreatorLoggerOptions
|
|
62
57
|
): () => void
|
package/build-logger/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MapCreator } from 'nanostores'
|
|
2
2
|
|
|
3
3
|
import type { CreatorLoggerOptions } from '../build-creator-logger/index.js'
|
|
4
|
+
import type { LoggerOptions } from '../build-logger/index.js'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Displays Nano Stores events in browser console.
|
|
@@ -10,5 +11,5 @@ import type { CreatorLoggerOptions } from '../build-creator-logger/index.js'
|
|
|
10
11
|
*/
|
|
11
12
|
export function creatorLogger(
|
|
12
13
|
creators: { [key: string]: MapCreator },
|
|
13
|
-
opts?: CreatorLoggerOptions
|
|
14
|
+
opts?: CreatorLoggerOptions & LoggerOptions
|
|
14
15
|
): () => void
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
buildCreatorLogger,
|
|
3
|
+
CreatorLoggerOptions
|
|
4
|
+
} from './build-creator-logger/index.js'
|
|
5
|
+
export { buildLogger, LoggerOptions } from './build-logger/index.js'
|
|
3
6
|
export { creatorLogger } from './creator-logger/index.js'
|
|
4
7
|
export { logger } from './logger/index.js'
|
|
5
8
|
export { group, groupEnd, log } from './printer/index.js'
|