@leyyo/common 1.3.5 → 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 (228) 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/{type/index.js → base/index.types.js} +2 -3
  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/error/caused.error.d.ts +1 -1
  63. package/dist/error/developer.error.d.ts +7 -7
  64. package/dist/error/developer.error.js +11 -29
  65. package/dist/error/developer.error.js.map +1 -1
  66. package/dist/error/http.error.d.ts +1 -1
  67. package/dist/error/http.error.js +3 -3
  68. package/dist/error/http.error.js.map +1 -1
  69. package/dist/error/index.d.ts +1 -0
  70. package/dist/error/index.js +1 -0
  71. package/dist/error/index.js.map +1 -1
  72. package/dist/error/index.types.d.ts +195 -0
  73. package/dist/error/index.types.js +3 -0
  74. package/dist/error/index.types.js.map +1 -0
  75. package/dist/error/invalid-value.error.js +1 -1
  76. package/dist/error/invalid-value.error.js.map +1 -1
  77. package/dist/error/leyyo.error.d.ts +9 -5
  78. package/dist/error/leyyo.error.js +37 -32
  79. package/dist/error/leyyo.error.js.map +1 -1
  80. package/dist/error/multiple.error.d.ts +1 -1
  81. package/dist/error/multiple.error.js.map +1 -1
  82. package/dist/function/define-loader.d.ts +8 -0
  83. package/dist/function/define-loader.js +23 -0
  84. package/dist/function/define-loader.js.map +1 -0
  85. package/dist/function/delete-prop.d.ts +24 -0
  86. package/dist/function/delete-prop.js +76 -0
  87. package/dist/function/delete-prop.js.map +1 -0
  88. package/dist/function/empty.fn.d.ts +1 -2
  89. package/dist/function/empty.fn.js.map +1 -1
  90. package/dist/function/extended-type.d.ts +1 -1
  91. package/dist/function/extended-type.js +8 -5
  92. package/dist/function/extended-type.js.map +1 -1
  93. package/dist/function/get-fqn.d.ts +8 -0
  94. package/dist/function/get-fqn.js +32 -0
  95. package/dist/function/get-fqn.js.map +1 -0
  96. package/dist/function/get-prop.d.ts +24 -0
  97. package/dist/function/get-prop.js +63 -0
  98. package/dist/function/get-prop.js.map +1 -0
  99. package/dist/function/has-fqn.d.ts +8 -0
  100. package/dist/function/has-fqn.js +32 -0
  101. package/dist/function/has-fqn.js.map +1 -0
  102. package/dist/function/index.d.ts +21 -3
  103. package/dist/function/index.js +21 -3
  104. package/dist/function/index.js.map +1 -1
  105. package/dist/function/index.types.d.ts +35 -0
  106. package/dist/function/index.types.js +4 -0
  107. package/dist/function/index.types.js.map +1 -0
  108. package/dist/function/is-anonymous-name.d.ts +1 -0
  109. package/dist/function/is-anonymous-name.js +11 -0
  110. package/dist/function/is-anonymous-name.js.map +1 -0
  111. package/dist/function/is-test.d.ts +10 -0
  112. package/dist/function/is-test.js +37 -0
  113. package/dist/function/is-test.js.map +1 -0
  114. package/dist/function/{is.js → is.fn.js} +1 -1
  115. package/dist/function/is.fn.js.map +1 -0
  116. package/dist/function/leyyo-fn.d.ts +3 -0
  117. package/dist/function/leyyo-fn.js +14 -0
  118. package/dist/function/leyyo-fn.js.map +1 -0
  119. package/dist/function/on-fqn-set.d.ts +2 -0
  120. package/dist/function/on-fqn-set.js +40 -0
  121. package/dist/function/on-fqn-set.js.map +1 -0
  122. package/dist/function/one-or-more.d.ts +1 -1
  123. package/dist/{common → function}/opt.fn.d.ts +2 -1
  124. package/dist/{common → function}/opt.fn.js +15 -10
  125. package/dist/function/opt.fn.js.map +1 -0
  126. package/dist/function/random-test-no.d.ts +6 -0
  127. package/dist/function/random-test-no.js +12 -0
  128. package/dist/function/random-test-no.js.map +1 -0
  129. package/dist/function/remove-fqn.d.ts +10 -0
  130. package/dist/function/remove-fqn.js +43 -0
  131. package/dist/function/remove-fqn.js.map +1 -0
  132. package/dist/{common/exporter.fn.d.ts → function/run-exporter.d.ts} +1 -1
  133. package/dist/{common/exporter.fn.js → function/run-exporter.js} +7 -3
  134. package/dist/function/run-exporter.js.map +1 -0
  135. package/dist/function/secure-clone.d.ts +1 -1
  136. package/dist/function/set-anonymous-fqn.d.ts +2 -0
  137. package/dist/function/set-anonymous-fqn.js +38 -0
  138. package/dist/function/set-anonymous-fqn.js.map +1 -0
  139. package/dist/function/set-anonymous-name.d.ts +2 -0
  140. package/dist/function/set-anonymous-name.js +66 -0
  141. package/dist/function/set-anonymous-name.js.map +1 -0
  142. package/dist/function/set-fqn.d.ts +9 -0
  143. package/dist/function/set-fqn.js +63 -0
  144. package/dist/function/set-fqn.js.map +1 -0
  145. package/dist/function/set-prop.d.ts +27 -0
  146. package/dist/function/set-prop.js +71 -0
  147. package/dist/function/set-prop.js.map +1 -0
  148. package/dist/function/stamp-loader.d.ts +8 -0
  149. package/dist/function/stamp-loader.js +18 -0
  150. package/dist/function/stamp-loader.js.map +1 -0
  151. package/dist/function/test-case.d.ts +8 -0
  152. package/dist/function/test-case.js +27 -0
  153. package/dist/function/test-case.js.map +1 -0
  154. package/dist/function/test-name.d.ts +8 -0
  155. package/dist/function/test-name.js +18 -0
  156. package/dist/function/test-name.js.map +1 -0
  157. package/dist/function/trigger-fqn.d.ts +2 -0
  158. package/dist/function/trigger-fqn.js +25 -0
  159. package/dist/function/trigger-fqn.js.map +1 -0
  160. package/dist/index.d.ts +11 -2
  161. package/dist/index.foretell.js +8 -8
  162. package/dist/index.foretell.js.map +1 -1
  163. package/dist/index.js +14 -3
  164. package/dist/index.js.map +1 -1
  165. package/dist/index.loader.d.ts +1 -1
  166. package/dist/index.loader.js +3 -3
  167. package/dist/index.loader.js.map +1 -1
  168. package/dist/init/index.d.ts +1 -1
  169. package/dist/init/index.js +4 -3
  170. package/dist/init/index.js.map +1 -1
  171. package/package.json +2 -1
  172. package/dist/common/array.fn.d.ts +0 -46
  173. package/dist/common/array.fn.js +0 -131
  174. package/dist/common/array.fn.js.map +0 -1
  175. package/dist/common/deploy.fn.d.ts +0 -18
  176. package/dist/common/deploy.fn.js +0 -74
  177. package/dist/common/deploy.fn.js.map +0 -1
  178. package/dist/common/enum.fn.d.ts +0 -48
  179. package/dist/common/enum.fn.js +0 -133
  180. package/dist/common/enum.fn.js.map +0 -1
  181. package/dist/common/error.fn.d.ts +0 -100
  182. package/dist/common/error.fn.js +0 -401
  183. package/dist/common/error.fn.js.map +0 -1
  184. package/dist/common/event.fn.d.ts +0 -45
  185. package/dist/common/event.fn.js +0 -161
  186. package/dist/common/event.fn.js.map +0 -1
  187. package/dist/common/exporter.fn.js.map +0 -1
  188. package/dist/common/fqn.fn.d.ts +0 -31
  189. package/dist/common/fqn.fn.js +0 -197
  190. package/dist/common/fqn.fn.js.map +0 -1
  191. package/dist/common/inert.fn.d.ts +0 -69
  192. package/dist/common/inert.fn.js +0 -368
  193. package/dist/common/inert.fn.js.map +0 -1
  194. package/dist/common/lifecycle.fn.d.ts +0 -24
  195. package/dist/common/lifecycle.fn.js +0 -136
  196. package/dist/common/lifecycle.fn.js.map +0 -1
  197. package/dist/common/list.fn.d.ts +0 -47
  198. package/dist/common/list.fn.js +0 -132
  199. package/dist/common/list.fn.js.map +0 -1
  200. package/dist/common/loader.fn.d.ts +0 -15
  201. package/dist/common/loader.fn.js +0 -38
  202. package/dist/common/loader.fn.js.map +0 -1
  203. package/dist/common/log.fn.d.ts +0 -42
  204. package/dist/common/log.fn.js +0 -333
  205. package/dist/common/log.fn.js.map +0 -1
  206. package/dist/common/map.fn.d.ts +0 -46
  207. package/dist/common/map.fn.js +0 -131
  208. package/dist/common/map.fn.js.map +0 -1
  209. package/dist/common/name.fn.d.ts +0 -5
  210. package/dist/common/name.fn.js +0 -69
  211. package/dist/common/name.fn.js.map +0 -1
  212. package/dist/common/opt.fn.js.map +0 -1
  213. package/dist/common/set.fn.d.ts +0 -46
  214. package/dist/common/set.fn.js +0 -131
  215. package/dist/common/set.fn.js.map +0 -1
  216. package/dist/common/test.fn.d.ts +0 -26
  217. package/dist/common/test.fn.js +0 -81
  218. package/dist/common/test.fn.js.map +0 -1
  219. package/dist/function/error-obj.d.ts +0 -8
  220. package/dist/function/error-obj.js +0 -25
  221. package/dist/function/error-obj.js.map +0 -1
  222. package/dist/function/error-text.d.ts +0 -10
  223. package/dist/function/error-text.js +0 -43
  224. package/dist/function/error-text.js.map +0 -1
  225. package/dist/function/is.js.map +0 -1
  226. package/dist/type/index.d.ts +0 -551
  227. package/dist/type/index.js.map +0 -1
  228. /package/dist/function/{is.d.ts → is.fn.d.ts} +0 -0
@@ -1,551 +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 EnumInertItem extends InertItem<EnumData>, EnumInertOpt {
136
- type?: EnumType;
137
- }
138
- export interface EnumInertOpt extends InertOpt<EnumData> {
139
- /**
140
- * Will be the error decorated for context language?
141
- * */
142
- i18n?: unknown;
143
- /**
144
- * Alternative map
145
- * */
146
- alt?: EnumAlt;
147
- /**
148
- * Alternative map
149
- * */
150
- lazyAlt?: Promise<EnumAlt>;
151
- }
152
- export type IgnoreFieldsByType<T, I> = {
153
- [K in keyof T]: T[K] extends I ? K : never;
154
- }[keyof T];
155
- export type ReplaceType<T, O, N> = {
156
- [P in keyof T]: T[P] extends O ? N : T[P];
157
- };
158
- export type SameType<A, T> = {
159
- [K in keyof A]: T;
160
- };
161
- export type PickByType<T, I> = {
162
- [K in keyof T]: T[K] extends I ? K : never;
163
- };
164
- export type PickKeyByType<T, I> = PickByType<T, I>[keyof T];
165
- export type OmitByType<T, I> = {
166
- [K in keyof T]: T[K] extends I ? never : K;
167
- };
168
- export type OmitKeysByType<T, I> = OmitByType<T, I>[keyof T];
169
- export type ValueOrCallback<T> = T | ValueCallback<T> | ValueCallbackAsync<T>;
170
- export type ValueCallback<T> = () => T;
171
- export type ValueCallbackAsync<T> = () => Promise<T>;
172
- export type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T ? {
173
- [P in K]: T[K];
174
- } & Partial<Record<Exclude<keyof T, K>, never>> : never;
175
- export type OneOf<Obj> = ValueOf<OneOfByKey<Obj>>;
176
- export type Xor<A, B> = XorIn<A & {
177
- [K in keyof B]?: undefined;
178
- }> | XorIn<B & {
179
- [K in keyof A]?: undefined;
180
- }>;
181
- type OneOnly<T, K extends keyof T> = Omit<T, Exclude<keyof T, K>> | Pick<T, K>;
182
- type OneOfByKey<T> = {
183
- [key in keyof T]: OneOnly<T, key>;
184
- };
185
- type XorIn<T> = {
186
- [K in keyof T]: T[K];
187
- } & unknown;
188
- /**
189
- * JSON Object, record of `JsonValue`
190
- *
191
- * @see #JsonValue
192
- */
193
- export type JsonObject = {
194
- [K in string]?: JsonValue;
195
- };
196
- /**
197
- * JSON Array, array of `JsonValue`
198
- *
199
- * @see #JsonValue
200
- */
201
- export type JsonArray = Array<JsonValue>;
202
- /**
203
- * JSON Primitive
204
- *
205
- * `OneOf`
206
- * @see `string`
207
- * @see `number`
208
- * @see `boolean`
209
- * @see `null`
210
- */
211
- export type JsonPrimitive = string | number | boolean | null;
212
- /**
213
- * JSON Value
214
- *
215
- * `OneOf`
216
- * @see #JsonPrimitive
217
- * @see #JsonObject
218
- * @see #JsonArray
219
- */
220
- export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
221
- export type OptReason = 'invalid' | 'unexpected' | 'not:allowed' | 'not:found' | 'duplicated' | 'empty' | 'conflicted';
222
- export interface Opt<R extends string = string> extends Obj {
223
- issue?: SetOrMore<OptReason | R | string>;
224
- message?: SetOrMore<string>;
225
- field?: string;
226
- param?: SetOrMore<unknown>;
227
- where?: SetOrMore<string>;
228
- value?: SetOrMore<unknown>;
229
- expected?: SetOrMore<ExtendedType | string>;
230
- type?: SetOrMore<ExtendedType | string>;
231
- method?: SetOrMore<string>;
232
- case?: SetOrMore<unknown>;
233
- desc?: SetOrMore<Describable | string>;
234
- error?: SetOrMore<{
235
- name: string;
236
- message: string;
237
- }>;
238
- assert?: SetOrMore<string>;
239
- [k: string]: unknown;
240
- }
241
- export type OptFn<O extends Opt = Opt> = () => O;
242
- export type OptAny<O extends Opt = Opt> = O | OptFn<O>;
243
- /**
244
- * Extended array interface, ie: Clearable arrays
245
- * */
246
- export interface ListLike<T = unknown> extends Array<T> {
247
- /**
248
- * Clears array items, to align all iteration repositories, like Set, Map etc
249
- *
250
- * @return {number} - returns deleted count
251
- * */
252
- clear(): number;
253
- /**
254
- * Deletes given item
255
- *
256
- * @param {any} value - will be deleted record
257
- * @return {boolean} - is deleted?
258
- * */
259
- delete(value: T): boolean;
260
- /**
261
- * Deletes by given predicate
262
- *
263
- * @param {function} predicate - lambda expression
264
- * @return {boolean} - is deleted?
265
- * */
266
- deleteByLambda(predicate: ListPredicate<T>): boolean;
267
- }
268
- export type ListPredicate<T = unknown> = (value: T, index?: number, arr?: Array<T>) => T;
269
- export interface ErrorInertOpt extends InertOpt<ClassLike> {
270
- /**
271
- * Default error message
272
- * */
273
- message?: string;
274
- /**
275
- * Will be error emitted?
276
- * */
277
- emit?: unknown;
278
- /**
279
- * Will be the error decorated for context language?
280
- * */
281
- i18n?: unknown;
282
- }
283
- export type ErrorInertItem = InertItem<ClassLike> & ErrorInertOpt;
284
- /**
285
- * Bare omit error without any property
286
- * */
287
- export type OmitError = Omit<Error, 'name' | 'message' | 'stack'>;
288
- export interface ErrorObject {
289
- name: string;
290
- message: string;
291
- }
292
- /**
293
- * Stack line
294
- * */
295
- export interface ErrorStackLine {
296
- /**
297
- * File of error
298
- * */
299
- file: string;
300
- /**
301
- * Method of error
302
- * */
303
- method?: string;
304
- /**
305
- * Position of error
306
- * */
307
- pos?: string;
308
- }
309
- export interface LeyyoStackLike extends Error {
310
- /**
311
- * Formatted stack trace
312
- * */
313
- stackTrace?: Array<ErrorStackLine>;
314
- }
315
- export interface LeyyoErrorLike extends Error, LeyyoStackLike, ShiftSecure<LeyyoErrorSecure> {
316
- /**
317
- * Parameters for error
318
- * */
319
- params?: Opt;
320
- /**
321
- * Caused error
322
- * */
323
- causedBy?: OneOrMore<Error>;
324
- /**
325
- * Bind caused error
326
- *
327
- * @param {Error} err
328
- * @return {LeyyoErrorLike}
329
- * */
330
- causes(err: Error): this;
331
- /**
332
- * Bind holder class name
333
- *
334
- * @param {string} name - name of class
335
- * @param {string?} fqn - fqn
336
- * @return {LeyyoErrorLike}
337
- * */
338
- where(name: string, fqn?: string): this;
339
- /**
340
- * Bind holder instance
341
- *
342
- * @param {Obj} instance - this instance
343
- * @return {LeyyoErrorLike}
344
- * */
345
- where(instance: Obj): this;
346
- /**
347
- * Bind holder instance
348
- *
349
- * @param {function} clazz - class
350
- * @return {LeyyoErrorLike}
351
- * */
352
- where(clazz: ClassLike): this;
353
- /**
354
- * Alias for {@link logError}
355
- *
356
- * @param {Logger?} logger - optional bound logger
357
- * */
358
- log(logger?: Logger): void;
359
- /**
360
- * Log as `fatal`
361
- *
362
- * @param {Logger?} logger - optional bound logger
363
- * */
364
- logFatal(logger?: Logger): void;
365
- /**
366
- * Log as `error`
367
- *
368
- * @param {Logger?} logger - optional bound logger
369
- * */
370
- logError(logger?: Logger): void;
371
- /**
372
- * Log as `warn`
373
- *
374
- * @param {Logger?} logger - optional bound logger
375
- * */
376
- logWarn(logger?: Logger): void;
377
- /**
378
- * Log as `debug`
379
- *
380
- * @param {Logger?} logger - optional bound logger
381
- * */
382
- logDebug(logger?: Logger): void;
383
- /**
384
- * Log as `info`
385
- *
386
- * @param {Logger?} logger - optional bound logger
387
- * */
388
- logInfo(logger?: Logger): void;
389
- /**
390
- * Log as `trace`
391
- *
392
- * @param {Logger?} logger - optional bound logger
393
- * */
394
- logTrace(logger?: Logger): void;
395
- }
396
- export interface LeyyoErrorSecure extends ShiftMain<LeyyoErrorLike> {
397
- /**
398
- * List flags
399
- *
400
- * @return {Array<string>} - flags
401
- * */
402
- $list<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(): Array<T>;
403
- /**
404
- * Append a flag
405
- *
406
- * @param {string} key - flag key
407
- * @return {boolean} - is it appended?
408
- * */
409
- $append<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
410
- /**
411
- * Remove a flag
412
- *
413
- * @param {string} key - flag key
414
- * @return {boolean} - is it removed?
415
- * */
416
- $remove<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
417
- /**
418
- * Has a flag?
419
- *
420
- * @param {string} key - flag key
421
- * @return {boolean} - has it?
422
- * */
423
- $has<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
424
- /**
425
- * Copy source properties into target parameters
426
- *
427
- * @param {Error} source - source error
428
- * */
429
- $copyProperties(source: Error): void;
430
- }
431
- export type LeyyoErrorTag = 'printed' | 'sent';
432
- export type ErrorStackBuilder = (err: LeyyoStackLike, force?: boolean) => void;
433
- export type InertMode = 'eager' | 'lazy' | 'failed' | 'conflicted';
434
- export type InertStage = 'persistent' | 'fqn-waiting' | 'loading-waiting';
435
- export interface InertBuildOpt<L extends InertItem<T>, T> {
436
- cluster: string;
437
- validateLambda: InertValidateLambda<T>;
438
- getNameLambda: InertGetNameLambda<T>;
439
- setNameLambda?: InertSetNameLambda<T>;
440
- stampLambda?: InertStampLambda<L, T>;
441
- nextLoadLambda?: InertNextLoadLambda<L, T>;
442
- anonymousName?: string;
443
- }
444
- export interface InertRepo<L extends InertItem<T>, T> extends InertBuildOpt<L, T> {
445
- uniqueLoaded: Set<T>;
446
- fullNames: Map<string, L>;
447
- basicNames: Map<string, L>;
448
- aliases: Map<string, string>;
449
- pendingFqn: Map<string, L>;
450
- pendingLazy: Map<string, L>;
451
- }
452
- export type InertValidateLambda<T> = (target: T) => boolean;
453
- export type InertGetNameLambda<T> = (target: T) => string;
454
- export type InertSetNameLambda<T> = (target: T, name: string) => void;
455
- export type InertStampLambda<L extends InertItem<T>, T> = (item: L) => void;
456
- export type InertNextLoadLambda<L extends InertItem<T>, T> = (item: L) => Promise<void>;
457
- export interface InertItem<T> extends InertOpt<T> {
458
- /**
459
- * Full name of target (FQN)
460
- * */
461
- full?: string;
462
- /**
463
- * Lazy mode
464
- * */
465
- mode: InertMode;
466
- /**
467
- * Lazy stage
468
- * */
469
- stage: InertStage;
470
- }
471
- export interface InertOpt<T> {
472
- /**
473
- * Name of target
474
- * */
475
- name?: string;
476
- /**
477
- * Name of target
478
- * */
479
- target?: T;
480
- /**
481
- * Lazy target promise
482
- * */
483
- lazyTarget?: Promise<T>;
484
- /**
485
- * Alias for it
486
- * */
487
- aliases?: Array<string>;
488
- /**
489
- * Fqn name
490
- * */
491
- fqn?: string;
492
- }
493
- export type LifecycleStage = 'initialize' | 'print' | 'validate' | 'process' | 'clear' | 'ota-before' | 'ota-after' | 'kill';
494
- export type LifecycleTuple = [string, Array<Fnc>];
495
- export type LifecycleSortLambda = (map: Map<string, Array<Fnc>>) => Array<LifecycleTuple>;
496
- export type ExporterData = Record<string, ExporterValue>;
497
- export type ExporterValue = Record<string, unknown>;
498
- export interface ExporterDepot {
499
- add(name: string, value: ExporterValue): void;
500
- }
501
- export interface Logger extends ShiftSecure<LoggerSecure> {
502
- debug(message: string, params?: any | Opt): void;
503
- debug(error: Error, params?: any | Opt): void;
504
- debug(whatever: any, params?: any | Opt): void;
505
- trace(message: string, params?: any | Opt): void;
506
- trace(error: Error, params?: any | Opt): void;
507
- trace(whatever: any, params?: any | Opt): void;
508
- info(message: string, params?: any | Opt): void;
509
- info(error: Error, params?: any | Opt): void;
510
- info(whatever: any, params?: any | Opt): void;
511
- warn(message: string, params?: any | Opt): void;
512
- warn(error: Error, params?: any | Opt): void;
513
- warn(whatever: any, params?: any | Opt): void;
514
- error(message: string, params?: any | Opt): void;
515
- error(error: Error, params?: any | Opt): void;
516
- error(whatever: any, params?: any | Opt): void;
517
- fatal(message: string, params?: any | Opt): void;
518
- fatal(error: Error, params?: any | Opt): void;
519
- fatal(whatever: any, params?: any | Opt): void;
520
- }
521
- export interface LoggerSecure extends ShiftMain<Logger> {
522
- get $name(): string;
523
- $refresh(level: LogLevel): void;
524
- }
525
- export interface LogItem {
526
- level: LogLevel;
527
- where?: string;
528
- ctx?: unknown;
529
- now: string;
530
- message: string | Error;
531
- params?: Opt;
532
- paramStr?: string;
533
- }
534
- export type LocalColorLevel = [boolean, string, string];
535
- export interface LocalColorLike {
536
- bold: string;
537
- normal: string;
538
- end: string;
539
- param: string;
540
- levels: Record<LogLevel, LocalColorLevel>;
541
- }
542
- export type LogFormatterLambda = (item: LogItem) => void;
543
- export type LogConsumerLambda = (item: LogItem) => void;
544
- export type LogStylerLambda = (item: LogItem) => string;
545
- export type ContextFinderLambda = <T = unknown>(...p: Array<unknown>) => T;
546
- export type LoaderLike = Array<LoaderItem>;
547
- export type LeyyoStampLambda = () => LoaderItem;
548
- export type LeyyoStampEmpty = () => symbol;
549
- export type LoaderItem = ClassLike | Fnc | EnumMap | EnumLiteral | Obj | LeyyoStampLambda | LeyyoStampEmpty | LoaderLike;
550
- export type EventType = 'log' | 'error:emit' | 'context:set-finder';
551
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/type/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;;AAuuBrC,kBAAkB;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE"}
File without changes