@minimaltech/node-infra 0.5.8-10 → 0.5.8-11
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/common/types.d.ts
CHANGED
@@ -23,10 +23,9 @@ export type ClassType<T> = Function & {
|
|
23
23
|
prototype: T;
|
24
24
|
};
|
25
25
|
export type TStatusFromClass<T extends ClassType<AnyObject>> = ValueOf<Omit<T, 'prototype' | 'isValid' | 'SCHEME_SET' | 'TYPE_SET'>>;
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
export type TConstValue<T extends ClassType<AnyObject>> = ValueOf<Omit<T, 'prototype' | 'isValid' | 'SCHEME_SET' | 'TYPE_SET'>>;
|
26
|
+
export type TStringConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string>;
|
27
|
+
export type TNumberConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, number>;
|
28
|
+
export type TConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string | number>;
|
30
29
|
export type TPrettify<T> = {
|
31
30
|
[K in keyof T]: T[K];
|
32
31
|
} & {};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { TConstValue } from '../../../common/types';
|
2
2
|
export declare class LogLevels {
|
3
3
|
static readonly ERROR = "error";
|
4
4
|
static readonly ALERT = "alert";
|
@@ -12,4 +12,4 @@ export declare class LogLevels {
|
|
12
12
|
static readonly SCHEME_SET: Set<string>;
|
13
13
|
static isValid(input: string): boolean;
|
14
14
|
}
|
15
|
-
export type TLogLevel =
|
15
|
+
export type TLogLevel = TConstValue<typeof LogLevels>;
|