@tramvai/tokens-common 2.40.0 → 2.45.0
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/lib/action.d.ts +2 -2
- package/lib/cache.d.ts +2 -2
- package/lib/hook.d.ts +1 -1
- package/lib/logger.d.ts +3 -3
- package/package.json +4 -4
package/lib/action.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const ACTION_PAGE_RUNNER_TOKEN: import("@tinkoff/dippy").BaseToke
|
|
|
21
21
|
* Conditions that specify should action be executing or not
|
|
22
22
|
*/
|
|
23
23
|
export declare const ACTION_CONDITIONALS: import("@tinkoff/dippy").MultiTokenInterface<ActionCondition | ActionCondition[]>;
|
|
24
|
-
|
|
24
|
+
type AnyAction = Action | TramvaiAction<any, any, any>;
|
|
25
25
|
export interface ActionsRegistry {
|
|
26
26
|
add(type: string, actions: AnyAction | TramvaiAction<any[], any, any> | (AnyAction | TramvaiAction<any[], any, any>)[]): void;
|
|
27
27
|
get(type: string, addingActions?: (AnyAction | TramvaiAction<any[], any, any>)[]): (AnyAction | TramvaiAction<any[], any, any>)[];
|
|
@@ -48,7 +48,7 @@ export interface ActionConditionChecker<State = any> {
|
|
|
48
48
|
getState(): State;
|
|
49
49
|
forbid(): void;
|
|
50
50
|
}
|
|
51
|
-
export
|
|
51
|
+
export type ActionCondition = {
|
|
52
52
|
key: string;
|
|
53
53
|
fn: (checker: ActionConditionChecker) => void;
|
|
54
54
|
};
|
package/lib/cache.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export interface Cache<T = any> {
|
|
|
22
22
|
has(key: string): boolean;
|
|
23
23
|
clear(): void;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type CacheType = 'memory';
|
|
26
26
|
export interface CacheOptionsByType<T> {
|
|
27
27
|
memory: [Options<string, T>] | [];
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type CacheFactory = <T, Type extends CacheType = 'memory'>(type?: Type, ...args: CacheOptionsByType<T>[Type]) => Cache<T>;
|
package/lib/hook.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* [Hooks documentation](https://tramvai.dev/docs/references/libs/hooks)
|
|
4
4
|
*/
|
|
5
5
|
export declare const HOOK_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<Hooks>;
|
|
6
|
-
|
|
6
|
+
type Hook<TPayload> = (context: any, payload?: TPayload, options?: any) => TPayload;
|
|
7
7
|
export interface Hooks {
|
|
8
8
|
/**
|
|
9
9
|
* Register hooks
|
package/lib/logger.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ export declare const LOGGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<L
|
|
|
9
9
|
* Hook to be able to modify logger on initialization
|
|
10
10
|
*/
|
|
11
11
|
export declare const LOGGER_INIT_HOOK: import("@tinkoff/dippy").BaseTokenInterface<LoggerInitHook>;
|
|
12
|
-
|
|
12
|
+
type Config = {
|
|
13
13
|
name: string;
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
|
|
16
|
+
export type LoggerFactory = Logger & ((configOrName: string | Config) => Logger);
|
|
17
|
+
type LoggerInitHook = (logger: LoggerFactory) => void;
|
|
18
18
|
export type { Logger, LogFn, LogArg } from '@tinkoff/logger';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-common",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@tinkoff/lru-cache-nano": "^7.8.1",
|
|
23
23
|
"@tinkoff/url": "0.8.4",
|
|
24
|
-
"@tramvai/react": "2.
|
|
25
|
-
"@tramvai/tokens-core": "2.
|
|
24
|
+
"@tramvai/react": "2.45.0",
|
|
25
|
+
"@tramvai/tokens-core": "2.45.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@tinkoff/dippy": "0.8.9",
|
|
29
29
|
"@tinkoff/logger": "0.10.54",
|
|
30
|
-
"@tramvai/types-actions-state-context": "2.
|
|
30
|
+
"@tramvai/types-actions-state-context": "2.45.0",
|
|
31
31
|
"react": ">=16.8",
|
|
32
32
|
"tslib": "^2.4.0"
|
|
33
33
|
},
|