@tramvai/module-environment 2.56.2 → 2.56.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.
@@ -1,11 +1,11 @@
1
- import type { EnvParameter } from '../types';
1
+ import type { EnvParameter } from '@tramvai/tokens-common';
2
2
  import { EnvironmentManager } from '../shared/EnvironmentManager';
3
3
  export declare class EnvironmentManagerServer extends EnvironmentManager {
4
4
  private tokens;
5
5
  private clientUsedList;
6
6
  constructor(tokens: EnvParameter[]);
7
7
  clientUsed(): Record<string, string>;
8
- updateClientUsed(result: any): void;
8
+ updateClientUsed(result: Record<string, string>): void;
9
9
  private getEnvInFiles;
10
10
  private getEnvInApp;
11
11
  private collectionEnv;
package/lib/server.es.js CHANGED
@@ -115,7 +115,7 @@ EnvironmentModule = __decorate([
115
115
  provide({
116
116
  provide: ENV_MANAGER_TOKEN,
117
117
  useFactory: ({ tokens }) => {
118
- return new EnvironmentManagerServer(flatten(tokens));
118
+ return new EnvironmentManagerServer(flatten(tokens !== null && tokens !== void 0 ? tokens : []));
119
119
  },
120
120
  deps: {
121
121
  tokens: {
package/lib/server.js CHANGED
@@ -123,7 +123,7 @@ exports.EnvironmentModule = tslib.__decorate([
123
123
  core.provide({
124
124
  provide: tokensCommon.ENV_MANAGER_TOKEN,
125
125
  useFactory: ({ tokens }) => {
126
- return new EnvironmentManagerServer(flatten__default["default"](tokens));
126
+ return new EnvironmentManagerServer(flatten__default["default"](tokens !== null && tokens !== void 0 ? tokens : []));
127
127
  },
128
128
  deps: {
129
129
  tokens: {
@@ -1,10 +1,11 @@
1
- export declare class EnvironmentManager {
1
+ import type { EnvironmentManager as Interface } from '@tramvai/tokens-common';
2
+ export declare class EnvironmentManager implements Interface {
2
3
  protected parameters: Record<string, string>;
3
4
  constructor();
4
- get(name: any): string;
5
+ get(name: string): string | undefined;
5
6
  getInt(name: string, def: number): number;
6
7
  getAll(): Record<string, string>;
7
- update(result: any): void;
8
+ update(result: Record<string, string>): void;
8
9
  clientUsed(): Record<string, string>;
9
- updateClientUsed(result: any): void;
10
+ updateClientUsed(result: Record<string, string>): void;
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-environment",
3
- "version": "2.56.2",
3
+ "version": "2.56.5",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -20,12 +20,12 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@tinkoff/utils": "^2.1.2",
23
- "@tramvai/core": "2.56.2",
24
- "@tramvai/papi": "2.56.2",
25
- "@tramvai/state": "2.56.2",
26
- "@tramvai/tokens-common": "2.56.2",
27
- "@tramvai/tokens-server": "2.56.2",
28
- "@tinkoff/dippy": "0.8.10",
23
+ "@tramvai/core": "2.56.5",
24
+ "@tramvai/papi": "2.56.5",
25
+ "@tramvai/state": "2.56.5",
26
+ "@tramvai/tokens-common": "2.56.5",
27
+ "@tramvai/tokens-server": "2.56.5",
28
+ "@tinkoff/dippy": "0.8.11",
29
29
  "react": ">=16.14.0",
30
30
  "react-dom": ">=16.14.0",
31
31
  "tslib": "^2.4.0"
package/lib/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface EnvParameter {
2
- key: string;
3
- value?: string;
4
- optional?: boolean;
5
- validator?: (value: string) => boolean | string;
6
- dehydrate?: boolean;
7
- }