@leyyo/common 1.0.4 → 1.0.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.
- package/dist/assertion/common-assertion.d.ts +54 -0
- package/dist/assertion/common-assertion.js +180 -0
- package/dist/assertion/common-assertion.js.map +1 -0
- package/dist/assertion/index-types.d.ts +154 -159
- package/dist/assertion/index-types.js +1 -0
- package/dist/assertion/index-types.js.map +1 -0
- package/dist/assertion/index.d.ts +0 -1
- package/dist/assertion/index.js +1 -1
- package/dist/assertion/index.js.map +1 -0
- package/dist/descriptor/common-descriptor.d.ts +19 -0
- package/dist/descriptor/common-descriptor.js +92 -0
- package/dist/descriptor/common-descriptor.js.map +1 -0
- package/dist/descriptor/index-types.d.ts +21 -0
- package/dist/{literal → descriptor}/index-types.js +1 -0
- package/dist/descriptor/index-types.js.map +1 -0
- package/dist/descriptor/index.d.ts +1 -0
- package/dist/{storage → descriptor}/index.js +1 -1
- package/dist/descriptor/index.js.map +1 -0
- package/dist/developer/common-developer.d.ts +29 -0
- package/dist/developer/common-developer.js +266 -0
- package/dist/developer/common-developer.js.map +1 -0
- package/dist/developer/index-types.d.ts +77 -0
- package/dist/{storage → developer}/index-types.js +1 -0
- package/dist/developer/index-types.js.map +1 -0
- package/dist/developer/index.d.ts +1 -0
- package/dist/developer/index.js +18 -0
- package/dist/developer/index.js.map +1 -0
- package/dist/error/{common-error-impl.d.ts → common-error.d.ts} +5 -5
- package/dist/error/common-error.js +104 -0
- package/dist/error/common-error.js.map +1 -0
- package/dist/error/index-types.d.ts +21 -2
- package/dist/error/index-types.js +1 -0
- package/dist/error/index-types.js.map +1 -0
- package/dist/error/index.d.ts +0 -1
- package/dist/error/index.js +1 -1
- package/dist/error/index.js.map +1 -0
- package/dist/exception/assertion-exception.d.ts +2 -2
- package/dist/exception/assertion-exception.js +3 -2
- package/dist/exception/assertion-exception.js.map +1 -0
- package/dist/exception/caused-exception.d.ts +2 -2
- package/dist/exception/caused-exception.js +3 -2
- package/dist/exception/caused-exception.js.map +1 -0
- package/dist/exception/developer-exception.d.ts +2 -2
- package/dist/exception/developer-exception.js +3 -2
- package/dist/exception/developer-exception.js.map +1 -0
- package/dist/exception/exception.d.ts +7 -5
- package/dist/exception/exception.js +14 -4
- package/dist/exception/exception.js.map +1 -0
- package/dist/exception/index-types.d.ts +1 -1
- package/dist/exception/index-types.js +1 -0
- package/dist/exception/index-types.js.map +1 -0
- package/dist/exception/index.d.ts +1 -0
- package/dist/exception/index.js +2 -0
- package/dist/exception/index.js.map +1 -0
- package/dist/exception/invalid-value-exception.d.ts +5 -0
- package/dist/exception/invalid-value-exception.js +12 -0
- package/dist/exception/invalid-value-exception.js.map +1 -0
- package/dist/exception/multiple-exception.js +1 -0
- package/dist/exception/multiple-exception.js.map +1 -0
- package/dist/fqn/common-fqn.d.ts +20 -0
- package/dist/fqn/common-fqn.js +116 -0
- package/dist/fqn/common-fqn.js.map +1 -0
- package/dist/fqn/index-types.d.ts +14 -5
- package/dist/fqn/index-types.js +1 -0
- package/dist/fqn/index-types.js.map +1 -0
- package/dist/fqn/index.d.ts +0 -1
- package/dist/fqn/index.js +1 -1
- package/dist/fqn/index.js.map +1 -0
- package/dist/hook/{common-hook-impl.d.ts → common-hook.d.ts} +12 -10
- package/dist/hook/{common-hook-impl.js → common-hook.js} +27 -21
- package/dist/hook/common-hook.js.map +1 -0
- package/dist/hook/index-types.d.ts +29 -14
- package/dist/hook/index-types.js +1 -0
- package/dist/hook/index-types.js.map +1 -0
- package/dist/hook/index.d.ts +0 -1
- package/dist/hook/index.js +1 -1
- package/dist/hook/index.js.map +1 -0
- package/dist/index.d.ts +27 -11
- package/dist/index.js +30 -20
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +4 -1
- package/dist/internal.js.map +1 -0
- package/dist/is/{common-is-impl.d.ts → common-is.d.ts} +19 -5
- package/dist/is/common-is.js +136 -0
- package/dist/is/common-is.js.map +1 -0
- package/dist/is/index-types.d.ts +48 -3
- package/dist/is/index-types.js +1 -0
- package/dist/is/index-types.js.map +1 -0
- package/dist/is/index.d.ts +0 -1
- package/dist/is/index.js +1 -1
- package/dist/is/index.js.map +1 -0
- package/dist/leyyo/index-types.d.ts +30 -17
- package/dist/leyyo/index-types.js +1 -0
- package/dist/leyyo/index-types.js.map +1 -0
- package/dist/leyyo/index.d.ts +1 -1
- package/dist/leyyo/index.js +2 -1
- package/dist/leyyo/index.js.map +1 -0
- package/dist/leyyo/leyyo-common-hook.d.ts +10 -0
- package/dist/leyyo/leyyo-common-hook.js +18 -0
- package/dist/leyyo/leyyo-common-hook.js.map +1 -0
- package/dist/leyyo/leyyo.d.ts +35 -0
- package/dist/leyyo/leyyo.js +77 -0
- package/dist/leyyo/leyyo.js.map +1 -0
- package/dist/log/common-log.d.ts +14 -0
- package/dist/log/common-log.js +92 -0
- package/dist/log/common-log.js.map +1 -0
- package/dist/log/index-types.d.ts +57 -3
- package/dist/log/index-types.js +1 -0
- package/dist/log/index-types.js.map +1 -0
- package/dist/log/index.d.ts +2 -2
- package/dist/log/index.js +3 -2
- package/dist/log/index.js.map +1 -0
- package/dist/log/logger-instance.d.ts +31 -0
- package/dist/log/logger-instance.js +114 -0
- package/dist/log/logger-instance.js.map +1 -0
- package/dist/{literal → log}/severity.js +1 -0
- package/dist/log/severity.js.map +1 -0
- package/dist/repo/common-repo.d.ts +44 -0
- package/dist/repo/common-repo.js +180 -0
- package/dist/repo/common-repo.js.map +1 -0
- package/dist/repo/index-types.d.ts +104 -0
- package/dist/{shared/index-aliases.js → repo/index-types.js} +1 -2
- package/dist/repo/index-types.js.map +1 -0
- package/dist/repo/index.d.ts +2 -0
- package/dist/repo/index.js +19 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/repo-type.d.ts +8 -0
- package/dist/repo/repo-type.js +8 -0
- package/dist/repo/repo-type.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +5 -0
- package/dist/server.js.map +1 -0
- package/dist/shared/index-types.d.ts +162 -132
- package/dist/shared/index-types.js +2 -1
- package/dist/shared/index-types.js.map +1 -0
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/index.js +1 -4
- package/dist/shared/index.js.map +1 -0
- package/dist/system/common-system.d.ts +10 -0
- package/dist/system/common-system.js +65 -0
- package/dist/system/common-system.js.map +1 -0
- package/dist/{literal → system}/country-code.js +1 -0
- package/dist/system/country-code.js.map +1 -0
- package/dist/{literal → system}/environment.js +1 -0
- package/dist/system/environment.js.map +1 -0
- package/dist/{literal → system}/http-method.js +1 -0
- package/dist/system/http-method.js.map +1 -0
- package/dist/{literal → system}/http-place.js +1 -0
- package/dist/system/http-place.js.map +1 -0
- package/dist/system/index-types.d.ts +6 -0
- package/dist/system/index-types.js +3 -0
- package/dist/system/index-types.js.map +1 -0
- package/dist/{literal → system}/index.d.ts +1 -8
- package/dist/{literal → system}/index.js +2 -8
- package/dist/system/index.js.map +1 -0
- package/dist/{literal → system}/language-code.js +1 -0
- package/dist/system/language-code.js.map +1 -0
- package/dist/{literal → system}/locale-code.js +1 -0
- package/dist/system/locale-code.js.map +1 -0
- package/dist/{literal → system}/sys-class.js +1 -0
- package/dist/system/sys-class.js.map +1 -0
- package/dist/{literal → system}/sys-function.js +1 -0
- package/dist/system/sys-function.js.map +1 -0
- package/dist/to/common-to.d.ts +45 -0
- package/dist/to/common-to.js +868 -0
- package/dist/to/common-to.js.map +1 -0
- package/dist/to/index-types.d.ts +38 -18
- package/dist/to/index-types.js +1 -0
- package/dist/to/index-types.js.map +1 -0
- package/dist/to/index.d.ts +6 -1
- package/dist/to/index.js +7 -1
- package/dist/to/index.js.map +1 -0
- package/dist/{literal → to}/key-value.js +1 -0
- package/dist/to/key-value.js.map +1 -0
- package/dist/{shared → to}/list.d.ts +1 -0
- package/dist/{shared → to}/list.js +4 -0
- package/dist/to/list.js.map +1 -0
- package/dist/{literal → to}/primitive.js +1 -0
- package/dist/to/primitive.js.map +1 -0
- package/dist/{literal → to}/real-value.js +1 -0
- package/dist/to/real-value.js.map +1 -0
- package/dist/{literal → to}/weak-false.js +1 -0
- package/dist/to/weak-false.js.map +1 -0
- package/dist/{literal → to}/weak-true.js +1 -0
- package/dist/to/weak-true.js.map +1 -0
- package/dist/wrapper/common-wrapper.d.ts +26 -0
- package/dist/wrapper/common-wrapper.js +81 -0
- package/dist/wrapper/common-wrapper.js.map +1 -0
- package/dist/wrapper/index-types.d.ts +29 -0
- package/dist/wrapper/index-types.js +3 -0
- package/dist/wrapper/index-types.js.map +1 -0
- package/dist/wrapper/index.d.ts +2 -0
- package/dist/wrapper/index.js +19 -0
- package/dist/wrapper/index.js.map +1 -0
- package/dist/wrapper/wrap.d.ts +7 -0
- package/dist/wrapper/wrap.js +11 -0
- package/dist/wrapper/wrap.js.map +1 -0
- package/package.json +13 -15
- package/dist/assertion/common-assertion-impl.d.ts +0 -65
- package/dist/assertion/common-assertion-impl.js +0 -248
- package/dist/error/common-error-impl.js +0 -92
- package/dist/fqn/common-fqn-impl.d.ts +0 -18
- package/dist/fqn/common-fqn-impl.js +0 -121
- package/dist/is/common-is-impl.js +0 -91
- package/dist/leyyo/leyyo-impl.d.ts +0 -26
- package/dist/leyyo/leyyo-impl.js +0 -94
- package/dist/literal/index-types.d.ts +0 -6
- package/dist/literal/storage-type.d.ts +0 -8
- package/dist/literal/storage-type.js +0 -7
- package/dist/log/common-log-impl.d.ts +0 -14
- package/dist/log/common-log-impl.js +0 -59
- package/dist/log/logger-impl.d.ts +0 -23
- package/dist/log/logger-impl.js +0 -77
- package/dist/shared/assert.d.ts +0 -6
- package/dist/shared/assert.js +0 -14
- package/dist/shared/index-aliases.d.ts +0 -167
- package/dist/shared/index-constants.d.ts +0 -8
- package/dist/shared/index-constants.js +0 -11
- package/dist/storage/common-storage-impl.d.ts +0 -47
- package/dist/storage/common-storage-impl.js +0 -150
- package/dist/storage/index-types.d.ts +0 -87
- package/dist/storage/index.d.ts +0 -2
- package/dist/to/common-to-impl.d.ts +0 -38
- package/dist/to/common-to-impl.js +0 -553
- /package/dist/{literal → log}/severity.d.ts +0 -0
- /package/dist/{literal → system}/country-code.d.ts +0 -0
- /package/dist/{literal → system}/environment.d.ts +0 -0
- /package/dist/{literal → system}/http-method.d.ts +0 -0
- /package/dist/{literal → system}/http-place.d.ts +0 -0
- /package/dist/{literal → system}/language-code.d.ts +0 -0
- /package/dist/{literal → system}/locale-code.d.ts +0 -0
- /package/dist/{literal → system}/sys-class.d.ts +0 -0
- /package/dist/{literal → system}/sys-function.d.ts +0 -0
- /package/dist/{literal → to}/key-value.d.ts +0 -0
- /package/dist/{literal → to}/primitive.d.ts +0 -0
- /package/dist/{literal → to}/real-value.d.ts +0 -0
- /package/dist/{literal → to}/weak-false.d.ts +0 -0
- /package/dist/{literal → to}/weak-true.d.ts +0 -0
package/dist/is/index-types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
1
|
+
import { BasicType, EnumLiteral, EnumMap, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
2
|
/**
|
|
3
3
|
* Basic is commands to easy use
|
|
4
4
|
* */
|
|
5
|
-
export interface
|
|
5
|
+
export interface CommonIsLike extends ShiftSecure<CommonIsSecure> {
|
|
6
6
|
/**
|
|
7
7
|
* Checks value is empty or not?
|
|
8
8
|
* Empty means: `undefined`, `null` or `empty string` after trimming
|
|
@@ -11,6 +11,14 @@ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
|
|
|
11
11
|
* @returns {boolean}
|
|
12
12
|
* */
|
|
13
13
|
empty(value: any): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Checks type of value is in given types
|
|
16
|
+
*
|
|
17
|
+
* @param {any} value
|
|
18
|
+
* @param {Array} types
|
|
19
|
+
* @returns {boolean}
|
|
20
|
+
* */
|
|
21
|
+
typeOf(value: any, ...types: Array<BasicType>): boolean;
|
|
14
22
|
/**
|
|
15
23
|
* Checks value is primitive or not?
|
|
16
24
|
* Primitive means: `string`, `number`, `boolean`
|
|
@@ -43,6 +51,20 @@ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
|
|
|
43
51
|
* @returns {boolean}
|
|
44
52
|
* */
|
|
45
53
|
object(value: any): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Checks value is bare object [constructor === Object] or not?
|
|
56
|
+
*
|
|
57
|
+
* @param {any} value
|
|
58
|
+
* @returns {boolean}
|
|
59
|
+
* */
|
|
60
|
+
bareObject(value: any): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks value is another object [constructor !== Object] or not?
|
|
63
|
+
*
|
|
64
|
+
* @param {any} value
|
|
65
|
+
* @returns {boolean}
|
|
66
|
+
* */
|
|
67
|
+
anotherObject(value: any): boolean;
|
|
46
68
|
/**
|
|
47
69
|
* Checks value is array or not?
|
|
48
70
|
*
|
|
@@ -57,6 +79,13 @@ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
|
|
|
57
79
|
* @returns {boolean}
|
|
58
80
|
* */
|
|
59
81
|
func(value: any): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Checks value is symbol or not?
|
|
84
|
+
*
|
|
85
|
+
* @param {any} value
|
|
86
|
+
* @returns {boolean}
|
|
87
|
+
* */
|
|
88
|
+
sym(value: any): boolean;
|
|
60
89
|
/**
|
|
61
90
|
* Checks value is number (float or integer) or not?
|
|
62
91
|
*
|
|
@@ -109,6 +138,22 @@ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
|
|
|
109
138
|
* @returns {boolean}
|
|
110
139
|
* */
|
|
111
140
|
clazz(value: any): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Checks value is an enum value?
|
|
143
|
+
*
|
|
144
|
+
* @param {any} value
|
|
145
|
+
* @param {EnumMap<string>} map
|
|
146
|
+
* @returns {boolean}
|
|
147
|
+
* */
|
|
148
|
+
enumeration(value: unknown, map: EnumMap): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Checks value is an enum value?
|
|
151
|
+
*
|
|
152
|
+
* @param {any} value
|
|
153
|
+
* @param {EnumLiteral<string>} items
|
|
154
|
+
* @returns {boolean}
|
|
155
|
+
* */
|
|
156
|
+
literal(value: unknown, items: EnumLiteral): boolean;
|
|
112
157
|
/**
|
|
113
158
|
* Checks value is boolean?
|
|
114
159
|
*
|
|
@@ -141,4 +186,4 @@ export interface CommonIs extends ShiftSecure<CommonIsSecure> {
|
|
|
141
186
|
* */
|
|
142
187
|
false(value: any): boolean;
|
|
143
188
|
}
|
|
144
|
-
export type CommonIsSecure = ShiftMain<
|
|
189
|
+
export type CommonIsSecure = ShiftMain<CommonIsLike> & InitLike;
|
package/dist/is/index-types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/is/index-types.ts"],"names":[],"mappings":""}
|
package/dist/is/index.d.ts
CHANGED
package/dist/is/index.js
CHANGED
|
@@ -15,4 +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
|
-
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/is/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
1
|
+
import { CommonHookLike } from "../hook";
|
|
2
|
+
import { CommonIsLike } from "../is";
|
|
3
|
+
import { CommonAssertionLike } from "../assertion";
|
|
4
|
+
import { CommonErrorLike } from "../error";
|
|
5
|
+
import { CommonLogLike } from "../log";
|
|
6
|
+
import { CommonRepoLike } from "../repo";
|
|
7
|
+
import { CommonToLike } from "../to";
|
|
8
|
+
import { CommonFqnLike } from "../fqn";
|
|
9
|
+
import { CommonSystemLike } from "../system";
|
|
10
|
+
import { CommonDeveloperLike } from "../developer";
|
|
11
|
+
import { Func, ShiftMain, ShiftSecure } from "../shared";
|
|
12
|
+
import { CommonDescriptorLike } from "../descriptor";
|
|
13
|
+
import { CommonWrapperLike } from "../wrapper";
|
|
14
|
+
export interface LeyyoLike extends ShiftSecure<LeyyoSecure> {
|
|
15
|
+
readonly is: CommonIsLike;
|
|
16
|
+
readonly hook: CommonHookLike;
|
|
17
|
+
readonly assertion: CommonAssertionLike;
|
|
18
|
+
readonly error: CommonErrorLike;
|
|
19
|
+
readonly log: CommonLogLike;
|
|
20
|
+
readonly repo: CommonRepoLike;
|
|
21
|
+
readonly to: CommonToLike;
|
|
22
|
+
readonly fqn: CommonFqnLike;
|
|
23
|
+
readonly system: CommonSystemLike;
|
|
24
|
+
readonly dev: CommonDeveloperLike;
|
|
25
|
+
readonly descriptor: CommonDescriptorLike;
|
|
26
|
+
readonly wrapper: CommonWrapperLike;
|
|
27
|
+
}
|
|
28
|
+
export interface LeyyoSecure extends ShiftMain<LeyyoLike> {
|
|
29
|
+
$earlyRun(fn: Func): LeyyoSecure;
|
|
30
|
+
$lazyRun(fn: Func): LeyyoSecure;
|
|
18
31
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/leyyo/index-types.ts"],"names":[],"mappings":""}
|
package/dist/leyyo/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './index-types';
|
|
2
|
-
export * from './leyyo-
|
|
2
|
+
export * from './leyyo-common-hook';
|
package/dist/leyyo/index.js
CHANGED
|
@@ -15,4 +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("./leyyo-
|
|
18
|
+
__exportStar(require("./leyyo-common-hook"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/leyyo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,sDAAoC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class LeyyoCommonHook {
|
|
2
|
+
constructor();
|
|
3
|
+
static readonly errorAttached: unique symbol;
|
|
4
|
+
static readonly errorPendingRegister: unique symbol;
|
|
5
|
+
static readonly enumPendingRegister: unique symbol;
|
|
6
|
+
static readonly fqnAttached: unique symbol;
|
|
7
|
+
static readonly fqnPendingRegister: unique symbol;
|
|
8
|
+
static readonly logAttached: unique symbol;
|
|
9
|
+
static readonly logPendingRegister: unique symbol;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeyyoCommonHook = void 0;
|
|
4
|
+
const internal_1 = require("../internal");
|
|
5
|
+
class LeyyoCommonHook {
|
|
6
|
+
constructor() {
|
|
7
|
+
throw new Error('LeyyoCommonHook is for only static usage');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.LeyyoCommonHook = LeyyoCommonHook;
|
|
11
|
+
LeyyoCommonHook.errorAttached = Symbol.for(`[${internal_1.FQN_PCK}#error.attached]`);
|
|
12
|
+
LeyyoCommonHook.errorPendingRegister = Symbol.for(`[${internal_1.FQN_PCK}#error.pendingRegister]`);
|
|
13
|
+
LeyyoCommonHook.enumPendingRegister = Symbol.for(`[${internal_1.FQN_PCK}#enum.pendingRegister]`);
|
|
14
|
+
LeyyoCommonHook.fqnAttached = Symbol.for(`[${internal_1.FQN_PCK}#fqn.attached]`);
|
|
15
|
+
LeyyoCommonHook.fqnPendingRegister = Symbol.for(`[${internal_1.FQN_PCK}#fqn.pendingRegister]`);
|
|
16
|
+
LeyyoCommonHook.logAttached = Symbol.for(`[${internal_1.FQN_PCK}#log.attached]`);
|
|
17
|
+
LeyyoCommonHook.logPendingRegister = Symbol.for(`[${internal_1.FQN_PCK}#log.pendingRegister]`);
|
|
18
|
+
//# sourceMappingURL=leyyo-common-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leyyo-common-hook.js","sourceRoot":"","sources":["../../src/leyyo/leyyo-common-hook.ts"],"names":[],"mappings":";;;AAAA,0CAAoC;AAEpC,MAAa,eAAe;IACxB;QACI,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAChE,CAAC;;AAHL,0CAYC;AAPmB,6BAAa,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,kBAAkB,CAAC,CAAC;AACzE,oCAAoB,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,yBAAyB,CAAC,CAAC;AACvF,mCAAmB,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,wBAAwB,CAAC,CAAC;AACrF,2BAAW,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,gBAAgB,CAAC,CAAC;AACrE,kCAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,uBAAuB,CAAC,CAAC;AACnF,2BAAW,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,gBAAgB,CAAC,CAAC;AACrE,kCAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,kBAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Func } from "../shared";
|
|
2
|
+
import { CommonHookLike } from "../hook";
|
|
3
|
+
import { LeyyoLike, LeyyoSecure } from "./index-types";
|
|
4
|
+
import { CommonIsLike } from "../is";
|
|
5
|
+
import { CommonAssertionLike } from "../assertion";
|
|
6
|
+
import { CommonErrorLike } from "../error";
|
|
7
|
+
import { CommonLogLike } from "../log";
|
|
8
|
+
import { CommonRepoLike } from "../repo";
|
|
9
|
+
import { CommonToLike } from "../to";
|
|
10
|
+
import { CommonFqnLike } from "../fqn";
|
|
11
|
+
import { CommonSystemLike } from "../system";
|
|
12
|
+
import { CommonDeveloperLike } from "../developer";
|
|
13
|
+
import { CommonDescriptorLike } from "../descriptor";
|
|
14
|
+
import { CommonWrapperLike } from "../wrapper";
|
|
15
|
+
export declare class Leyyo implements LeyyoLike, LeyyoSecure {
|
|
16
|
+
private _lazyCallbacks;
|
|
17
|
+
private _earlyCallbacks;
|
|
18
|
+
readonly hook: CommonHookLike;
|
|
19
|
+
readonly is: CommonIsLike;
|
|
20
|
+
readonly assertion: CommonAssertionLike;
|
|
21
|
+
readonly error: CommonErrorLike;
|
|
22
|
+
readonly log: CommonLogLike;
|
|
23
|
+
readonly repo: CommonRepoLike;
|
|
24
|
+
readonly to: CommonToLike;
|
|
25
|
+
readonly fqn: CommonFqnLike;
|
|
26
|
+
readonly system: CommonSystemLike;
|
|
27
|
+
readonly dev: CommonDeveloperLike;
|
|
28
|
+
readonly descriptor: CommonDescriptorLike;
|
|
29
|
+
readonly wrapper: CommonWrapperLike;
|
|
30
|
+
constructor();
|
|
31
|
+
get $secure(): LeyyoSecure;
|
|
32
|
+
get $back(): LeyyoLike;
|
|
33
|
+
$earlyRun(fn: Func): LeyyoSecure;
|
|
34
|
+
$lazyRun(fn: Func): LeyyoSecure;
|
|
35
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Leyyo = void 0;
|
|
4
|
+
const internal_1 = require("../internal");
|
|
5
|
+
const common_system_1 = require("../system/common-system");
|
|
6
|
+
const common_is_1 = require("../is/common-is");
|
|
7
|
+
const common_repo_1 = require("../repo/common-repo");
|
|
8
|
+
const common_hook_1 = require("../hook/common-hook");
|
|
9
|
+
const common_log_1 = require("../log/common-log");
|
|
10
|
+
const common_fqn_1 = require("../fqn/common-fqn");
|
|
11
|
+
const common_developer_1 = require("../developer/common-developer");
|
|
12
|
+
const common_error_1 = require("../error/common-error");
|
|
13
|
+
const common_assertion_1 = require("../assertion/common-assertion");
|
|
14
|
+
const common_to_1 = require("../to/common-to");
|
|
15
|
+
const common_descriptor_1 = require("../descriptor/common-descriptor");
|
|
16
|
+
const common_wrapper_1 = require("../wrapper/common-wrapper");
|
|
17
|
+
class Leyyo {
|
|
18
|
+
constructor() {
|
|
19
|
+
this._lazyCallbacks = [];
|
|
20
|
+
this._earlyCallbacks = [];
|
|
21
|
+
this.system = new common_system_1.CommonSystem();
|
|
22
|
+
this.is = new common_is_1.CommonIs();
|
|
23
|
+
this.repo = new common_repo_1.CommonRepo();
|
|
24
|
+
this.hook = new common_hook_1.CommonHook(); // repo
|
|
25
|
+
this.log = new common_log_1.CommonLog(); // hook
|
|
26
|
+
this.fqn = new common_fqn_1.CommonFqn(); // hook
|
|
27
|
+
this.dev = new common_developer_1.CommonDeveloper();
|
|
28
|
+
this.error = new common_error_1.CommonError(); // hook
|
|
29
|
+
this.assertion = new common_assertion_1.CommonAssertion(); // is, hook
|
|
30
|
+
this.to = new common_to_1.CommonTo(); // is, hook, assertion
|
|
31
|
+
this.descriptor = new common_descriptor_1.CommonDescriptor();
|
|
32
|
+
this.wrapper = new common_wrapper_1.CommonWrapper();
|
|
33
|
+
const members = [
|
|
34
|
+
this.system.$secure,
|
|
35
|
+
this.is.$secure,
|
|
36
|
+
this.repo.$secure,
|
|
37
|
+
this.hook.$secure,
|
|
38
|
+
this.fqn.$secure,
|
|
39
|
+
this.dev.$secure,
|
|
40
|
+
this.log.$secure,
|
|
41
|
+
this.error.$secure,
|
|
42
|
+
this.assertion.$secure,
|
|
43
|
+
this.to.$secure,
|
|
44
|
+
this.descriptor.$secure,
|
|
45
|
+
this.wrapper.$secure,
|
|
46
|
+
];
|
|
47
|
+
members.forEach(member => member.$init(this));
|
|
48
|
+
this.$lazyRun(() => {
|
|
49
|
+
this.fqn.register(null, Leyyo, 'class', internal_1.FQN_PCK);
|
|
50
|
+
});
|
|
51
|
+
this._earlyCallbacks.forEach(fn => fn());
|
|
52
|
+
this._lazyCallbacks.forEach(fn => fn());
|
|
53
|
+
members.forEach(member => {
|
|
54
|
+
this.descriptor.remove(member, '$init');
|
|
55
|
+
});
|
|
56
|
+
['$secure', '$back', '$earlyRun', '$lazyRun', '_lazyCallbacks', '_earlyCallbacks'].forEach(field => {
|
|
57
|
+
this.descriptor.remove(this, field);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// region secure
|
|
61
|
+
get $secure() {
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
get $back() {
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
$earlyRun(fn) {
|
|
68
|
+
this._earlyCallbacks.push(fn);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
$lazyRun(fn) {
|
|
72
|
+
this._lazyCallbacks.push(fn);
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Leyyo = Leyyo;
|
|
77
|
+
//# sourceMappingURL=leyyo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leyyo.js","sourceRoot":"","sources":["../../src/leyyo/leyyo.ts"],"names":[],"mappings":";;;AACA,0CAAoC;AAapC,2DAAqD;AACrD,+CAAyC;AACzC,qDAA+C;AAC/C,qDAA+C;AAC/C,kDAA4C;AAC5C,kDAA4C;AAC5C,oEAA8D;AAC9D,wDAAkD;AAClD,oEAA8D;AAC9D,+CA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CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;CAGJ;AAjFD,sBAiFC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LeyyoLike } from "../leyyo";
|
|
2
|
+
import { CommonLogLike, CommonLogSecure, Logger, LogLine } from "./index-types";
|
|
3
|
+
export declare class CommonLog implements CommonLogLike, CommonLogSecure {
|
|
4
|
+
private hook;
|
|
5
|
+
private dev;
|
|
6
|
+
constructor();
|
|
7
|
+
get $secure(): CommonLogSecure;
|
|
8
|
+
$init(leyyo: LeyyoLike): void;
|
|
9
|
+
create(clazz: Object | Function | string): Logger;
|
|
10
|
+
apply(line: LogLine): void;
|
|
11
|
+
private check;
|
|
12
|
+
private print;
|
|
13
|
+
get $back(): CommonLogLike;
|
|
14
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommonLog = void 0;
|
|
4
|
+
const leyyo_1 = require("../leyyo");
|
|
5
|
+
const logger_instance_1 = require("./logger-instance");
|
|
6
|
+
const internal_1 = require("../internal");
|
|
7
|
+
const severity_1 = require("./severity");
|
|
8
|
+
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
9
|
+
class CommonLog {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.create.bind(this);
|
|
12
|
+
this.apply.bind(this);
|
|
13
|
+
this.check.bind(this);
|
|
14
|
+
this.print.bind(this);
|
|
15
|
+
}
|
|
16
|
+
get $secure() {
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
$init(leyyo) {
|
|
20
|
+
this.hook = leyyo.hook;
|
|
21
|
+
this.dev = leyyo.dev;
|
|
22
|
+
// @formatter:off
|
|
23
|
+
leyyo.$secure.
|
|
24
|
+
$earlyRun(() => {
|
|
25
|
+
logger_instance_1.LoggerInstance.$setLeyyo(leyyo);
|
|
26
|
+
}).
|
|
27
|
+
$lazyRun(() => {
|
|
28
|
+
const fields = ['create', 'apply', 'check', 'print'];
|
|
29
|
+
const rec = { proper: false };
|
|
30
|
+
fields.forEach(field => {
|
|
31
|
+
rec[field] = this[field];
|
|
32
|
+
});
|
|
33
|
+
// define itself temporarily for log operations
|
|
34
|
+
this.hook.defineProvider(leyyo_1.LeyyoCommonHook.logAttached, CommonLog, rec);
|
|
35
|
+
// when new log provider is defined, replace all common methods
|
|
36
|
+
this.hook.whenProviderDefined(leyyo_1.LeyyoCommonHook.logAttached, CommonLog, (ins) => {
|
|
37
|
+
fields.forEach(field => {
|
|
38
|
+
if (typeof ins[field] === 'function') {
|
|
39
|
+
this[field] = ins[field];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}).
|
|
44
|
+
$lazyRun(() => {
|
|
45
|
+
leyyo.fqn.register(null, CommonLog, 'class', internal_1.FQN_PCK);
|
|
46
|
+
leyyo.fqn.register(null, logger_instance_1.LoggerInstance, 'class', internal_1.FQN_PCK);
|
|
47
|
+
const enumMap = {
|
|
48
|
+
Severity: severity_1.SeverityItems,
|
|
49
|
+
};
|
|
50
|
+
for (const [name, value] of Object.entries(enumMap)) {
|
|
51
|
+
leyyo.fqn.register(name, value, 'enum', internal_1.FQN_PCK);
|
|
52
|
+
leyyo.hook.queueForCallback(leyyo_1.LeyyoCommonHook.enumPendingRegister, value);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// @formatter:off
|
|
56
|
+
}
|
|
57
|
+
create(clazz) {
|
|
58
|
+
const ins = new logger_instance_1.LoggerInstance(clazz);
|
|
59
|
+
this.hook.queueForCallback(leyyo_1.LeyyoCommonHook.logPendingRegister, ins, clazz);
|
|
60
|
+
return ins;
|
|
61
|
+
}
|
|
62
|
+
apply(line) {
|
|
63
|
+
if ((global === null || global === void 0 ? void 0 : global.leyyo_is_testing) || !line) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const lineEnhanced = line;
|
|
67
|
+
lineEnhanced.time = new Date();
|
|
68
|
+
lineEnhanced.where = this.dev.fetch(lineEnhanced, 'where');
|
|
69
|
+
this.check(lineEnhanced);
|
|
70
|
+
this.print(lineEnhanced);
|
|
71
|
+
}
|
|
72
|
+
check(line) {
|
|
73
|
+
// nothing
|
|
74
|
+
}
|
|
75
|
+
print(line) {
|
|
76
|
+
var _a;
|
|
77
|
+
const where = line.where ? ` [${line.where}]` : '';
|
|
78
|
+
const date = line.time.toISOString();
|
|
79
|
+
const params = (_a = line.params) !== null && _a !== void 0 ? _a : '';
|
|
80
|
+
if (console[line.severity]) {
|
|
81
|
+
console[line.severity](`${date.substring(8, 10)}-${date.substring(11, 23)} | ${line.severity}${where} ${line.message}`, params);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
console.log(`${line.time.toISOString().substring(10, 19)} | ${line.severity}${where} ${line.message}`, params);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
get $back() {
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.CommonLog = CommonLog;
|
|
92
|
+
//# sourceMappingURL=common-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-log.js","sourceRoot":"","sources":["../../src/log/common-log.ts"],"names":[],"mappings":";;;AAAA,oCAAoD;AAEpD,uDAAiD;AAGjD,0CAAoC;AACpC,yCAAyC;AAGzC,0DAA0D;AAC1D,MAAa,SAAS;IAIlB;QACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,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QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,QAAQ,GAAG,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QACpI,CAAC;aACI,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,QAAQ,GAAG,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QACnH,CAAC;IACL,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;CAIJ;AAlGD,8BAkGC"}
|
|
@@ -1,5 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Dict, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
import { HookDefinedProvider } from "../hook";
|
|
3
|
+
import { DevOpt } from "../developer";
|
|
4
|
+
import { Severity } from "./severity";
|
|
5
|
+
export interface CommonLogLike extends ShiftSecure<CommonLogSecure>, LogConsumer {
|
|
3
6
|
create(clazz: Object | Function | string): Logger;
|
|
4
7
|
}
|
|
5
|
-
export type CommonLogSecure = ShiftMain<
|
|
8
|
+
export type CommonLogSecure = ShiftMain<CommonLogLike> & InitLike;
|
|
9
|
+
export interface LogDefinedProvider extends HookDefinedProvider {
|
|
10
|
+
create?(clazz: Object | Function | string): Logger;
|
|
11
|
+
apply?(line: LogLine): void;
|
|
12
|
+
check?<T>(line: LogLineEnhanced<T>): void;
|
|
13
|
+
print<T>(line: LogLineEnhanced<T>): void;
|
|
14
|
+
}
|
|
15
|
+
export interface LogConsumer {
|
|
16
|
+
apply(line: LogLine): void;
|
|
17
|
+
}
|
|
18
|
+
export interface LogLine {
|
|
19
|
+
severity: Severity;
|
|
20
|
+
message: string | Error;
|
|
21
|
+
params?: Dict;
|
|
22
|
+
}
|
|
23
|
+
export interface LogLineEnhanced<L = Dict> extends LogLine {
|
|
24
|
+
time?: Date;
|
|
25
|
+
where?: string;
|
|
26
|
+
locals?: L;
|
|
27
|
+
}
|
|
28
|
+
export interface Logger extends ShiftSecure<LoggerSecure> {
|
|
29
|
+
error(message: string, params?: any | DevOpt): void;
|
|
30
|
+
error(error: Error, params?: any | DevOpt): void;
|
|
31
|
+
error(whatever: any, params?: any | DevOpt): void;
|
|
32
|
+
error$(opt: DevOpt): void;
|
|
33
|
+
warn(message: string, params?: any | DevOpt): void;
|
|
34
|
+
warn(error: Error, params?: any | DevOpt): void;
|
|
35
|
+
warn(whatever: any, params?: any | DevOpt): void;
|
|
36
|
+
info(message: string, params?: any | DevOpt): void;
|
|
37
|
+
info(error: Error, params?: any | DevOpt): void;
|
|
38
|
+
info(whatever: any, params?: any | DevOpt): void;
|
|
39
|
+
log(message: string, params?: any | DevOpt): void;
|
|
40
|
+
log(error: Error, params?: any | DevOpt): void;
|
|
41
|
+
log(whatever: any, params?: any | DevOpt): void;
|
|
42
|
+
trace(message: string, params?: any | DevOpt): void;
|
|
43
|
+
trace(error: Error, params?: any | DevOpt): void;
|
|
44
|
+
trace(whatever: any, params?: any | DevOpt): void;
|
|
45
|
+
debug(message: string, params?: any | DevOpt): void;
|
|
46
|
+
debug(error: Error, params?: any | DevOpt): void;
|
|
47
|
+
debug(whatever: any, params?: any | DevOpt): void;
|
|
48
|
+
debug$?(opt: DevOpt): void;
|
|
49
|
+
warn$?(opt: DevOpt): void;
|
|
50
|
+
info$?(opt: DevOpt): void;
|
|
51
|
+
log$?(opt: DevOpt): void;
|
|
52
|
+
trace$?(opt: DevOpt): void;
|
|
53
|
+
}
|
|
54
|
+
export interface LoggerSecure extends ShiftMain<Logger> {
|
|
55
|
+
get $clazz(): Function;
|
|
56
|
+
get $name(): string;
|
|
57
|
+
$setMethod(method: Severity, lambda?: LoggerLambda): void;
|
|
58
|
+
}
|
|
59
|
+
export type LoggerLambda = (whatever: any, params?: any | DevOpt) => void;
|
package/dist/log/index-types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/log/index-types.ts"],"names":[],"mappings":""}
|
package/dist/log/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './index-types';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './logger-instance';
|
|
3
|
+
export * from './severity';
|
package/dist/log/index.js
CHANGED
|
@@ -15,5 +15,6 @@ 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("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./logger-instance"), exports);
|
|
19
|
+
__exportStar(require("./severity"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC;AAClC,6CAA2B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Logger, LoggerLambda, LoggerSecure } from "./index-types";
|
|
2
|
+
import { LeyyoLike } from "../leyyo";
|
|
3
|
+
import { DevOpt } from "../developer";
|
|
4
|
+
import { Severity } from "../index";
|
|
5
|
+
export declare class LoggerInstance implements Logger, LoggerSecure {
|
|
6
|
+
private readonly _clazz;
|
|
7
|
+
private _name;
|
|
8
|
+
private static _dev;
|
|
9
|
+
private static _fqn;
|
|
10
|
+
private static _log;
|
|
11
|
+
constructor(value: Object | Function | string);
|
|
12
|
+
private _prepare;
|
|
13
|
+
debug(message: any, params?: any | DevOpt): void;
|
|
14
|
+
error(message: any, params?: any | DevOpt): void;
|
|
15
|
+
info(message: any, params?: any | DevOpt): void;
|
|
16
|
+
log(message: any, params?: any | DevOpt): void;
|
|
17
|
+
trace(message: any, params?: any | DevOpt): void;
|
|
18
|
+
warn(message: any, params?: any | DevOpt): void;
|
|
19
|
+
get $back(): Logger;
|
|
20
|
+
get $secure(): LoggerSecure;
|
|
21
|
+
get $clazz(): Function;
|
|
22
|
+
get $name(): string;
|
|
23
|
+
static $setLeyyo(leyyo: LeyyoLike): void;
|
|
24
|
+
$setMethod(method: Severity, lambda?: LoggerLambda): void;
|
|
25
|
+
debug$(opt: DevOpt): void;
|
|
26
|
+
error$(opt: DevOpt): void;
|
|
27
|
+
info$(opt: DevOpt): void;
|
|
28
|
+
log$(opt: DevOpt): void;
|
|
29
|
+
trace$(opt: DevOpt): void;
|
|
30
|
+
warn$(opt: DevOpt): void;
|
|
31
|
+
}
|