@tramvai/tokens-common 2.6.2 → 2.10.2
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 +17 -11
- package/lib/bundle.d.ts +2 -2
- package/lib/cache.d.ts +3 -3
- package/lib/componentRegistry.d.ts +1 -1
- package/lib/context.d.ts +1 -1
- package/lib/env.d.ts +2 -2
- package/lib/execution.d.ts +20 -0
- package/lib/hook.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +5 -1
- package/lib/index.js +7 -0
- package/lib/logger.d.ts +2 -2
- package/lib/pubsub.d.ts +3 -3
- package/lib/requestManager.d.ts +3 -3
- package/lib/responseManager.d.ts +3 -3
- package/lib/state.d.ts +5 -5
- package/package.json +5 -6
package/lib/action.d.ts
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
import type { Action } from '@tramvai/tokens-core';
|
|
2
|
+
import type { TramvaiAction } from '@tramvai/types-actions-state-context';
|
|
3
|
+
import type { ExecutionContext } from './execution';
|
|
2
4
|
/**
|
|
3
5
|
* @description
|
|
4
6
|
* Registry for storing actions based on their type
|
|
5
7
|
*/
|
|
6
|
-
export declare const ACTION_REGISTRY_TOKEN: import("@tinkoff/dippy
|
|
8
|
+
export declare const ACTION_REGISTRY_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ActionsRegistry>;
|
|
7
9
|
/**
|
|
8
10
|
* @description
|
|
9
11
|
* Instance that executes actions
|
|
10
12
|
*/
|
|
11
|
-
export declare const ACTION_EXECUTION_TOKEN: import("@tinkoff/dippy
|
|
13
|
+
export declare const ACTION_EXECUTION_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ActionExecution>;
|
|
12
14
|
/**
|
|
13
15
|
* @description
|
|
14
16
|
* Instance that executes actions on navigations
|
|
15
17
|
*/
|
|
16
|
-
export declare const ACTION_PAGE_RUNNER_TOKEN: import("@tinkoff/dippy
|
|
18
|
+
export declare const ACTION_PAGE_RUNNER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ActionPageRunner>;
|
|
17
19
|
/**
|
|
18
20
|
* @description
|
|
19
21
|
* Conditions that specify should action be executing or not
|
|
20
22
|
*/
|
|
21
|
-
export declare const ACTION_CONDITIONALS: import("@tinkoff/dippy
|
|
23
|
+
export declare const ACTION_CONDITIONALS: import("@tinkoff/dippy").MultiTokenInterface<ActionCondition | ActionCondition[]>;
|
|
24
|
+
declare type AnyAction = Action | TramvaiAction<any, any, any>;
|
|
22
25
|
export interface ActionsRegistry {
|
|
23
|
-
add(type: string, actions:
|
|
24
|
-
get(type: string, addingActions?:
|
|
25
|
-
getGlobal():
|
|
26
|
-
remove(type: string, actions?:
|
|
26
|
+
add(type: string, actions: AnyAction | TramvaiAction<any[], any, any> | (AnyAction | TramvaiAction<any[], any, any>)[]): void;
|
|
27
|
+
get(type: string, addingActions?: (AnyAction | TramvaiAction<any[], any, any>)[]): (AnyAction | TramvaiAction<any[], any, any>)[];
|
|
28
|
+
getGlobal(): (AnyAction | TramvaiAction<any[], any, any>)[];
|
|
29
|
+
remove(type: string, actions?: AnyAction | TramvaiAction<any[], any, any> | (AnyAction | TramvaiAction<any[], any, any>)[]): void;
|
|
27
30
|
}
|
|
28
31
|
export interface ActionExecution {
|
|
29
|
-
|
|
30
|
-
run(action: Action, payload:
|
|
32
|
+
run<Params extends any[], Result, Deps>(action: TramvaiAction<Params, Result, Deps>, ...params: Params): Result extends Promise<any> ? Result : Promise<Result>;
|
|
33
|
+
run<Payload, Result, Deps>(action: Action<Payload, Result, Deps>, payload: Payload): Result extends Promise<any> ? Result : Promise<Result>;
|
|
34
|
+
runInContext<Params extends any[], Result, Deps>(context: ExecutionContext | null, action: TramvaiAction<Params, Result, Deps>, ...params: Params): Result extends Promise<any> ? Result : Promise<Result>;
|
|
35
|
+
runInContext<Payload, Result, Deps>(context: ExecutionContext | null, action: Action<Payload, Result, Deps>, payload: Payload): Result extends Promise<any> ? Result : Promise<Result>;
|
|
31
36
|
}
|
|
32
37
|
export interface ActionPageRunner {
|
|
33
|
-
runActions(actions: Action[], stopRunAtError?: (error: Error) => boolean): Promise<any>;
|
|
38
|
+
runActions(actions: (Action | TramvaiAction<any, any, any>)[], stopRunAtError?: (error: Error) => boolean): Promise<any>;
|
|
34
39
|
}
|
|
35
40
|
export interface ActionConditionChecker<State = any> {
|
|
36
41
|
payload: any;
|
|
@@ -46,3 +51,4 @@ export declare type ActionCondition = {
|
|
|
46
51
|
key: string;
|
|
47
52
|
fn: (checker: ActionConditionChecker) => void;
|
|
48
53
|
};
|
|
54
|
+
export {};
|
package/lib/bundle.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import type { Bundle } from '@tramvai/tokens-core';
|
|
|
3
3
|
* @description
|
|
4
4
|
* Bundle Storage. When getting bundle additionally adds actions and components from bundle to according storages
|
|
5
5
|
*/
|
|
6
|
-
export declare const BUNDLE_MANAGER_TOKEN: import("@tinkoff/dippy
|
|
6
|
+
export declare const BUNDLE_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<BundleManager>;
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
9
|
* Provides additional bundles to the app.
|
|
10
10
|
* Important! This token doesn't overrides already existing bundles.
|
|
11
11
|
*/
|
|
12
|
-
export declare const ADDITIONAL_BUNDLE_TOKEN: import("@tinkoff/dippy
|
|
12
|
+
export declare const ADDITIONAL_BUNDLE_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<{
|
|
13
13
|
[key: string]: Bundle;
|
|
14
14
|
}>;
|
|
15
15
|
export interface BundleManager {
|
package/lib/cache.d.ts
CHANGED
|
@@ -5,17 +5,17 @@ import type { Options } from '@tinkoff/lru-cache-nano';
|
|
|
5
5
|
*
|
|
6
6
|
* *Note*: currently only memory cache with `@tinkoff/lru-cache-nano` is supported
|
|
7
7
|
*/
|
|
8
|
-
export declare const CREATE_CACHE_TOKEN: import("@tinkoff/dippy
|
|
8
|
+
export declare const CREATE_CACHE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<CacheFactory>;
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* Function that us called on force cache clean up in the app
|
|
12
12
|
*/
|
|
13
|
-
export declare const REGISTER_CLEAR_CACHE_TOKEN: import("@tinkoff/dippy
|
|
13
|
+
export declare const REGISTER_CLEAR_CACHE_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<(type: string) => void | Promise<void>>;
|
|
14
14
|
/**
|
|
15
15
|
* @description
|
|
16
16
|
* Force cleaning up all caches in the app
|
|
17
17
|
*/
|
|
18
|
-
export declare const CLEAR_CACHE_TOKEN: import("@tinkoff/dippy
|
|
18
|
+
export declare const CLEAR_CACHE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<(type?: string | undefined) => Promise<void>>;
|
|
19
19
|
export interface Cache<T = any> {
|
|
20
20
|
get(key: string): T;
|
|
21
21
|
set(key: string, value: T): void;
|
|
@@ -11,7 +11,7 @@ export declare type Component = ComponentType & RegistryComponentExtend;
|
|
|
11
11
|
* Components in the repository are divided into groups, e.g. you can specify a bundle or a page component as a group key.
|
|
12
12
|
* The entity also allows you to get static component parameters through the `getComponentParam` method (will not work with `lazy` components)
|
|
13
13
|
*/
|
|
14
|
-
export declare const COMPONENT_REGISTRY_TOKEN: import("@tinkoff/dippy
|
|
14
|
+
export declare const COMPONENT_REGISTRY_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ComponentRegistry>;
|
|
15
15
|
export interface ComponentRegistry {
|
|
16
16
|
components: Record<string, Component>;
|
|
17
17
|
add(name: string, component: Component, group?: string): void;
|
package/lib/context.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { PlatformAction } from '@tramvai/types-actions-state-context';
|
|
|
6
6
|
* @description
|
|
7
7
|
* Context implementation
|
|
8
8
|
*/
|
|
9
|
-
export declare const CONTEXT_TOKEN: import("@tinkoff/dippy
|
|
9
|
+
export declare const CONTEXT_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ConsumerContext>;
|
|
10
10
|
export interface ConsumerContext extends BaseConsumerContext {
|
|
11
11
|
readonly di: Container;
|
|
12
12
|
readonly pubsub: typeof PUBSUB_TOKEN;
|
package/lib/env.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface EnvironmentManager {
|
|
|
10
10
|
* @description
|
|
11
11
|
* Instance that used for managing env data on the server and on the client
|
|
12
12
|
*/
|
|
13
|
-
export declare const ENV_MANAGER_TOKEN: import("@tinkoff/dippy
|
|
13
|
+
export declare const ENV_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<EnvironmentManager>;
|
|
14
14
|
/**
|
|
15
15
|
* @description
|
|
16
16
|
* List of envs that are used by the module or the app.
|
|
@@ -40,4 +40,4 @@ export interface EnvParameter {
|
|
|
40
40
|
validator?: (value: string) => boolean | string;
|
|
41
41
|
dehydrate?: boolean;
|
|
42
42
|
}
|
|
43
|
-
export declare const ENV_USED_TOKEN: import("@tinkoff/dippy
|
|
43
|
+
export declare const ENV_USED_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<EnvParameter[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ExecutionContextValues {
|
|
2
|
+
[key: string]: any | undefined;
|
|
3
|
+
}
|
|
4
|
+
export interface ExecutionContext {
|
|
5
|
+
name: string;
|
|
6
|
+
abortSignal: AbortSignal;
|
|
7
|
+
values: ExecutionContextValues;
|
|
8
|
+
}
|
|
9
|
+
export interface ExecutionContextOptions {
|
|
10
|
+
name: string;
|
|
11
|
+
values?: ExecutionContextValues;
|
|
12
|
+
}
|
|
13
|
+
export interface ExecutionContextManager {
|
|
14
|
+
withContext<T>(parentContext: ExecutionContext, nameOrOptions: string | ExecutionContextOptions, cb: (context: ExecutionContext, abortController: AbortController) => Promise<T>): Promise<T>;
|
|
15
|
+
}
|
|
16
|
+
export declare const EXECUTION_CONTEXT_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ExecutionContextManager>;
|
|
17
|
+
export declare const ROOT_EXECUTION_CONTEXT_TOKEN: ExecutionContext & {
|
|
18
|
+
__type?: "base token" | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<() => ExecutionContext | null>;
|
package/lib/hook.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description
|
|
3
3
|
* [Hooks documentation](https://tramvai.dev/docs/references/libs/hooks)
|
|
4
4
|
*/
|
|
5
|
-
export declare const HOOK_TOKEN: import("@tinkoff/dippy
|
|
5
|
+
export declare const HOOK_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<Hooks>;
|
|
6
6
|
declare type Hook<TPayload> = (context: any, payload?: TPayload, options?: any) => TPayload;
|
|
7
7
|
export interface Hooks {
|
|
8
8
|
/**
|
package/lib/index.d.ts
CHANGED
package/lib/index.es.js
CHANGED
|
@@ -173,4 +173,8 @@ const RESPONSE_MANAGER_TOKEN = createToken('responseManager');
|
|
|
173
173
|
const ENV_MANAGER_TOKEN = createToken('environmentManager');
|
|
174
174
|
const ENV_USED_TOKEN = createToken('envUsed', { multi: true });
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
const EXECUTION_CONTEXT_MANAGER_TOKEN = createToken('common ExecutionContextManager');
|
|
177
|
+
const ROOT_EXECUTION_CONTEXT_TOKEN = createToken('common rootExecutionContext');
|
|
178
|
+
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = createToken('common commandLineExecutionContext');
|
|
179
|
+
|
|
180
|
+
export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN, CLEAR_CACHE_TOKEN, COMBINE_REDUCERS, COMMAND_LINE_EXECUTION_CONTEXT_TOKEN, COMPONENT_REGISTRY_TOKEN, CONTEXT_TOKEN, CREATE_CACHE_TOKEN, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN, EXECUTION_CONTEXT_MANAGER_TOKEN, FASTIFY_REQUEST, FASTIFY_RESPONSE, HOOK_TOKEN, INITIAL_APP_STATE_TOKEN, LOGGER_INIT_HOOK, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, REQUEST, REQUEST_MANAGER_TOKEN, RESPONSE, RESPONSE_MANAGER_TOKEN, ROOT_EXECUTION_CONTEXT_TOKEN, ROOT_PUBSUB_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN };
|
package/lib/index.js
CHANGED
|
@@ -177,6 +177,10 @@ const RESPONSE_MANAGER_TOKEN = dippy.createToken('responseManager');
|
|
|
177
177
|
const ENV_MANAGER_TOKEN = dippy.createToken('environmentManager');
|
|
178
178
|
const ENV_USED_TOKEN = dippy.createToken('envUsed', { multi: true });
|
|
179
179
|
|
|
180
|
+
const EXECUTION_CONTEXT_MANAGER_TOKEN = dippy.createToken('common ExecutionContextManager');
|
|
181
|
+
const ROOT_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common rootExecutionContext');
|
|
182
|
+
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common commandLineExecutionContext');
|
|
183
|
+
|
|
180
184
|
exports.ACTION_CONDITIONALS = ACTION_CONDITIONALS;
|
|
181
185
|
exports.ACTION_EXECUTION_TOKEN = ACTION_EXECUTION_TOKEN;
|
|
182
186
|
exports.ACTION_PAGE_RUNNER_TOKEN = ACTION_PAGE_RUNNER_TOKEN;
|
|
@@ -185,6 +189,7 @@ exports.ADDITIONAL_BUNDLE_TOKEN = ADDITIONAL_BUNDLE_TOKEN;
|
|
|
185
189
|
exports.BUNDLE_MANAGER_TOKEN = BUNDLE_MANAGER_TOKEN;
|
|
186
190
|
exports.CLEAR_CACHE_TOKEN = CLEAR_CACHE_TOKEN;
|
|
187
191
|
exports.COMBINE_REDUCERS = COMBINE_REDUCERS;
|
|
192
|
+
exports.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = COMMAND_LINE_EXECUTION_CONTEXT_TOKEN;
|
|
188
193
|
exports.COMPONENT_REGISTRY_TOKEN = COMPONENT_REGISTRY_TOKEN;
|
|
189
194
|
exports.CONTEXT_TOKEN = CONTEXT_TOKEN;
|
|
190
195
|
exports.CREATE_CACHE_TOKEN = CREATE_CACHE_TOKEN;
|
|
@@ -192,6 +197,7 @@ exports.DISPATCHER_CONTEXT_TOKEN = DISPATCHER_CONTEXT_TOKEN;
|
|
|
192
197
|
exports.DISPATCHER_TOKEN = DISPATCHER_TOKEN;
|
|
193
198
|
exports.ENV_MANAGER_TOKEN = ENV_MANAGER_TOKEN;
|
|
194
199
|
exports.ENV_USED_TOKEN = ENV_USED_TOKEN;
|
|
200
|
+
exports.EXECUTION_CONTEXT_MANAGER_TOKEN = EXECUTION_CONTEXT_MANAGER_TOKEN;
|
|
195
201
|
exports.FASTIFY_REQUEST = FASTIFY_REQUEST;
|
|
196
202
|
exports.FASTIFY_RESPONSE = FASTIFY_RESPONSE;
|
|
197
203
|
exports.HOOK_TOKEN = HOOK_TOKEN;
|
|
@@ -205,6 +211,7 @@ exports.REQUEST = REQUEST;
|
|
|
205
211
|
exports.REQUEST_MANAGER_TOKEN = REQUEST_MANAGER_TOKEN;
|
|
206
212
|
exports.RESPONSE = RESPONSE;
|
|
207
213
|
exports.RESPONSE_MANAGER_TOKEN = RESPONSE_MANAGER_TOKEN;
|
|
214
|
+
exports.ROOT_EXECUTION_CONTEXT_TOKEN = ROOT_EXECUTION_CONTEXT_TOKEN;
|
|
208
215
|
exports.ROOT_PUBSUB_TOKEN = ROOT_PUBSUB_TOKEN;
|
|
209
216
|
exports.STORE_MIDDLEWARE = STORE_MIDDLEWARE;
|
|
210
217
|
exports.STORE_TOKEN = STORE_TOKEN;
|
package/lib/logger.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { Logger } from '@tinkoff/logger';
|
|
|
3
3
|
* @description
|
|
4
4
|
* Logger implementation
|
|
5
5
|
*/
|
|
6
|
-
export declare const LOGGER_TOKEN: import("@tinkoff/dippy
|
|
6
|
+
export declare const LOGGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<LoggerFactory>;
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
9
|
* Hook to be able to modify logger on initialization
|
|
10
10
|
*/
|
|
11
|
-
export declare const LOGGER_INIT_HOOK: import("@tinkoff/dippy
|
|
11
|
+
export declare const LOGGER_INIT_HOOK: import("@tinkoff/dippy").BaseTokenInterface<LoggerInitHook>;
|
|
12
12
|
declare type Config = {
|
|
13
13
|
name: string;
|
|
14
14
|
[key: string]: any;
|
package/lib/pubsub.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* @description
|
|
3
3
|
* Factory for creating pubsub instances
|
|
4
4
|
*/
|
|
5
|
-
export declare const PUBSUB_FACTORY_TOKEN: import("@tinkoff/dippy
|
|
5
|
+
export declare const PUBSUB_FACTORY_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<() => PubSub>;
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
8
8
|
* Singleton pubsub instance
|
|
9
9
|
*/
|
|
10
|
-
export declare const PUBSUB_TOKEN: import("@tinkoff/dippy
|
|
10
|
+
export declare const PUBSUB_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<PubSub>;
|
|
11
11
|
/**
|
|
12
12
|
* @description
|
|
13
13
|
* Request pubsub instance that is created for every client
|
|
14
14
|
*/
|
|
15
|
-
export declare const ROOT_PUBSUB_TOKEN: import("@tinkoff/dippy
|
|
15
|
+
export declare const ROOT_PUBSUB_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<PubSub>;
|
|
16
16
|
export interface PubSub {
|
|
17
17
|
subscribe(event: string, fn: (payload?: any) => void): () => boolean;
|
|
18
18
|
publish(event: string, ...args: unknown[]): any;
|
package/lib/requestManager.d.ts
CHANGED
|
@@ -10,18 +10,18 @@ declare type FastifyRequest = OriginalFastifyRequest & {
|
|
|
10
10
|
* @description
|
|
11
11
|
* Direct reference to request object
|
|
12
12
|
*/
|
|
13
|
-
export declare const REQUEST: import("@tinkoff/dippy
|
|
13
|
+
export declare const REQUEST: import("@tinkoff/dippy").BaseTokenInterface<RequestExt>;
|
|
14
14
|
/**
|
|
15
15
|
* @description
|
|
16
16
|
* Direct reference to request object
|
|
17
17
|
*/
|
|
18
|
-
export declare const FASTIFY_REQUEST: import("@tinkoff/dippy
|
|
18
|
+
export declare const FASTIFY_REQUEST: import("@tinkoff/dippy").BaseTokenInterface<FastifyRequest>;
|
|
19
19
|
/**
|
|
20
20
|
* @description
|
|
21
21
|
* Instance for managing client requests (request headers, query-parameters, cookies etc).
|
|
22
22
|
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
23
23
|
*/
|
|
24
|
-
export declare const REQUEST_MANAGER_TOKEN: import("@tinkoff/dippy
|
|
24
|
+
export declare const REQUEST_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<RequestManager>;
|
|
25
25
|
export interface RequestManager {
|
|
26
26
|
getBody(): unknown;
|
|
27
27
|
getUrl(): string;
|
package/lib/responseManager.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ import type { FastifyReply } from 'fastify';
|
|
|
6
6
|
* @description
|
|
7
7
|
* Direct reference to Response instance
|
|
8
8
|
*/
|
|
9
|
-
export declare const RESPONSE: import("@tinkoff/dippy
|
|
10
|
-
export declare const FASTIFY_RESPONSE: import("@tinkoff/dippy
|
|
9
|
+
export declare const RESPONSE: import("@tinkoff/dippy").BaseTokenInterface<Response<any, Record<string, any>>>;
|
|
10
|
+
export declare const FASTIFY_RESPONSE: import("@tinkoff/dippy").BaseTokenInterface<FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>>;
|
|
11
11
|
/**
|
|
12
12
|
* @description
|
|
13
13
|
* Instance for managing client response (response headers, cookies, response body).
|
|
14
14
|
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
15
15
|
*/
|
|
16
|
-
export declare const RESPONSE_MANAGER_TOKEN: import("@tinkoff/dippy
|
|
16
|
+
export declare const RESPONSE_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ResponseManager>;
|
|
17
17
|
export interface ResponseManager {
|
|
18
18
|
getBody(): string;
|
|
19
19
|
setBody(value: string): void;
|
package/lib/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DispatcherContext, Event, Middleware, Reducer } from '@tramvai/state';
|
|
1
|
+
import type { DispatcherContext, Event, Middleware, Reducer } from '@tramvai/types-actions-state-context';
|
|
2
2
|
/**
|
|
3
3
|
* @description
|
|
4
4
|
* dispatcher implementation
|
|
@@ -9,7 +9,7 @@ export declare const DISPATCHER_TOKEN: any;
|
|
|
9
9
|
* @description
|
|
10
10
|
* dispatcher context implementation
|
|
11
11
|
*/
|
|
12
|
-
export declare const DISPATCHER_CONTEXT_TOKEN: import("@tinkoff/dippy
|
|
12
|
+
export declare const DISPATCHER_CONTEXT_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<DispatcherContext<any>>;
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
15
|
* Token for adding stores that were created with createReducer
|
|
@@ -19,17 +19,17 @@ export declare const COMBINE_REDUCERS: any;
|
|
|
19
19
|
* @description
|
|
20
20
|
* Common app store
|
|
21
21
|
*/
|
|
22
|
-
export declare const STORE_TOKEN: import("@tinkoff/dippy
|
|
22
|
+
export declare const STORE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<Store<Record<string, any>>>;
|
|
23
23
|
/**
|
|
24
24
|
* @description
|
|
25
25
|
* Custom middlewares for working with store state
|
|
26
26
|
*/
|
|
27
|
-
export declare const STORE_MIDDLEWARE: import("@tinkoff/dippy
|
|
27
|
+
export declare const STORE_MIDDLEWARE: import("@tinkoff/dippy").MultiTokenInterface<Middleware>;
|
|
28
28
|
/**
|
|
29
29
|
* @description
|
|
30
30
|
* Начальное состояние для клиента
|
|
31
31
|
*/
|
|
32
|
-
export declare const INITIAL_APP_STATE_TOKEN: import("@tinkoff/dippy
|
|
32
|
+
export declare const INITIAL_APP_STATE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<{
|
|
33
33
|
stores: Record<string, any>;
|
|
34
34
|
}>;
|
|
35
35
|
export interface Store<State = Record<string, any>> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-common",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -20,14 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@tinkoff/lru-cache-nano": "^7.8.1",
|
|
23
|
-
"@tramvai/tokens-core": "2.
|
|
23
|
+
"@tramvai/tokens-core": "2.10.2",
|
|
24
24
|
"@types/express": "^4.17.9"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@tinkoff/dippy": "0.7.
|
|
28
|
-
"@tinkoff/logger": "0.10.
|
|
29
|
-
"@tramvai/state": "2.
|
|
30
|
-
"@tramvai/types-actions-state-context": "2.6.2",
|
|
27
|
+
"@tinkoff/dippy": "0.7.45",
|
|
28
|
+
"@tinkoff/logger": "0.10.19",
|
|
29
|
+
"@tramvai/types-actions-state-context": "2.10.2",
|
|
31
30
|
"express": "^4.17.1",
|
|
32
31
|
"fastify": "^3.29.0",
|
|
33
32
|
"react": ">=16.8",
|