@leyyo/common 1.3.4 → 1.3.6

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 (233) hide show
  1. package/dist/base/index.d.ts +3 -0
  2. package/dist/base/index.js +20 -0
  3. package/dist/base/index.js.map +1 -0
  4. package/dist/base/index.types.d.ts +196 -0
  5. package/dist/{index.types.js → base/index.types.js} +1 -2
  6. package/dist/base/index.types.js.map +1 -0
  7. package/dist/base/leyyo.d.ts +5 -0
  8. package/dist/base/leyyo.js +85 -0
  9. package/dist/base/leyyo.js.map +1 -0
  10. package/dist/base/leyyo.types.d.ts +18 -0
  11. package/dist/base/leyyo.types.js +3 -0
  12. package/dist/base/leyyo.types.js.map +1 -0
  13. package/dist/class/index.d.ts +1 -1
  14. package/dist/class/index.js +1 -1
  15. package/dist/class/index.js.map +1 -1
  16. package/dist/class/index.types.d.ts +30 -0
  17. package/dist/class/index.types.js +3 -0
  18. package/dist/class/index.types.js.map +1 -0
  19. package/dist/class/list.d.ts +1 -1
  20. package/dist/class/logger.instance.d.ts +14 -10
  21. package/dist/class/logger.instance.js +34 -72
  22. package/dist/class/logger.instance.js.map +1 -1
  23. package/dist/common/deploy.common.d.ts +26 -0
  24. package/dist/common/deploy.common.js +74 -0
  25. package/dist/common/deploy.common.js.map +1 -0
  26. package/dist/common/enum.pool.d.ts +23 -0
  27. package/dist/common/enum.pool.js +100 -0
  28. package/dist/common/enum.pool.js.map +1 -0
  29. package/dist/common/error.common.d.ts +48 -0
  30. package/dist/common/error.common.js +328 -0
  31. package/dist/common/error.common.js.map +1 -0
  32. package/dist/common/error.pool.d.ts +20 -0
  33. package/dist/common/error.pool.js +54 -0
  34. package/dist/common/error.pool.js.map +1 -0
  35. package/dist/common/event.common.d.ts +24 -0
  36. package/dist/common/event.common.js +135 -0
  37. package/dist/common/event.common.js.map +1 -0
  38. package/dist/common/index.d.ts +11 -17
  39. package/dist/common/index.js +11 -17
  40. package/dist/common/index.js.map +1 -1
  41. package/dist/common/index.types.d.ts +561 -0
  42. package/dist/common/index.types.js +4 -0
  43. package/dist/common/index.types.js.map +1 -0
  44. package/dist/common/inert.d.ts +74 -0
  45. package/dist/common/inert.js +302 -0
  46. package/dist/common/inert.js.map +1 -0
  47. package/dist/common/lifecycle.common.d.ts +26 -0
  48. package/dist/common/lifecycle.common.js +124 -0
  49. package/dist/common/lifecycle.common.js.map +1 -0
  50. package/dist/common/literal.pool.d.ts +23 -0
  51. package/dist/common/literal.pool.js +100 -0
  52. package/dist/common/literal.pool.js.map +1 -0
  53. package/dist/common/log.common.d.ts +81 -0
  54. package/dist/common/log.common.js +375 -0
  55. package/dist/common/log.common.js.map +1 -0
  56. package/dist/common/repo.common.d.ts +225 -0
  57. package/dist/common/repo.common.js +474 -0
  58. package/dist/common/repo.common.js.map +1 -0
  59. package/dist/const/index.d.ts +24 -19
  60. package/dist/const/index.js +25 -20
  61. package/dist/const/index.js.map +1 -1
  62. package/dist/enum/log-level.js +0 -2
  63. package/dist/enum/log-level.js.map +1 -1
  64. package/dist/error/caused.error.d.ts +1 -1
  65. package/dist/error/developer.error.d.ts +7 -7
  66. package/dist/error/developer.error.js +11 -29
  67. package/dist/error/developer.error.js.map +1 -1
  68. package/dist/error/http.error.d.ts +1 -1
  69. package/dist/error/http.error.js +3 -3
  70. package/dist/error/http.error.js.map +1 -1
  71. package/dist/error/index.d.ts +1 -0
  72. package/dist/error/index.js +1 -0
  73. package/dist/error/index.js.map +1 -1
  74. package/dist/error/index.types.d.ts +195 -0
  75. package/dist/error/index.types.js +3 -0
  76. package/dist/error/index.types.js.map +1 -0
  77. package/dist/error/invalid-value.error.js +1 -1
  78. package/dist/error/invalid-value.error.js.map +1 -1
  79. package/dist/error/leyyo.error.d.ts +9 -5
  80. package/dist/error/leyyo.error.js +37 -32
  81. package/dist/error/leyyo.error.js.map +1 -1
  82. package/dist/error/multiple.error.d.ts +1 -1
  83. package/dist/error/multiple.error.js.map +1 -1
  84. package/dist/function/define-loader.d.ts +8 -0
  85. package/dist/function/define-loader.js +23 -0
  86. package/dist/function/define-loader.js.map +1 -0
  87. package/dist/function/delete-prop.d.ts +24 -0
  88. package/dist/function/delete-prop.js +76 -0
  89. package/dist/function/delete-prop.js.map +1 -0
  90. package/dist/function/empty.fn.d.ts +1 -2
  91. package/dist/function/empty.fn.js.map +1 -1
  92. package/dist/function/extended-type.d.ts +1 -1
  93. package/dist/function/extended-type.js +8 -5
  94. package/dist/function/extended-type.js.map +1 -1
  95. package/dist/function/get-fqn.d.ts +8 -0
  96. package/dist/function/get-fqn.js +32 -0
  97. package/dist/function/get-fqn.js.map +1 -0
  98. package/dist/function/get-prop.d.ts +24 -0
  99. package/dist/function/get-prop.js +63 -0
  100. package/dist/function/get-prop.js.map +1 -0
  101. package/dist/function/has-fqn.d.ts +8 -0
  102. package/dist/function/has-fqn.js +32 -0
  103. package/dist/function/has-fqn.js.map +1 -0
  104. package/dist/function/index.d.ts +21 -3
  105. package/dist/function/index.js +21 -3
  106. package/dist/function/index.js.map +1 -1
  107. package/dist/function/index.types.d.ts +35 -0
  108. package/dist/function/index.types.js +4 -0
  109. package/dist/function/index.types.js.map +1 -0
  110. package/dist/function/is-anonymous-name.d.ts +1 -0
  111. package/dist/function/is-anonymous-name.js +11 -0
  112. package/dist/function/is-anonymous-name.js.map +1 -0
  113. package/dist/function/is-test.d.ts +10 -0
  114. package/dist/function/is-test.js +37 -0
  115. package/dist/function/is-test.js.map +1 -0
  116. package/dist/function/{is.js → is.fn.js} +1 -1
  117. package/dist/function/is.fn.js.map +1 -0
  118. package/dist/function/leyyo-fn.d.ts +3 -0
  119. package/dist/function/leyyo-fn.js +14 -0
  120. package/dist/function/leyyo-fn.js.map +1 -0
  121. package/dist/function/on-fqn-set.d.ts +2 -0
  122. package/dist/function/on-fqn-set.js +40 -0
  123. package/dist/function/on-fqn-set.js.map +1 -0
  124. package/dist/function/one-or-more.d.ts +1 -1
  125. package/dist/{common → function}/opt.fn.d.ts +2 -1
  126. package/dist/{common → function}/opt.fn.js +15 -10
  127. package/dist/function/opt.fn.js.map +1 -0
  128. package/dist/function/random-test-no.d.ts +6 -0
  129. package/dist/function/random-test-no.js +12 -0
  130. package/dist/function/random-test-no.js.map +1 -0
  131. package/dist/function/remove-fqn.d.ts +10 -0
  132. package/dist/function/remove-fqn.js +43 -0
  133. package/dist/function/remove-fqn.js.map +1 -0
  134. package/dist/{common/exporter.fn.d.ts → function/run-exporter.d.ts} +1 -1
  135. package/dist/{common/exporter.fn.js → function/run-exporter.js} +7 -3
  136. package/dist/function/run-exporter.js.map +1 -0
  137. package/dist/function/secure-clone.d.ts +1 -1
  138. package/dist/function/set-anonymous-fqn.d.ts +2 -0
  139. package/dist/function/set-anonymous-fqn.js +38 -0
  140. package/dist/function/set-anonymous-fqn.js.map +1 -0
  141. package/dist/function/set-anonymous-name.d.ts +2 -0
  142. package/dist/function/set-anonymous-name.js +66 -0
  143. package/dist/function/set-anonymous-name.js.map +1 -0
  144. package/dist/function/set-fqn.d.ts +9 -0
  145. package/dist/function/set-fqn.js +63 -0
  146. package/dist/function/set-fqn.js.map +1 -0
  147. package/dist/function/set-prop.d.ts +27 -0
  148. package/dist/function/set-prop.js +71 -0
  149. package/dist/function/set-prop.js.map +1 -0
  150. package/dist/function/stamp-loader.d.ts +8 -0
  151. package/dist/function/stamp-loader.js +18 -0
  152. package/dist/function/stamp-loader.js.map +1 -0
  153. package/dist/function/test-case.d.ts +8 -0
  154. package/dist/function/test-case.js +27 -0
  155. package/dist/function/test-case.js.map +1 -0
  156. package/dist/function/test-name.d.ts +8 -0
  157. package/dist/function/test-name.js +18 -0
  158. package/dist/function/test-name.js.map +1 -0
  159. package/dist/function/trigger-fqn.d.ts +2 -0
  160. package/dist/function/trigger-fqn.js +25 -0
  161. package/dist/function/trigger-fqn.js.map +1 -0
  162. package/dist/index.d.ts +13 -3
  163. package/dist/index.foretell.d.ts +1 -0
  164. package/dist/{loader.js → index.foretell.js} +12 -18
  165. package/dist/index.foretell.js.map +1 -0
  166. package/dist/index.js +18 -13
  167. package/dist/index.js.map +1 -1
  168. package/dist/index.loader.d.ts +1 -0
  169. package/dist/index.loader.js +47 -0
  170. package/dist/index.loader.js.map +1 -0
  171. package/dist/init/index.d.ts +1 -0
  172. package/dist/init/index.js +24 -0
  173. package/dist/init/index.js.map +1 -0
  174. package/package.json +2 -1
  175. package/dist/common/array.fn.d.ts +0 -46
  176. package/dist/common/array.fn.js +0 -131
  177. package/dist/common/array.fn.js.map +0 -1
  178. package/dist/common/deploy.fn.d.ts +0 -18
  179. package/dist/common/deploy.fn.js +0 -74
  180. package/dist/common/deploy.fn.js.map +0 -1
  181. package/dist/common/enum.fn.d.ts +0 -56
  182. package/dist/common/enum.fn.js +0 -132
  183. package/dist/common/enum.fn.js.map +0 -1
  184. package/dist/common/error.fn.d.ts +0 -107
  185. package/dist/common/error.fn.js +0 -411
  186. package/dist/common/error.fn.js.map +0 -1
  187. package/dist/common/event.fn.d.ts +0 -45
  188. package/dist/common/event.fn.js +0 -161
  189. package/dist/common/event.fn.js.map +0 -1
  190. package/dist/common/exporter.fn.js.map +0 -1
  191. package/dist/common/fqn.fn.d.ts +0 -31
  192. package/dist/common/fqn.fn.js +0 -197
  193. package/dist/common/fqn.fn.js.map +0 -1
  194. package/dist/common/inert.fn.d.ts +0 -69
  195. package/dist/common/inert.fn.js +0 -352
  196. package/dist/common/inert.fn.js.map +0 -1
  197. package/dist/common/lifecycle.fn.d.ts +0 -24
  198. package/dist/common/lifecycle.fn.js +0 -136
  199. package/dist/common/lifecycle.fn.js.map +0 -1
  200. package/dist/common/list.fn.d.ts +0 -47
  201. package/dist/common/list.fn.js +0 -132
  202. package/dist/common/list.fn.js.map +0 -1
  203. package/dist/common/loader.fn.d.ts +0 -15
  204. package/dist/common/loader.fn.js +0 -38
  205. package/dist/common/loader.fn.js.map +0 -1
  206. package/dist/common/log.fn.d.ts +0 -42
  207. package/dist/common/log.fn.js +0 -333
  208. package/dist/common/log.fn.js.map +0 -1
  209. package/dist/common/map.fn.d.ts +0 -46
  210. package/dist/common/map.fn.js +0 -131
  211. package/dist/common/map.fn.js.map +0 -1
  212. package/dist/common/name.fn.d.ts +0 -5
  213. package/dist/common/name.fn.js +0 -69
  214. package/dist/common/name.fn.js.map +0 -1
  215. package/dist/common/opt.fn.js.map +0 -1
  216. package/dist/common/set.fn.d.ts +0 -46
  217. package/dist/common/set.fn.js +0 -131
  218. package/dist/common/set.fn.js.map +0 -1
  219. package/dist/common/test.fn.d.ts +0 -26
  220. package/dist/common/test.fn.js +0 -81
  221. package/dist/common/test.fn.js.map +0 -1
  222. package/dist/function/error-obj.d.ts +0 -8
  223. package/dist/function/error-obj.js +0 -25
  224. package/dist/function/error-obj.js.map +0 -1
  225. package/dist/function/error-text.d.ts +0 -10
  226. package/dist/function/error-text.js +0 -43
  227. package/dist/function/error-text.js.map +0 -1
  228. package/dist/function/is.js.map +0 -1
  229. package/dist/index.types.d.ts +0 -599
  230. package/dist/index.types.js.map +0 -1
  231. package/dist/loader.d.ts +0 -2
  232. package/dist/loader.js.map +0 -1
  233. /package/dist/function/{is.d.ts → is.fn.d.ts} +0 -0
@@ -1,599 +0,0 @@
1
- import { LogLevel } from "./enum";
2
- export type HttpStatus = number;
3
- export type BasicType = 'undefined' | 'string' | 'object' | 'number' | 'boolean' | 'function' | 'symbol' | 'bigint';
4
- export type ExtendedType = BasicType | 'array' | 'null' | 'enum' | 'class' | 'empty' | 'text' | 'nan' | 'integer' | 'date' | 'map' | 'set' | 'list';
5
- export type KeyValue = string | number;
6
- export type AnyKey = string | number | symbol;
7
- export type Obj = Object & {};
8
- export type Dict<T = unknown> = Record<KeyValue, T>;
9
- export type Arr<T = unknown> = Array<T>;
10
- export type Id = string | number;
11
- export type Integer = number;
12
- export type Float = number;
13
- export type Alpha = string;
14
- export type Text = string;
15
- export type Digit = string;
16
- export type Title = string;
17
- export type Description = string;
18
- export type RichText = string;
19
- export type Uuid = string;
20
- export type Host = string;
21
- export type Url = string;
22
- export type Email = string;
23
- export type Folder = string;
24
- export type Timestamp = number;
25
- export type IsoDatetime = string;
26
- export type IsoDate = string;
27
- export type IsoTime = string;
28
- export type Fnc<R = unknown> = ((...args: Arr) => R) & Function;
29
- export type Async<R = unknown> = ((...args: Arr) => Promise<R>) & AsyncGeneratorFunction;
30
- export interface Abstract<T = {}> extends Function {
31
- prototype: T;
32
- readonly name: string;
33
- readonly length: number;
34
- bind(thisArg: unknown, ...args: Arr): unknown;
35
- apply(thisArg: unknown, args: Arr): unknown;
36
- call(thisArg: unknown, ...args: Arr): unknown;
37
- }
38
- export interface ClassLike<T = {}> extends Abstract<T> {
39
- new (...args: Arr): T;
40
- }
41
- export type TypeOf<C = ClassLike> = C extends ClassLike<infer T> ? T : C;
42
- export declare namespace Express {
43
- interface Request {
44
- custom?: Dict;
45
- }
46
- interface Response {
47
- custom?: Dict;
48
- }
49
- }
50
- export interface Describable {
51
- description: string;
52
- }
53
- export interface Nameable {
54
- name: string;
55
- }
56
- export interface HasId {
57
- id?: string | number;
58
- }
59
- export type TypeOfMethod<T, M extends keyof T> = T[M] extends Function ? T[M] : never;
60
- export type TypeOfFnc<F extends Fnc> = F extends (...args: Arr) => infer R ? R : never;
61
- export type TypeOfAsync<F extends Async> = TypeOfPromise<TypeOfFnc<F>>;
62
- export type TypeOfPromise<P> = P extends Promise<infer R> ? R : P;
63
- /**
64
- * String keys of an interface
65
- * - Note: keyof keywords returns string|number|symbol, but it's ignore number and symbol keys
66
- * */
67
- export type StrKey<T> = Extract<keyof T, string>;
68
- /**
69
- * Serialized version of another type
70
- */
71
- export type Serialized<T> = {
72
- [P in keyof T]: T[P];
73
- };
74
- /**
75
- * Makes mutable an interface
76
- *
77
- * @see Readonly
78
- * */
79
- export type Mutable<A> = {
80
- -readonly [K in keyof A]: A[K];
81
- };
82
- export type KeyOf<T> = keyof T;
83
- export type Keys<T> = Array<keyof T>;
84
- export type ValueOf<T> = T[KeyOf<T>];
85
- export type Values<T> = Array<T[KeyOf<T>]>;
86
- export type OneOrMore<T> = T | Array<T>;
87
- export type SetOrMore<T> = T | Set<T>;
88
- /**
89
- * An interface which contains secure mode members and provides to shift to main mode
90
- * */
91
- export interface ShiftSecure<S extends ShiftMain<any>> {
92
- /**
93
- * Shifts to secure mode
94
- * */
95
- get $secure(): S;
96
- }
97
- /**
98
- * An interface which contains main mode members and provides to shift to secure mode
99
- *
100
- * IT's so useful to hide some public members
101
- * - to see clean auto-completed members in IDE
102
- * - to indicated that secure mode members should be used in special cases
103
- * */
104
- export interface ShiftMain<M extends ShiftSecure<any>> {
105
- /**
106
- * Shifts to main mode
107
- * */
108
- get $back(): M;
109
- }
110
- /**
111
- * An interface which provides to flat generic interfaces/classes to prevent verbose casting commands
112
- * */
113
- export interface ShiftFlat<D> {
114
- /**
115
- * Flats current classes, or eliminate generic parameters
116
- * */
117
- get $flat(): D;
118
- }
119
- /**
120
- * Useful interface which provides initialization state for instances
121
- * */
122
- export interface InitLike {
123
- /**
124
- * Initializes the instance
125
- * */
126
- $init(...args: Arr): void;
127
- }
128
- export type EnumMap<E extends KeyValue = KeyValue> = {
129
- [K in E]: KeyValue;
130
- };
131
- export type EnumAlt<E extends KeyValue = KeyValue> = Dict<E>;
132
- export type EnumLiteral<E extends KeyValue = KeyValue> = Array<E> | ReadonlyArray<E>;
133
- export type EnumData<E extends KeyValue = KeyValue> = EnumMap<E> | EnumLiteral<E>;
134
- export type EnumType = 'map' | 'literal';
135
- export interface EnumInertOpt {
136
- /**
137
- * Will be the error decorated for context language?
138
- * */
139
- i18n?: unknown;
140
- }
141
- export interface EnumInertItem extends InertItem<EnumData>, EnumInertOpt {
142
- type?: EnumType;
143
- alt?: EnumAlt;
144
- altTarget?: Promise<EnumAlt>;
145
- }
146
- export interface EnumInertEagerOpt extends InertEagerOpt, EnumInertOpt {
147
- alt?: EnumAlt;
148
- }
149
- export interface EnumInertLazyOpt extends InertLazyOpt<EnumData>, EnumInertOpt {
150
- altTarget?: Promise<EnumAlt>;
151
- }
152
- export interface EnumItem extends EnumDefineOpt {
153
- mode: InertMode;
154
- type?: EnumType;
155
- data?: EnumMap | EnumLiteral;
156
- alt?: EnumAlt;
157
- lazyData?: Promise<EnumMap | EnumLiteral>;
158
- lazyAlt?: Promise<EnumAlt>;
159
- }
160
- export interface EnumDefineOpt {
161
- name: string;
162
- fqn?: string;
163
- i18n?: unknown;
164
- }
165
- export interface EnumDefineEagerOpt extends EnumDefineOpt {
166
- alt?: EnumAlt;
167
- }
168
- export interface EnumDefineLazyOpt extends EnumDefineOpt {
169
- lazyData: Promise<EnumMap | EnumLiteral>;
170
- lazyAlt?: Promise<EnumAlt>;
171
- }
172
- export type IgnoreFieldsByType<T, I> = {
173
- [K in keyof T]: T[K] extends I ? K : never;
174
- }[keyof T];
175
- export type ReplaceType<T, O, N> = {
176
- [P in keyof T]: T[P] extends O ? N : T[P];
177
- };
178
- export type SameType<A, T> = {
179
- [K in keyof A]: T;
180
- };
181
- export type PickByType<T, I> = {
182
- [K in keyof T]: T[K] extends I ? K : never;
183
- };
184
- export type PickKeyByType<T, I> = PickByType<T, I>[keyof T];
185
- export type OmitByType<T, I> = {
186
- [K in keyof T]: T[K] extends I ? never : K;
187
- };
188
- export type OmitKeysByType<T, I> = OmitByType<T, I>[keyof T];
189
- export type ValueOrCallback<T> = T | ValueCallback<T> | ValueCallbackAsync<T>;
190
- export type ValueCallback<T> = () => T;
191
- export type ValueCallbackAsync<T> = () => Promise<T>;
192
- export type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T ? {
193
- [P in K]: T[K];
194
- } & Partial<Record<Exclude<keyof T, K>, never>> : never;
195
- export type OneOf<Obj> = ValueOf<OneOfByKey<Obj>>;
196
- export type Xor<A, B> = XorIn<A & {
197
- [K in keyof B]?: undefined;
198
- }> | XorIn<B & {
199
- [K in keyof A]?: undefined;
200
- }>;
201
- type OneOnly<T, K extends keyof T> = Omit<T, Exclude<keyof T, K>> | Pick<T, K>;
202
- type OneOfByKey<T> = {
203
- [key in keyof T]: OneOnly<T, key>;
204
- };
205
- type XorIn<T> = {
206
- [K in keyof T]: T[K];
207
- } & unknown;
208
- /**
209
- * JSON Object, record of `JsonValue`
210
- *
211
- * @see #JsonValue
212
- */
213
- export type JsonObject = {
214
- [K in string]?: JsonValue;
215
- };
216
- /**
217
- * JSON Array, array of `JsonValue`
218
- *
219
- * @see #JsonValue
220
- */
221
- export type JsonArray = Array<JsonValue>;
222
- /**
223
- * JSON Primitive
224
- *
225
- * `OneOf`
226
- * @see `string`
227
- * @see `number`
228
- * @see `boolean`
229
- * @see `null`
230
- */
231
- export type JsonPrimitive = string | number | boolean | null;
232
- /**
233
- * JSON Value
234
- *
235
- * `OneOf`
236
- * @see #JsonPrimitive
237
- * @see #JsonObject
238
- * @see #JsonArray
239
- */
240
- export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
241
- export type OptReason = 'invalid' | 'unexpected' | 'not:allowed' | 'not:found' | 'duplicated' | 'empty' | 'conflicted';
242
- export interface Opt<R extends string = string> extends Obj {
243
- issue?: SetOrMore<OptReason | R | string>;
244
- message?: SetOrMore<string>;
245
- field?: string;
246
- param?: SetOrMore<unknown>;
247
- where?: SetOrMore<string>;
248
- value?: SetOrMore<unknown>;
249
- expected?: SetOrMore<ExtendedType | string>;
250
- type?: SetOrMore<ExtendedType | string>;
251
- method?: SetOrMore<string>;
252
- case?: SetOrMore<unknown>;
253
- desc?: SetOrMore<Describable | string>;
254
- error?: SetOrMore<{
255
- name: string;
256
- message: string;
257
- }>;
258
- assert?: SetOrMore<string>;
259
- [k: string]: unknown;
260
- }
261
- export type OptFn<O extends Opt = Opt> = () => O;
262
- export type OptAny<O extends Opt = Opt> = O | OptFn<O>;
263
- /**
264
- * Extended array interface, ie: Clearable arrays
265
- * */
266
- export interface ListLike<T = unknown> extends Array<T> {
267
- /**
268
- * Clears array items, to align all iteration repositories, like Set, Map etc
269
- *
270
- * @return {number} - returns deleted count
271
- * */
272
- clear(): number;
273
- /**
274
- * Deletes given item
275
- *
276
- * @param {any} value - will be deleted record
277
- * @return {boolean} - is deleted?
278
- * */
279
- delete(value: T): boolean;
280
- /**
281
- * Deletes by given predicate
282
- *
283
- * @param {function} predicate - lambda expression
284
- * @return {boolean} - is deleted?
285
- * */
286
- deleteByLambda(predicate: ListPredicate<T>): boolean;
287
- }
288
- export type ListPredicate<T = unknown> = (value: T, index?: number, arr?: Array<T>) => T;
289
- export interface ErrorInertOpt {
290
- /**
291
- * Default error message
292
- * */
293
- message?: string;
294
- /**
295
- * Will be error emitted?
296
- * */
297
- emit?: unknown;
298
- /**
299
- * Will be the error decorated for context language?
300
- * */
301
- i18n?: unknown;
302
- }
303
- export type ErrorInertItem = InertItem<ClassLike> & ErrorInertOpt;
304
- export type ErrorInertEagerOpt = InertEagerOpt & ErrorInertOpt;
305
- export type ErrorInertLazyOpt = InertLazyOpt<ClassLike> & ErrorInertOpt;
306
- /**
307
- * Bare omit error without any property
308
- * */
309
- export type OmitError = Omit<Error, 'name' | 'message' | 'stack'>;
310
- export interface ErrorObject {
311
- name: string;
312
- message: string;
313
- }
314
- /**
315
- * Stack line
316
- * */
317
- export interface ErrorStackLine {
318
- /**
319
- * File of error
320
- * */
321
- file: string;
322
- /**
323
- * Method of error
324
- * */
325
- method?: string;
326
- /**
327
- * Position of error
328
- * */
329
- pos?: string;
330
- }
331
- export interface LeyyoStackLike extends Error {
332
- /**
333
- * Formatted stack trace
334
- * */
335
- stackTrace?: Array<ErrorStackLine>;
336
- }
337
- export interface LeyyoErrorLike extends Error, LeyyoStackLike, ShiftSecure<LeyyoErrorSecure> {
338
- /**
339
- * Parameters for error
340
- * */
341
- params?: Opt;
342
- /**
343
- * Caused error
344
- * */
345
- causedBy?: OneOrMore<Error>;
346
- /**
347
- * Bind caused error
348
- *
349
- * @param {Error} err
350
- * @return {LeyyoErrorLike}
351
- * */
352
- causes(err: Error): this;
353
- /**
354
- * Bind holder class name
355
- *
356
- * @param {string} name - name of class
357
- * @param {string?} fqn - fqn
358
- * @return {LeyyoErrorLike}
359
- * */
360
- where(name: string, fqn?: string): this;
361
- /**
362
- * Bind holder instance
363
- *
364
- * @param {Obj} instance - this instance
365
- * @return {LeyyoErrorLike}
366
- * */
367
- where(instance: Obj): this;
368
- /**
369
- * Bind holder instance
370
- *
371
- * @param {function} clazz - class
372
- * @return {LeyyoErrorLike}
373
- * */
374
- where(clazz: ClassLike): this;
375
- /**
376
- * Alias for {@link logError}
377
- *
378
- * @param {Logger?} logger - optional bound logger
379
- * */
380
- log(logger?: Logger): void;
381
- /**
382
- * Log as `fatal`
383
- *
384
- * @param {Logger?} logger - optional bound logger
385
- * */
386
- logFatal(logger?: Logger): void;
387
- /**
388
- * Log as `error`
389
- *
390
- * @param {Logger?} logger - optional bound logger
391
- * */
392
- logError(logger?: Logger): void;
393
- /**
394
- * Log as `warn`
395
- *
396
- * @param {Logger?} logger - optional bound logger
397
- * */
398
- logWarn(logger?: Logger): void;
399
- /**
400
- * Log as `debug`
401
- *
402
- * @param {Logger?} logger - optional bound logger
403
- * */
404
- logDebug(logger?: Logger): void;
405
- /**
406
- * Log as `info`
407
- *
408
- * @param {Logger?} logger - optional bound logger
409
- * */
410
- logInfo(logger?: Logger): void;
411
- /**
412
- * Log as `trace`
413
- *
414
- * @param {Logger?} logger - optional bound logger
415
- * */
416
- logTrace(logger?: Logger): void;
417
- }
418
- export interface LeyyoErrorSecure extends ShiftMain<LeyyoErrorLike> {
419
- /**
420
- * List flags
421
- *
422
- * @return {Array<string>} - flags
423
- * */
424
- $list<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(): Array<T>;
425
- /**
426
- * Append a flag
427
- *
428
- * @param {string} key - flag key
429
- * @return {boolean} - is it appended?
430
- * */
431
- $append<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
432
- /**
433
- * Remove a flag
434
- *
435
- * @param {string} key - flag key
436
- * @return {boolean} - is it removed?
437
- * */
438
- $remove<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
439
- /**
440
- * Has a flag?
441
- *
442
- * @param {string} key - flag key
443
- * @return {boolean} - has it?
444
- * */
445
- $has<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
446
- /**
447
- * Copy source properties into target parameters
448
- *
449
- * @param {Error} source - source error
450
- * */
451
- $copyProperties(source: Error): void;
452
- }
453
- export type LeyyoErrorTag = 'printed' | 'sent';
454
- export type ErrorStackBuilder = (err: LeyyoStackLike, force?: boolean) => void;
455
- export type InertMode = 'eager' | 'lazy' | 'failed' | 'conflicted';
456
- export type InertStage = 'persistent' | 'fqn-waiting' | 'loading-waiting';
457
- export interface InertBuildOpt<L extends InertItem<T>, T> {
458
- cluster: string;
459
- validateLambda: InertValidateLambda<T>;
460
- getNameLambda: InertGetNameLambda<T>;
461
- setNameLambda?: InertSetNameLambda<T>;
462
- stampLambda?: InertStampLambda<L, T>;
463
- nextLoadLambda?: InertNextLoadLambda<L, T>;
464
- anonymousName?: string;
465
- }
466
- export interface InertRepo<L extends InertItem<T>, T> extends InertBuildOpt<L, T> {
467
- uniqueLoaded: Set<T>;
468
- fullNames: Map<string, L>;
469
- basicNames: Map<string, L>;
470
- aliases: Map<string, string>;
471
- pendingFqn: Map<string, L>;
472
- pendingLazy: Map<string, L>;
473
- }
474
- export type InertValidateLambda<T> = (target: T) => boolean;
475
- export type InertGetNameLambda<T> = (target: T) => string;
476
- export type InertSetNameLambda<T> = (target: T, name: string) => void;
477
- export type InertStampLambda<L extends InertItem<T>, T> = (item: L) => void;
478
- export type InertNextLoadLambda<L extends InertItem<T>, T> = (item: L) => Promise<void>;
479
- export interface InertItem<T> {
480
- /**
481
- * Name of target
482
- * */
483
- name: string;
484
- /**
485
- * Full name of target (FQN)
486
- * */
487
- full?: string;
488
- /**
489
- * Alias for it
490
- * */
491
- aliases?: Array<string>;
492
- /**
493
- * Fqn package name
494
- * */
495
- fqn?: string;
496
- /**
497
- * Lazy mode
498
- * */
499
- mode: InertMode;
500
- /**
501
- * Lazy stage
502
- * */
503
- stage: InertStage;
504
- /**
505
- * Target
506
- * */
507
- target?: T;
508
- /**
509
- * Lazy target promise
510
- * */
511
- lazyTarget?: Promise<T>;
512
- }
513
- export interface InertEagerOpt {
514
- /**
515
- * Fqn package name
516
- * */
517
- fqn?: string;
518
- /**
519
- * Alias for it
520
- * */
521
- aliases?: Array<string>;
522
- }
523
- export interface InertLazyOpt<T> {
524
- /**
525
- * Name of target
526
- * */
527
- name: string;
528
- /**
529
- * Lazy target promise
530
- * */
531
- lazyTarget: Promise<T>;
532
- /**
533
- * Alias for it
534
- * */
535
- aliases?: Array<string>;
536
- /**
537
- * Fqn name
538
- * */
539
- fqn?: string;
540
- }
541
- export type LifecycleStage = 'initialize' | 'print' | 'validate' | 'process' | 'clear' | 'ota-before' | 'ota-after' | 'kill';
542
- export type LifecycleTuple = [string, Array<Fnc>];
543
- export type LifecycleSortLambda = (map: Map<string, Array<Fnc>>) => Array<LifecycleTuple>;
544
- export type ExporterData = Record<string, ExporterValue>;
545
- export type ExporterValue = Record<string, unknown>;
546
- export interface ExporterDepot {
547
- add(name: string, value: ExporterValue): void;
548
- }
549
- export interface Logger extends ShiftSecure<LoggerSecure> {
550
- debug(message: string, params?: any | Opt): void;
551
- debug(error: Error, params?: any | Opt): void;
552
- debug(whatever: any, params?: any | Opt): void;
553
- trace(message: string, params?: any | Opt): void;
554
- trace(error: Error, params?: any | Opt): void;
555
- trace(whatever: any, params?: any | Opt): void;
556
- info(message: string, params?: any | Opt): void;
557
- info(error: Error, params?: any | Opt): void;
558
- info(whatever: any, params?: any | Opt): void;
559
- warn(message: string, params?: any | Opt): void;
560
- warn(error: Error, params?: any | Opt): void;
561
- warn(whatever: any, params?: any | Opt): void;
562
- error(message: string, params?: any | Opt): void;
563
- error(error: Error, params?: any | Opt): void;
564
- error(whatever: any, params?: any | Opt): void;
565
- fatal(message: string, params?: any | Opt): void;
566
- fatal(error: Error, params?: any | Opt): void;
567
- fatal(whatever: any, params?: any | Opt): void;
568
- }
569
- export interface LoggerSecure extends ShiftMain<Logger> {
570
- get $name(): string;
571
- $refresh(level: LogLevel): void;
572
- }
573
- export interface LogItem {
574
- level: LogLevel;
575
- where?: string;
576
- ctx?: unknown;
577
- now: string;
578
- message: string | Error;
579
- params?: Opt;
580
- paramStr?: string;
581
- }
582
- export type LocalColorLevel = [boolean, string, string];
583
- export interface LocalColorLike {
584
- bold: string;
585
- normal: string;
586
- end: string;
587
- param: string;
588
- levels: Record<LogLevel, LocalColorLevel>;
589
- }
590
- export type LogFormatterLambda = (item: LogItem) => void;
591
- export type LogConsumerLambda = (item: LogItem) => void;
592
- export type LogStylerLambda = (item: LogItem) => string;
593
- export type ContextFinderLambda = <T = unknown>(...p: Array<unknown>) => T;
594
- export type LoaderLike = Array<LoaderItem>;
595
- export type LeyyoStampLambda = () => LoaderItem;
596
- export type LeyyoStampEmpty = () => symbol;
597
- export type LoaderItem = ClassLike | Fnc | EnumMap | EnumLiteral | Obj | LeyyoStampLambda | LeyyoStampEmpty | LoaderLike;
598
- export type EventType = 'log' | 'error:emit' | 'context:set-finder';
599
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.types.js","sourceRoot":"","sources":["../src/index.types.ts"],"names":[],"mappings":";AAAA,qCAAqC;;AAuyBrC,kBAAkB;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE"}
package/dist/loader.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const loader_leyyoCommon: import("./index.types").LoaderLike;
2
- export declare const foretell_leyyoCommon: (() => void)[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA+B;AAC/B,qCAAuE;AAEvE,qCAAqC;AACxB,QAAA,kBAAkB,GAAG,IAAA,qBAAY,EAAC,cAAG;AAC9C,SAAS;AACT,GAAG,EAAE,CAAC,kDAAO,S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