@leyyo/common 1.0.1 → 1.0.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.
Files changed (108) hide show
  1. package/dist/assertion/common-assertion-impl.d.ts +3 -4
  2. package/dist/assertion/common-assertion-impl.js +9 -8
  3. package/dist/assertion/index-types.d.ts +6 -22
  4. package/dist/assertion/index.d.ts +0 -1
  5. package/dist/assertion/index.js +0 -1
  6. package/dist/error/common-error-impl.d.ts +6 -4
  7. package/dist/error/common-error-impl.js +8 -4
  8. package/dist/error/index-types.d.ts +5 -52
  9. package/dist/error/index.d.ts +0 -5
  10. package/dist/error/index.js +0 -5
  11. package/dist/{error → exception}/assertion-exception.d.ts +1 -1
  12. package/dist/{error → exception}/caused-exception.d.ts +1 -1
  13. package/dist/{error → exception}/developer-exception.d.ts +1 -1
  14. package/dist/{error → exception}/exception.d.ts +4 -3
  15. package/dist/{error → exception}/exception.js +4 -4
  16. package/dist/exception/index-types.d.ts +30 -0
  17. package/dist/exception/index.d.ts +6 -0
  18. package/dist/exception/index.js +22 -0
  19. package/dist/fqn/common-fqn-impl.d.ts +11 -0
  20. package/dist/fqn/common-fqn-impl.js +47 -0
  21. package/dist/fqn/index-types.d.ts +6 -0
  22. package/dist/fqn/index-types.js +2 -0
  23. package/dist/fqn/index.d.ts +2 -0
  24. package/dist/{callback → fqn}/index.js +1 -1
  25. package/dist/hook/common-hook-impl.d.ts +30 -0
  26. package/dist/hook/common-hook-impl.js +111 -0
  27. package/dist/hook/index-types.d.ts +56 -0
  28. package/dist/hook/index-types.js +2 -0
  29. package/dist/hook/index.d.ts +2 -0
  30. package/dist/hook/index.js +18 -0
  31. package/dist/index.d.ts +11 -5
  32. package/dist/index.js +19 -6
  33. package/dist/is/common-is-impl.js +6 -6
  34. package/dist/is/index-types.d.ts +2 -3
  35. package/dist/leyyo/index-types.d.ts +4 -2
  36. package/dist/leyyo/leyyo-impl.d.ts +4 -2
  37. package/dist/leyyo/leyyo-impl.js +37 -29
  38. package/dist/literal/country-code.d.ts +8 -0
  39. package/dist/literal/country-code.js +17 -0
  40. package/dist/literal/environment.d.ts +8 -0
  41. package/dist/literal/environment.js +7 -0
  42. package/dist/literal/http-method.d.ts +8 -0
  43. package/dist/literal/http-method.js +7 -0
  44. package/dist/literal/http-place.d.ts +8 -0
  45. package/dist/literal/http-place.js +7 -0
  46. package/dist/literal/index-types.d.ts +6 -0
  47. package/dist/literal/index-types.js +2 -0
  48. package/dist/literal/index.d.ts +14 -0
  49. package/dist/literal/index.js +30 -0
  50. package/dist/literal/key-value.d.ts +4 -0
  51. package/dist/literal/key-value.js +7 -0
  52. package/dist/literal/language-code.d.ts +8 -0
  53. package/dist/literal/language-code.js +12 -0
  54. package/dist/literal/locale-code.d.ts +10 -0
  55. package/dist/literal/locale-code.js +17 -0
  56. package/dist/literal/primitive.d.ts +8 -0
  57. package/dist/literal/primitive.js +7 -0
  58. package/dist/literal/real-value.d.ts +8 -0
  59. package/dist/literal/real-value.js +7 -0
  60. package/dist/literal/severity.d.ts +8 -0
  61. package/dist/literal/severity.js +7 -0
  62. package/dist/literal/storage-type.d.ts +8 -0
  63. package/dist/literal/storage-type.js +7 -0
  64. package/dist/literal/weak-false.d.ts +8 -0
  65. package/dist/literal/weak-false.js +7 -0
  66. package/dist/literal/weak-true.d.ts +8 -0
  67. package/dist/literal/weak-true.js +7 -0
  68. package/dist/log/common-log-impl.d.ts +3 -2
  69. package/dist/log/common-log-impl.js +6 -6
  70. package/dist/log/index-types.d.ts +2 -52
  71. package/dist/log/index-types.js +0 -1
  72. package/dist/log/index.d.ts +1 -1
  73. package/dist/log/index.js +1 -1
  74. package/dist/log/logger-impl.d.ts +3 -3
  75. package/dist/log/logger-impl.js +5 -5
  76. package/dist/{assertion → shared}/assert.js +1 -0
  77. package/dist/{aliases.d.ts → shared/index-aliases.d.ts} +1 -1
  78. package/dist/shared/index-types.d.ts +141 -0
  79. package/dist/shared/index-types.js +3 -0
  80. package/dist/shared/index.d.ts +5 -0
  81. package/dist/shared/index.js +21 -0
  82. package/dist/storage/common-storage-impl.d.ts +3 -3
  83. package/dist/storage/common-storage-impl.js +3 -3
  84. package/dist/storage/index-types.d.ts +3 -13
  85. package/dist/storage/index.d.ts +0 -1
  86. package/dist/storage/index.js +0 -1
  87. package/dist/to/common-to-impl.d.ts +3 -3
  88. package/dist/to/common-to-impl.js +11 -11
  89. package/dist/to/index-types.d.ts +1 -30
  90. package/package.json +1 -1
  91. package/dist/callback/common-callback-impl.d.ts +0 -31
  92. package/dist/callback/common-callback-impl.js +0 -134
  93. package/dist/callback/index-types.d.ts +0 -73
  94. package/dist/callback/index.d.ts +0 -2
  95. package/dist/literals.d.ts +0 -106
  96. package/dist/literals.js +0 -81
  97. package/dist/{error → exception}/assertion-exception.js +0 -0
  98. package/dist/{error → exception}/caused-exception.js +0 -0
  99. package/dist/{error → exception}/developer-exception.js +0 -0
  100. package/dist/{callback → exception}/index-types.js +0 -0
  101. package/dist/{error → exception}/multiple-exception.d.ts +1 -1
  102. package/dist/{error → exception}/multiple-exception.js +0 -0
  103. package/dist/{assertion → shared}/assert.d.ts +1 -1
  104. /package/dist/{aliases.js → shared/index-aliases.js} +0 -0
  105. /package/dist/{constants.d.ts → shared/index-constants.d.ts} +0 -0
  106. /package/dist/{constants.js → shared/index-constants.js} +0 -0
  107. /package/dist/{storage → shared}/list.d.ts +0 -0
  108. /package/dist/{storage → shared}/list.js +0 -0
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RealValueItems = void 0;
4
+ /**
5
+ * Real Value items
6
+ * */
7
+ exports.RealValueItems = ['string', 'number', 'bigint', 'boolean', 'object', 'function'];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Severity items
3
+ * */
4
+ export declare const SeverityItems: readonly ["debug", "error", "fatal", "info", "log", "trace", "warn"];
5
+ /**
6
+ * Severity for log and errors
7
+ * */
8
+ export type Severity = typeof SeverityItems[number];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SeverityItems = void 0;
4
+ /**
5
+ * Severity items
6
+ * */
7
+ exports.SeverityItems = ['debug', 'error', 'fatal', 'info', 'log', 'trace', 'warn'];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Weak True items
3
+ * */
4
+ export declare const StorageTypeItems: readonly ["array", "list", "map", "set"];
5
+ /**
6
+ * Storage type literal, as an enum
7
+ * */
8
+ export type StorageType = typeof StorageTypeItems[number];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageTypeItems = void 0;
4
+ /**
5
+ * Weak True items
6
+ * */
7
+ exports.StorageTypeItems = ['array', 'list', 'map', 'set'];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Weak False items
3
+ * */
4
+ export declare const WeakFalseItems: readonly ["0", "-1", "false", "f", "no", "n", "off"];
5
+ /**
6
+ * Weak False
7
+ * */
8
+ export type WeakFalse = typeof WeakFalseItems[number];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WeakFalseItems = void 0;
4
+ /**
5
+ * Weak False items
6
+ * */
7
+ exports.WeakFalseItems = ['0', '-1', 'false', 'f', 'no', 'n', 'off'];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Weak True items
3
+ * */
4
+ export declare const WeakTrueItems: readonly ["1", "true", "t", "yes", "y", "on"];
5
+ /**
6
+ * Weak True
7
+ * */
8
+ export type WeakTrue = typeof WeakTrueItems[number];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WeakTrueItems = void 0;
4
+ /**
5
+ * Weak True items
6
+ * */
7
+ exports.WeakTrueItems = ['1', 'true', 't', 'yes', 'y', 'on'];
@@ -1,7 +1,8 @@
1
1
  import { Leyyo } from "../leyyo";
2
- import { CommonLog, CommonLogSecure, Logger, LogLine } from "./index-types";
2
+ import { CommonLog, CommonLogSecure } from "./index-types";
3
+ import { Logger, LogLine } from "../shared";
3
4
  export declare class CommonLogImpl implements CommonLog, CommonLogSecure {
4
- private callback;
5
+ private hook;
5
6
  constructor();
6
7
  get $secure(): CommonLogSecure;
7
8
  $init(leyyo: Leyyo): void;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommonLogImpl = void 0;
4
4
  const logger_impl_1 = require("./logger-impl");
5
- const constants_1 = require("../constants");
6
- // noinspection JSUnusedLocalSymbols
5
+ const shared_1 = require("../shared");
6
+ // noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
7
7
  class CommonLogImpl {
8
8
  constructor() {
9
9
  this.create.bind(this);
@@ -15,16 +15,16 @@ class CommonLogImpl {
15
15
  throw this;
16
16
  }
17
17
  $init(leyyo) {
18
- this.callback = leyyo.callback;
18
+ this.hook = leyyo.hook;
19
19
  const fields = ['create', 'apply', 'check', 'print'];
20
20
  const rec = { proper: false };
21
21
  fields.forEach(field => {
22
22
  rec[field] = this[field];
23
23
  });
24
24
  // define itself temporarily for log operations
25
- this.callback.defineProvider(constants_1.LY_ATTACHED_LOG, CommonLogImpl, rec);
25
+ this.hook.defineProvider(shared_1.LY_ATTACHED_LOG, CommonLogImpl, rec);
26
26
  // when new log provider is defined, replace all common methods
27
- this.callback.whenProviderDefined(constants_1.LY_ATTACHED_LOG, CommonLogImpl, (ins) => {
27
+ this.hook.whenProviderDefined(shared_1.LY_ATTACHED_LOG, CommonLogImpl, (ins) => {
28
28
  fields.forEach(field => {
29
29
  if (typeof ins[field] === 'function') {
30
30
  this[field] = ins[field];
@@ -34,7 +34,7 @@ class CommonLogImpl {
34
34
  }
35
35
  create(clazz) {
36
36
  const ins = new logger_impl_1.LoggerImpl(clazz);
37
- this.callback.queueForCallback(constants_1.LY_PENDING_LOG_REGISTER, ins, clazz);
37
+ this.hook.queueForCallback(shared_1.LY_PENDING_LOG_REGISTER, ins, clazz);
38
38
  return ins;
39
39
  }
40
40
  apply(line) {
@@ -1,55 +1,5 @@
1
- import { Severity } from "../literals";
2
- import { Dict, InitLike, ShiftMain, ShiftSecure } from "../aliases";
3
- import { CommonCallbackDefined } from "../callback";
1
+ import { InitLike, LogConsumer, Logger, ShiftMain, ShiftSecure } from "../shared";
4
2
  export interface CommonLog extends ShiftSecure<CommonLogSecure>, LogConsumer {
5
3
  create(clazz: Object | Function | string): Logger;
6
4
  }
7
- export interface CommonLogCb extends CommonCallbackDefined {
8
- create?(clazz: Object | Function | string): Logger;
9
- apply?(line: LogLine): void;
10
- check?<T>(line: LogLineEnhanced<T>): void;
11
- print<T>(line: LogLineEnhanced<T>): void;
12
- }
13
- export interface CommonLogSecure extends ShiftMain<CommonLog>, InitLike {
14
- }
15
- export interface LogConsumer {
16
- apply(line: LogLine): void;
17
- }
18
- export interface LogLine {
19
- severity: Severity;
20
- message: string | Error;
21
- holder?: string;
22
- params?: Dict;
23
- }
24
- export interface LogLineEnhanced<L = Dict> extends LogLine {
25
- time?: Date;
26
- locals?: L;
27
- }
28
- export interface Logger extends ShiftSecure<LoggerSecure> {
29
- error(message: string, params?: any): void;
30
- error(error: Error, params?: any): void;
31
- error(whatever: any, params?: any): void;
32
- warn(message: string, params?: any): void;
33
- warn(error: Error, params?: any): void;
34
- warn(whatever: any, params?: any): void;
35
- info(message: string, params?: any): void;
36
- info(error: Error, params?: any): void;
37
- info(whatever: any, params?: any): void;
38
- log(message: string, params?: any): void;
39
- log(error: Error, params?: any): void;
40
- log(whatever: any, params?: any): void;
41
- trace(message: string, params?: any): void;
42
- trace(error: Error, params?: any): void;
43
- trace(whatever: any, params?: any): void;
44
- debug(message: string, params?: any): void;
45
- debug(error: Error, params?: any): void;
46
- debug(whatever: any, params?: any): void;
47
- }
48
- export interface LoggerSecure extends ShiftMain<Logger> {
49
- get $clazz(): Function;
50
- get $name(): string;
51
- $assert(error: Error, indicator: string, params?: unknown): void;
52
- $setName(name: string): void;
53
- $setMethod(method: Severity, lambda?: LoggerLambda): void;
54
- }
55
- export type LoggerLambda = (whatever: any, params?: any) => void;
5
+ export type CommonLogSecure = ShiftMain<CommonLog> & InitLike;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // endregion logger
@@ -1,3 +1,3 @@
1
1
  export * from './index-types';
2
- export * from './logger-impl';
3
2
  export * from './common-log-impl';
3
+ export * from './logger-impl';
package/dist/log/index.js CHANGED
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./index-types"), exports);
18
- __exportStar(require("./logger-impl"), exports);
19
18
  __exportStar(require("./common-log-impl"), exports);
19
+ __exportStar(require("./logger-impl"), exports);
@@ -1,10 +1,10 @@
1
- import { Logger, LoggerLambda, LoggerSecure } from "./index-types";
2
1
  import { Leyyo } from "../leyyo";
3
- import { Severity } from "../literals";
2
+ import { Severity } from "../literal";
3
+ import { Logger, LoggerLambda, LoggerSecure } from "../shared";
4
4
  export declare class LoggerImpl implements Logger, LoggerSecure {
5
5
  private readonly _clazz;
6
6
  private _name;
7
- private static _callback;
7
+ private static _fqn;
8
8
  private static _log;
9
9
  constructor(value: Object | Function | string);
10
10
  debug(message: any, params?: any): void;
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoggerImpl = void 0;
4
- const error_1 = require("../error");
4
+ const exception_1 = require("../exception");
5
5
  // noinspection JSUnusedLocalSymbols
6
6
  class LoggerImpl {
7
7
  constructor(value) {
8
8
  switch (typeof value) {
9
9
  case "function":
10
10
  this._clazz = value;
11
- this._name = LoggerImpl._callback.fqnName(value);
11
+ this._name = LoggerImpl._fqn.name(value);
12
12
  break;
13
13
  case "object":
14
14
  this._clazz = value.constructor;
15
- this._name = LoggerImpl._callback.fqnName(value);
15
+ this._name = LoggerImpl._fqn.name(value);
16
16
  break;
17
17
  case "string":
18
18
  this._name = value;
19
19
  break;
20
20
  default:
21
- throw new error_1.DeveloperException('invalid.logger.name', { type: typeof value });
21
+ throw new exception_1.DeveloperException('invalid.logger.name', { type: typeof value });
22
22
  }
23
23
  }
24
24
  debug(message, params) {
@@ -53,7 +53,7 @@ class LoggerImpl {
53
53
  return this._name;
54
54
  }
55
55
  static $setLeyyo(leyyo) {
56
- this._callback = leyyo.callback;
56
+ this._fqn = leyyo.fqn;
57
57
  this._log = leyyo.log;
58
58
  }
59
59
  $setName(name) {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // noinspection JSUnusedGlobalSymbols
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.assert = assert;
4
5
  exports.$$setLeyyo = $$setLeyyo;
@@ -1,4 +1,4 @@
1
- import { LanguageCode, LocaleCode } from "./literals";
1
+ import { LanguageCode, LocaleCode } from "../literal";
2
2
  export type BasicType = 'undefined' | 'string' | 'object' | 'number' | 'boolean' | 'function' | 'symbol' | 'bigint';
3
3
  export type Dict<T = any> = Record<KeyValue, T>;
4
4
  export type Arr<T = any> = Array<T>;
@@ -0,0 +1,141 @@
1
+ import { Dict, KeyValue, OneOrMore, ShiftMain, ShiftSecure } from "./index-aliases";
2
+ import { Exception, ExceptionLike } from "../exception";
3
+ import { Severity, StorageType } from "../literal";
4
+ export interface AssertionOpt {
5
+ indicator?: AssertionReason | string;
6
+ param?: string;
7
+ where?: string;
8
+ value?: any;
9
+ expected?: OneOrMore<string>;
10
+ current?: string;
11
+ type?: string;
12
+ [k: string]: any;
13
+ }
14
+ type AssertionReason = 'invalid.type' | 'not.found' | 'duplicated' | 'empty';
15
+ export type AssertionCallback = () => string | AssertionOpt;
16
+ export interface AssertionBuiltResult {
17
+ message?: string;
18
+ params: AssertionOpt;
19
+ }
20
+ export interface HookAttachedCallback {
21
+ initialization?: true;
22
+ fn: Function;
23
+ }
24
+ export interface $HookDefinedProvider extends HookDefinedProvider {
25
+ producer: Function;
26
+ }
27
+ export interface HookDefinedProvider {
28
+ proper: boolean;
29
+ }
30
+ export interface HookWaitingProviderItem {
31
+ consumer: Function;
32
+ callback: HookDefinedProviderLambda;
33
+ }
34
+ export type HookDefinedProviderLambda<T extends HookDefinedProvider = HookDefinedProvider> = (instance: T) => void;
35
+ export interface FqnDefinedProvider extends HookDefinedProvider {
36
+ name(value: any): string;
37
+ register(value: any, type: FqnStereoType, pckName: string): void;
38
+ }
39
+ export type FqnStereoType = 'class' | 'function' | 'enum' | 'literal';
40
+ export interface ErrorDefinedProvider extends HookDefinedProvider {
41
+ register(exception: ExceptionLike): void;
42
+ build?(e: Error | string): ExceptionLike;
43
+ afterCreate?(e: ExceptionLike): void;
44
+ causedBy?(e: Error | string): ExceptionLike;
45
+ initSign?(err: Error): boolean;
46
+ addSign?(err: Error, ...keys: Array<string>): boolean;
47
+ getSign?(err: Error): Array<string>;
48
+ removeSign?(err: Error, ...keys: Array<string>): boolean;
49
+ hasSign?(err: Error, key: string): boolean;
50
+ toObject?(e: Error, ...omittedFields: Array<string>): Dict;
51
+ buildStack?(e: Error): void;
52
+ copyStack?(exception: Exception, error: Error): void;
53
+ initOmit?(clz: Function): boolean;
54
+ addOmit?(clz: Function, ...properties: Array<string>): boolean;
55
+ getOmit?(clz: Function): Array<string>;
56
+ inheritOmit?(clz: Function): Array<string>;
57
+ }
58
+ export interface LogDefinedProvider extends HookDefinedProvider {
59
+ create?(clazz: Object | Function | string): Logger;
60
+ apply?(line: LogLine): void;
61
+ check?<T>(line: LogLineEnhanced<T>): void;
62
+ print<T>(line: LogLineEnhanced<T>): void;
63
+ }
64
+ export interface LogConsumer {
65
+ apply(line: LogLine): void;
66
+ }
67
+ export interface LogLine {
68
+ severity: Severity;
69
+ message: string | Error;
70
+ holder?: string;
71
+ params?: Dict;
72
+ }
73
+ export interface LogLineEnhanced<L = Dict> extends LogLine {
74
+ time?: Date;
75
+ locals?: L;
76
+ }
77
+ export interface Logger extends ShiftSecure<LoggerSecure> {
78
+ error(message: string, params?: any): void;
79
+ error(error: Error, params?: any): void;
80
+ error(whatever: any, params?: any): void;
81
+ warn(message: string, params?: any): void;
82
+ warn(error: Error, params?: any): void;
83
+ warn(whatever: any, params?: any): void;
84
+ info(message: string, params?: any): void;
85
+ info(error: Error, params?: any): void;
86
+ info(whatever: any, params?: any): void;
87
+ log(message: string, params?: any): void;
88
+ log(error: Error, params?: any): void;
89
+ log(whatever: any, params?: any): void;
90
+ trace(message: string, params?: any): void;
91
+ trace(error: Error, params?: any): void;
92
+ trace(whatever: any, params?: any): void;
93
+ debug(message: string, params?: any): void;
94
+ debug(error: Error, params?: any): void;
95
+ debug(whatever: any, params?: any): void;
96
+ }
97
+ export interface LoggerSecure extends ShiftMain<Logger> {
98
+ get $clazz(): Function;
99
+ get $name(): string;
100
+ $assert(error: Error, indicator: string, params?: unknown): void;
101
+ $setName(name: string): void;
102
+ $setMethod(method: Severity, lambda?: LoggerLambda): void;
103
+ }
104
+ export type LoggerLambda = (whatever: any, params?: any) => void;
105
+ /**
106
+ * Storage size dictionary which in corresponding type
107
+ * */
108
+ export type StorageItem = Dict<number>;
109
+ /**
110
+ * Storage export dictionary which includes items
111
+ * */
112
+ export type StorageDetail = Record<StorageType, StorageItem>;
113
+ export interface ToTypeOpt extends AssertionOpt {
114
+ silent?: true;
115
+ children?: unknown;
116
+ }
117
+ export type ToTypeFnLambda<T = unknown, O extends ToTypeOpt = ToTypeOpt> = (value: unknown, opt?: O) => T;
118
+ export interface ToTypeChildOpt<T = unknown> extends ToTypeOpt {
119
+ fn?: ToTypeFnLambda<T>;
120
+ }
121
+ export interface ToTypeArrayChildOpt<V extends ToTypeChildOpt = ToTypeChildOpt> extends Dict<ToTypeChildOpt> {
122
+ value?: V;
123
+ }
124
+ export interface ToTypeArrayOpt<V extends ToTypeChildOpt = ToTypeChildOpt> extends ToTypeOpt {
125
+ children?: ToTypeArrayChildOpt<V>;
126
+ }
127
+ export interface ToTypeDictChildOpt<K extends ToTypeChildOpt = ToTypeChildOpt, V extends ToTypeChildOpt = ToTypeChildOpt> extends Record<string, ToTypeChildOpt> {
128
+ key?: K;
129
+ value?: V;
130
+ }
131
+ export interface ToTypeObjectOpt<K extends ToTypeChildOpt = ToTypeChildOpt, V extends ToTypeChildOpt = ToTypeChildOpt> extends ToTypeOpt {
132
+ children?: ToTypeDictChildOpt<K, V>;
133
+ }
134
+ export interface ToTypeEnumOpt<E extends KeyValue = KeyValue> extends ToTypeOpt {
135
+ map: EnumerationMap<E> | EnumerationArray<E>;
136
+ alt?: EnumerationAlt<E>;
137
+ }
138
+ export type EnumerationMap<E extends KeyValue = KeyValue> = Dict<E>;
139
+ export type EnumerationAlt<E extends KeyValue = KeyValue> = Dict<E>;
140
+ export type EnumerationArray<E extends KeyValue = KeyValue> = Array<E>;
141
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // endregion to
@@ -0,0 +1,5 @@
1
+ export * from './index-aliases';
2
+ export * from './index-constants';
3
+ export * from './index-types';
4
+ export * from './assert';
5
+ export * from './list';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./index-aliases"), exports);
18
+ __exportStar(require("./index-constants"), exports);
19
+ __exportStar(require("./index-types"), exports);
20
+ __exportStar(require("./assert"), exports);
21
+ __exportStar(require("./list"), exports);
@@ -1,7 +1,7 @@
1
- import { List } from "./list";
2
- import { CommonStorage, CommonStorageSecure, StorageDetail, StorageItem } from "./index-types";
1
+ import { List, StorageDetail, StorageItem } from "../shared";
2
+ import { CommonStorage, CommonStorageSecure } from "./index-types";
3
3
  import { Leyyo } from "../leyyo";
4
- import { StorageType } from "../literals";
4
+ import { StorageType } from "../literal";
5
5
  /** @inheritDoc */
6
6
  export declare class CommonStorageImpl implements CommonStorage, CommonStorageSecure {
7
7
  private readonly _lists;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommonStorageImpl = void 0;
4
- const list_1 = require("./list");
5
- // noinspection JSUnusedLocalSymbols
4
+ const shared_1 = require("../shared");
5
+ // noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
6
6
  /** @inheritDoc */
7
7
  class CommonStorageImpl {
8
8
  /**
@@ -80,7 +80,7 @@ class CommonStorageImpl {
80
80
  // region list
81
81
  /** @inheritDoc */
82
82
  newList(name) {
83
- const list = new list_1.List();
83
+ const list = new shared_1.List();
84
84
  this._lists.set(name, list);
85
85
  return list;
86
86
  }
@@ -1,6 +1,5 @@
1
- import { List } from "./list";
2
- import { Dict, InitLike, ShiftMain, ShiftSecure } from "../aliases";
3
- import { StorageType } from "../literals";
1
+ import { InitLike, List, ShiftMain, ShiftSecure, StorageDetail } from "../shared";
2
+ import { StorageType } from "../literal";
4
3
  /**
5
4
  * Storage factory
6
5
  *
@@ -85,13 +84,4 @@ export interface CommonStorage extends ShiftSecure<CommonStorageSecure> {
85
84
  * */
86
85
  details(type?: StorageType, name?: string): StorageDetail;
87
86
  }
88
- export interface CommonStorageSecure extends ShiftMain<CommonStorage>, InitLike {
89
- }
90
- /**
91
- * Storage size dictionary which in corresponding type
92
- * */
93
- export type StorageItem = Dict<number>;
94
- /**
95
- * Storage export dictionary which includes items
96
- * */
97
- export type StorageDetail = Record<StorageType, StorageItem>;
87
+ export type CommonStorageSecure = ShiftMain<CommonStorage> & InitLike;
@@ -1,3 +1,2 @@
1
1
  export * from './index-types';
2
- export * from './list';
3
2
  export * from './common-storage-impl';
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./index-types"), exports);
18
- __exportStar(require("./list"), exports);
19
18
  __exportStar(require("./common-storage-impl"), exports);
@@ -1,5 +1,5 @@
1
- import { CommonTo, CommonToSecure, ToTypeArrayOpt, ToTypeEnumOpt, ToTypeObjectOpt, ToTypeOpt } from "./index-types";
2
- import { Dict, KeyValue, OneOrMore } from "../aliases";
1
+ import { CommonTo, CommonToSecure } from "./index-types";
2
+ import { Dict, KeyValue, OneOrMore, ToTypeArrayOpt, ToTypeEnumOpt, ToTypeObjectOpt, ToTypeOpt } from "../shared";
3
3
  import { Leyyo } from "../leyyo";
4
4
  export declare class CommonToImpl implements CommonTo, CommonToSecure {
5
5
  private readonly _EXPECTED_ANY;
@@ -11,7 +11,7 @@ export declare class CommonToImpl implements CommonTo, CommonToSecure {
11
11
  private readonly _EXPECTED_NUMBER;
12
12
  private readonly _EXPECTED_STRING;
13
13
  private is;
14
- private callback;
14
+ private fqn;
15
15
  private assertion;
16
16
  private _enumInMap;
17
17
  private _enumInArray;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommonToImpl = void 0;
4
- const literals_1 = require("../literals");
5
- const error_1 = require("../error");
4
+ const literal_1 = require("../literal");
5
+ const exception_1 = require("../exception");
6
6
  // noinspection JSUnusedGlobalSymbols
7
7
  class CommonToImpl {
8
8
  constructor() {
@@ -137,7 +137,7 @@ class CommonToImpl {
137
137
  return fn(value);
138
138
  }
139
139
  catch (e) {
140
- error_1.Exception.cast(e).raise(!(opt === null || opt === void 0 ? void 0 : opt.silent));
140
+ exception_1.Exception.cast(e).raise(!(opt === null || opt === void 0 ? void 0 : opt.silent));
141
141
  }
142
142
  return null;
143
143
  }
@@ -150,7 +150,7 @@ class CommonToImpl {
150
150
  indicator = 'type.invalid-value';
151
151
  }
152
152
  opt = Object.assign(Object.assign(Object.assign({}, opt), params), { expected, value });
153
- new error_1.DeveloperException(indicator, opt)
153
+ new exception_1.DeveloperException(indicator, opt)
154
154
  .with(this)
155
155
  .raise(!(opt === null || opt === void 0 ? void 0 : opt.silent));
156
156
  return null;
@@ -201,7 +201,7 @@ class CommonToImpl {
201
201
  result.push(valueFn(v, clonedOpt));
202
202
  }
203
203
  catch (e) {
204
- error_1.Exception.cast(e).raise(!opt.silent);
204
+ exception_1.Exception.cast(e).raise(!opt.silent);
205
205
  result.push(null);
206
206
  }
207
207
  });
@@ -226,10 +226,10 @@ class CommonToImpl {
226
226
  if (value === '') {
227
227
  return null;
228
228
  }
229
- if (literals_1.WeakTrueItems.includes(value)) {
229
+ if (literal_1.WeakTrueItems.includes(value)) {
230
230
  return true;
231
231
  }
232
- if (literals_1.WeakFalseItems.includes(value)) {
232
+ if (literal_1.WeakFalseItems.includes(value)) {
233
233
  return false;
234
234
  }
235
235
  return this.raiseInvalidValue(value, this._EXPECTED_BOOL, opt);
@@ -258,7 +258,7 @@ class CommonToImpl {
258
258
  return value;
259
259
  case 'object':
260
260
  case 'function':
261
- return this.callback.fqnName(value);
261
+ return this.fqn.name(value);
262
262
  }
263
263
  return this.raiseInvalidValue(value, this._EXPECTED_CLASS, opt);
264
264
  }
@@ -314,7 +314,7 @@ class CommonToImpl {
314
314
  mapType = 'array';
315
315
  }
316
316
  if (!mapType) {
317
- throw new error_1.DeveloperException('type.invalid-enum-items', { map: opt.map });
317
+ throw new exception_1.DeveloperException('type.invalid-enum-items', { map: opt.map });
318
318
  }
319
319
  let v;
320
320
  switch (typeof value) {
@@ -475,7 +475,7 @@ class CommonToImpl {
475
475
  result[keyOpt.fn(k, keyOpt)] = valueOpt.fn(v, valueOpt);
476
476
  }
477
477
  catch (e) {
478
- error_1.Exception.cast(e).raise(!opt.silent);
478
+ exception_1.Exception.cast(e).raise(!opt.silent);
479
479
  result[k] = null;
480
480
  }
481
481
  }
@@ -540,7 +540,7 @@ class CommonToImpl {
540
540
  // region secure
541
541
  $init(leyyo) {
542
542
  this.is = leyyo.is;
543
- this.callback = leyyo.callback;
543
+ this.fqn = leyyo.fqn;
544
544
  this.assertion = leyyo.assertion;
545
545
  }
546
546
  get $back() {