typescript-class-helpers 13.2.2 → 13.2.4
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/app.js +3 -3
- package/browser/README.md +24 -24
- package/browser/esm2020/lib/classname.mjs +150 -150
- package/browser/esm2020/lib/describe-class.mjs +65 -65
- package/browser/esm2020/lib/errors-messages.mjs +3 -3
- package/browser/esm2020/lib/index.mjs +134 -134
- package/browser/esm2020/lib/models.mjs +26 -26
- package/browser/esm2020/lib/registerd-db.mjs +5 -5
- package/browser/esm2020/lib/set-class-name.mjs +89 -89
- package/browser/esm2020/lib/storage.mjs +23 -23
- package/browser/esm2020/lib/symbols.mjs +7 -7
- package/browser/esm2020/public-api.mjs +1 -1
- package/browser/esm2020/typescript-class-helpers.mjs +4 -4
- package/browser/fesm2015/typescript-class-helpers.mjs +470 -470
- package/browser/fesm2020/typescript-class-helpers.mjs +470 -470
- package/browser/lib/classname.d.ts +15 -15
- package/browser/lib/describe-class.d.ts +5 -5
- package/browser/lib/index.d.ts +32 -32
- package/browser/lib/models.d.ts +66 -66
- package/browser/lib/registerd-db.d.ts +4 -4
- package/browser/lib/set-class-name.d.ts +1 -1
- package/browser/lib/symbols.d.ts +5 -5
- package/browser/typescript-class-helpers.d.ts +4 -4
- package/client/README.md +24 -24
- package/client/esm2020/lib/classname.mjs +150 -150
- package/client/esm2020/lib/describe-class.mjs +65 -65
- package/client/esm2020/lib/errors-messages.mjs +3 -3
- package/client/esm2020/lib/index.mjs +134 -134
- package/client/esm2020/lib/models.mjs +26 -26
- package/client/esm2020/lib/registerd-db.mjs +5 -5
- package/client/esm2020/lib/set-class-name.mjs +89 -89
- package/client/esm2020/lib/storage.mjs +23 -23
- package/client/esm2020/lib/symbols.mjs +7 -7
- package/client/esm2020/public-api.mjs +1 -1
- package/client/esm2020/typescript-class-helpers.mjs +4 -4
- package/client/fesm2015/typescript-class-helpers.mjs +470 -470
- package/client/fesm2020/typescript-class-helpers.mjs +470 -470
- package/client/lib/classname.d.ts +15 -15
- package/client/lib/describe-class.d.ts +5 -5
- package/client/lib/index.d.ts +32 -32
- package/client/lib/models.d.ts +66 -66
- package/client/lib/registerd-db.d.ts +4 -4
- package/client/lib/set-class-name.d.ts +1 -1
- package/client/lib/symbols.d.ts +5 -5
- package/client/typescript-class-helpers.d.ts +4 -4
- package/index.d.ts +1 -1
- package/lib/classname.d.ts +16 -16
- package/lib/describe-class.d.ts +6 -6
- package/lib/errors-messages.d.ts +1 -1
- package/lib/index.d.ts +33 -33
- package/lib/models.d.ts +68 -68
- package/lib/registerd-db.d.ts +5 -5
- package/lib/set-class-name.d.ts +2 -2
- package/lib/storage.d.ts +1 -1
- package/lib/symbols.d.ts +6 -6
- package/package.json +3 -3
- package/package.json_devDependencies.json +223 -223
- package/package.json_tnp.json5 +48 -48
- package/tmp-environment.json +13 -13
- package/websql/README.md +24 -24
- package/websql/esm2020/lib/classname.mjs +150 -150
- package/websql/esm2020/lib/describe-class.mjs +65 -65
- package/websql/esm2020/lib/errors-messages.mjs +3 -3
- package/websql/esm2020/lib/index.mjs +134 -134
- package/websql/esm2020/lib/models.mjs +24 -24
- package/websql/esm2020/lib/registerd-db.mjs +5 -5
- package/websql/esm2020/lib/set-class-name.mjs +89 -89
- package/websql/esm2020/lib/storage.mjs +23 -23
- package/websql/esm2020/lib/symbols.mjs +7 -7
- package/websql/esm2020/public-api.mjs +1 -1
- package/websql/esm2020/typescript-class-helpers.mjs +4 -4
- package/websql/fesm2015/typescript-class-helpers.mjs +468 -468
- package/websql/fesm2020/typescript-class-helpers.mjs +468 -468
- package/websql/lib/classname.d.ts +15 -15
- package/websql/lib/describe-class.d.ts +5 -5
- package/websql/lib/index.d.ts +32 -32
- package/websql/lib/models.d.ts +67 -67
- package/websql/lib/registerd-db.d.ts +4 -4
- package/websql/lib/set-class-name.d.ts +1 -1
- package/websql/lib/symbols.d.ts +5 -5
- package/websql/typescript-class-helpers.d.ts +4 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { Models } from './models';
|
|
3
|
-
export declare namespace CLASSNAME {
|
|
4
|
-
function getClassConfig(target: Function, configs?: Models.ClassConfig[], callerTarget?: Function): Models.ClassConfig[];
|
|
5
|
-
/**
|
|
6
|
-
* PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE
|
|
7
|
-
* Decorator requred for production mode
|
|
8
|
-
* @param name Name of class
|
|
9
|
-
*/
|
|
10
|
-
function CLASSNAME(className: string, options?: Models.CLASSNAMEOptions): any;
|
|
11
|
-
function getClassName(target: Function, production?: boolean): string;
|
|
12
|
-
function getObjectIndexPropertyValue(obj: any): string;
|
|
13
|
-
function getClassFamilyByClassName(className: string): string;
|
|
14
|
-
function getObjectClassFamily(obj: any): string;
|
|
15
|
-
function getObjectIndexValue(obj: any): any;
|
|
16
|
-
function getClassBy(className: string | Function): Function;
|
|
2
|
+
import { Models } from './models';
|
|
3
|
+
export declare namespace CLASSNAME {
|
|
4
|
+
function getClassConfig(target: Function, configs?: Models.ClassConfig[], callerTarget?: Function): Models.ClassConfig[];
|
|
5
|
+
/**
|
|
6
|
+
* PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE
|
|
7
|
+
* Decorator requred for production mode
|
|
8
|
+
* @param name Name of class
|
|
9
|
+
*/
|
|
10
|
+
function CLASSNAME(className: string, options?: Models.CLASSNAMEOptions): any;
|
|
11
|
+
function getClassName(target: Function, production?: boolean): string;
|
|
12
|
+
function getObjectIndexPropertyValue(obj: any): string;
|
|
13
|
+
function getClassFamilyByClassName(className: string): string;
|
|
14
|
+
function getObjectClassFamily(obj: any): string;
|
|
15
|
+
function getObjectIndexValue(obj: any): any;
|
|
16
|
+
function getClassBy(className: string | Function): Function;
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
export declare function describeFromClassStringify(target: Function, parent?: boolean): string[];
|
|
3
|
-
/**
|
|
4
|
-
* Describe fields assigne through @DefaultModelWithMapping decorator
|
|
5
|
-
* without functions
|
|
6
|
-
*/
|
|
2
|
+
export declare function describeFromClassStringify(target: Function, parent?: boolean): string[];
|
|
3
|
+
/**
|
|
4
|
+
* Describe fields assigne through @DefaultModelWithMapping decorator
|
|
5
|
+
* without functions
|
|
6
|
+
*/
|
|
7
7
|
export declare function describeByDefaultModelsAndMapping(target: Function): string[];
|
package/client/lib/index.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CLASSNAME } from './classname';
|
|
3
|
-
import { Models } from './models';
|
|
4
|
-
import { setClassName } from './set-class-name';
|
|
5
|
-
export { Models } from './models';
|
|
6
|
-
export { SYMBOL } from './symbols';
|
|
7
|
-
export declare class TchHelpers {
|
|
8
|
-
static getBy(className: string | Function): Function;
|
|
9
|
-
static getFromObject(o: Object): any;
|
|
10
|
-
static getName(target: Function, production?: boolean): string;
|
|
11
|
-
static getNameFromObject(o: Object): string;
|
|
12
|
-
static getConfigs(target: Function): Models.ClassConfig[];
|
|
13
|
-
static describeProperites(target: Function): string[];
|
|
14
|
-
}
|
|
15
|
-
export declare const CLASS: {
|
|
16
|
-
NAME: typeof CLASSNAME.CLASSNAME;
|
|
17
|
-
setName: typeof setClassName;
|
|
18
|
-
getBy: typeof TchHelpers.getBy;
|
|
19
|
-
getSingleton<T = any>(target: Function): T;
|
|
20
|
-
setSingletonObj(target: Function, singletonObject: any): void;
|
|
21
|
-
getConfigs: typeof TchHelpers.getConfigs;
|
|
22
|
-
getConfig: (target: Function) => Models.ClassConfig;
|
|
23
|
-
getFromObject: typeof TchHelpers.getFromObject;
|
|
24
|
-
getName: typeof TchHelpers.getName;
|
|
25
|
-
getNameFromObject: typeof TchHelpers.getNameFromObject;
|
|
26
|
-
describeProperites: typeof TchHelpers.describeProperites;
|
|
27
|
-
OBJECT: (obj: any) => {
|
|
28
|
-
readonly indexValue: any;
|
|
29
|
-
readonly indexProperty: string;
|
|
30
|
-
readonly isClassObject: boolean;
|
|
31
|
-
isEqual: (anotherObj: any, compareDeep?: boolean) => boolean;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
2
|
+
import { CLASSNAME } from './classname';
|
|
3
|
+
import { Models } from './models';
|
|
4
|
+
import { setClassName } from './set-class-name';
|
|
5
|
+
export { Models } from './models';
|
|
6
|
+
export { SYMBOL } from './symbols';
|
|
7
|
+
export declare class TchHelpers {
|
|
8
|
+
static getBy(className: string | Function): Function;
|
|
9
|
+
static getFromObject(o: Object): any;
|
|
10
|
+
static getName(target: Function, production?: boolean): string;
|
|
11
|
+
static getNameFromObject(o: Object): string;
|
|
12
|
+
static getConfigs(target: Function): Models.ClassConfig[];
|
|
13
|
+
static describeProperites(target: Function): string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const CLASS: {
|
|
16
|
+
NAME: typeof CLASSNAME.CLASSNAME;
|
|
17
|
+
setName: typeof setClassName;
|
|
18
|
+
getBy: typeof TchHelpers.getBy;
|
|
19
|
+
getSingleton<T = any>(target: Function): T;
|
|
20
|
+
setSingletonObj(target: Function, singletonObject: any): void;
|
|
21
|
+
getConfigs: typeof TchHelpers.getConfigs;
|
|
22
|
+
getConfig: (target: Function) => Models.ClassConfig;
|
|
23
|
+
getFromObject: typeof TchHelpers.getFromObject;
|
|
24
|
+
getName: typeof TchHelpers.getName;
|
|
25
|
+
getNameFromObject: typeof TchHelpers.getNameFromObject;
|
|
26
|
+
describeProperites: typeof TchHelpers.describeProperites;
|
|
27
|
+
OBJECT: (obj: any) => {
|
|
28
|
+
readonly indexValue: any;
|
|
29
|
+
readonly indexProperty: string;
|
|
30
|
+
readonly isClassObject: boolean;
|
|
31
|
+
isEqual: (anotherObj: any, compareDeep?: boolean) => boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
34
|
export * from 'enum-values';
|
package/client/lib/models.d.ts
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { ConfigModels } from 'tnp-config/browser';
|
|
3
|
-
export declare namespace Models {
|
|
4
|
-
type CLASSNAMEOptions = {
|
|
5
|
-
uniqueKey?: string;
|
|
6
|
-
/**
|
|
7
|
-
* autoinstance - create instance of singleton automaticly inside decorator
|
|
8
|
-
* first-instance - use first instace of created class as decorator
|
|
9
|
-
*/
|
|
10
|
-
singleton?: 'autoinstance' | 'first-instance' | 'last-instance' | boolean;
|
|
11
|
-
classFamily?: string;
|
|
12
|
-
classNameInBrowser?: string;
|
|
13
|
-
};
|
|
14
|
-
class ParamConfig {
|
|
15
|
-
paramName: string;
|
|
16
|
-
paramType: ConfigModels.ParamType;
|
|
17
|
-
index: number;
|
|
18
|
-
defaultType: any;
|
|
19
|
-
expireInSeconds?: number;
|
|
20
|
-
}
|
|
21
|
-
class MethodConfig {
|
|
22
|
-
methodName: string;
|
|
23
|
-
/**
|
|
24
|
-
* path is global in express app
|
|
25
|
-
*/
|
|
26
|
-
global?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* override default content type
|
|
29
|
-
*/
|
|
30
|
-
contentType?: any;
|
|
31
|
-
/**
|
|
32
|
-
* override default axiso response type
|
|
33
|
-
*/
|
|
34
|
-
responseType?: any;
|
|
35
|
-
path: string;
|
|
36
|
-
descriptor: PropertyDescriptor;
|
|
37
|
-
type: ConfigModels.HttpMethod;
|
|
38
|
-
parameters: {
|
|
39
|
-
[paramName: string]: ParamConfig;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface ClassMeta {
|
|
43
|
-
uniqueKey?: string;
|
|
44
|
-
className?: string;
|
|
45
|
-
classFamily?: string;
|
|
46
|
-
classNameInBrowser?: string;
|
|
47
|
-
target?: Function;
|
|
48
|
-
}
|
|
49
|
-
class ClassConfig {
|
|
50
|
-
browserTransformFn?: (entity: any) => any;
|
|
51
|
-
singleton: Object;
|
|
52
|
-
injections: {
|
|
53
|
-
getter: Function;
|
|
54
|
-
propertyName: string;
|
|
55
|
-
}[];
|
|
56
|
-
calculatedPath: string;
|
|
57
|
-
path: string;
|
|
58
|
-
vChildren?: ClassConfig[];
|
|
59
|
-
vParent?: ClassConfig;
|
|
60
|
-
classReference: Function;
|
|
61
|
-
className?: string;
|
|
62
|
-
uniqueKey?: string;
|
|
63
|
-
classNameInBrowser?: string;
|
|
64
|
-
methods: {
|
|
65
|
-
[methodName: string]: MethodConfig;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
2
|
+
import { ConfigModels } from 'tnp-config/browser';
|
|
3
|
+
export declare namespace Models {
|
|
4
|
+
type CLASSNAMEOptions = {
|
|
5
|
+
uniqueKey?: string;
|
|
6
|
+
/**
|
|
7
|
+
* autoinstance - create instance of singleton automaticly inside decorator
|
|
8
|
+
* first-instance - use first instace of created class as decorator
|
|
9
|
+
*/
|
|
10
|
+
singleton?: 'autoinstance' | 'first-instance' | 'last-instance' | boolean;
|
|
11
|
+
classFamily?: string;
|
|
12
|
+
classNameInBrowser?: string;
|
|
13
|
+
};
|
|
14
|
+
class ParamConfig {
|
|
15
|
+
paramName: string;
|
|
16
|
+
paramType: ConfigModels.ParamType;
|
|
17
|
+
index: number;
|
|
18
|
+
defaultType: any;
|
|
19
|
+
expireInSeconds?: number;
|
|
20
|
+
}
|
|
21
|
+
class MethodConfig {
|
|
22
|
+
methodName: string;
|
|
23
|
+
/**
|
|
24
|
+
* path is global in express app
|
|
25
|
+
*/
|
|
26
|
+
global?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* override default content type
|
|
29
|
+
*/
|
|
30
|
+
contentType?: any;
|
|
31
|
+
/**
|
|
32
|
+
* override default axiso response type
|
|
33
|
+
*/
|
|
34
|
+
responseType?: any;
|
|
35
|
+
path: string;
|
|
36
|
+
descriptor: PropertyDescriptor;
|
|
37
|
+
type: ConfigModels.HttpMethod;
|
|
38
|
+
parameters: {
|
|
39
|
+
[paramName: string]: ParamConfig;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface ClassMeta {
|
|
43
|
+
uniqueKey?: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
classFamily?: string;
|
|
46
|
+
classNameInBrowser?: string;
|
|
47
|
+
target?: Function;
|
|
48
|
+
}
|
|
49
|
+
class ClassConfig {
|
|
50
|
+
browserTransformFn?: (entity: any) => any;
|
|
51
|
+
singleton: Object;
|
|
52
|
+
injections: {
|
|
53
|
+
getter: Function;
|
|
54
|
+
propertyName: string;
|
|
55
|
+
}[];
|
|
56
|
+
calculatedPath: string;
|
|
57
|
+
path: string;
|
|
58
|
+
vChildren?: ClassConfig[];
|
|
59
|
+
vParent?: ClassConfig;
|
|
60
|
+
classReference: Function;
|
|
61
|
+
className?: string;
|
|
62
|
+
uniqueKey?: string;
|
|
63
|
+
classNameInBrowser?: string;
|
|
64
|
+
methods: {
|
|
65
|
+
[methodName: string]: MethodConfig;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { Models } from './models';
|
|
3
|
-
export declare const registerd: {
|
|
4
|
-
configs: Models.ClassConfig[];
|
|
5
|
-
classes: Function[];
|
|
2
|
+
import { Models } from './models';
|
|
3
|
+
export declare const registerd: {
|
|
4
|
+
configs: Models.ClassConfig[];
|
|
5
|
+
classes: Function[];
|
|
6
6
|
};
|
package/client/lib/symbols.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
export declare const SYMBOL: {
|
|
3
|
-
MODELS_MAPPING: symbol;
|
|
4
|
-
DEFAULT_MODEL: symbol;
|
|
5
|
-
STORAGE: string;
|
|
6
|
-
CLASSES: string;
|
|
2
|
+
export declare const SYMBOL: {
|
|
3
|
+
MODELS_MAPPING: symbol;
|
|
4
|
+
DEFAULT_MODEL: symbol;
|
|
5
|
+
STORAGE: string;
|
|
6
|
+
CLASSES: string;
|
|
7
7
|
};
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './lib';
|
|
1
|
+
export * from './lib';
|
package/lib/classname.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Models } from './models';
|
|
2
|
-
export declare namespace CLASSNAME {
|
|
3
|
-
function getClassConfig(target: Function, configs?: Models.ClassConfig[], callerTarget?: Function): Models.ClassConfig[];
|
|
4
|
-
/**
|
|
5
|
-
* PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE
|
|
6
|
-
* Decorator requred for production mode
|
|
7
|
-
* @param name Name of class
|
|
8
|
-
*/
|
|
9
|
-
function CLASSNAME(className: string, options?: Models.CLASSNAMEOptions): any;
|
|
10
|
-
function getClassName(target: Function, production?: boolean): string;
|
|
11
|
-
function getObjectIndexPropertyValue(obj: any): string;
|
|
12
|
-
function getClassFamilyByClassName(className: string): string;
|
|
13
|
-
function getObjectClassFamily(obj: any): string;
|
|
14
|
-
function getObjectIndexValue(obj: any): any;
|
|
15
|
-
function getClassBy(className: string | Function): Function;
|
|
16
|
-
}
|
|
1
|
+
import { Models } from './models';
|
|
2
|
+
export declare namespace CLASSNAME {
|
|
3
|
+
function getClassConfig(target: Function, configs?: Models.ClassConfig[], callerTarget?: Function): Models.ClassConfig[];
|
|
4
|
+
/**
|
|
5
|
+
* PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE
|
|
6
|
+
* Decorator requred for production mode
|
|
7
|
+
* @param name Name of class
|
|
8
|
+
*/
|
|
9
|
+
function CLASSNAME(className: string, options?: Models.CLASSNAMEOptions): any;
|
|
10
|
+
function getClassName(target: Function, production?: boolean): string;
|
|
11
|
+
function getObjectIndexPropertyValue(obj: any): string;
|
|
12
|
+
function getClassFamilyByClassName(className: string): string;
|
|
13
|
+
function getObjectClassFamily(obj: any): string;
|
|
14
|
+
function getObjectIndexValue(obj: any): any;
|
|
15
|
+
function getClassBy(className: string | Function): Function;
|
|
16
|
+
}
|
package/lib/describe-class.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function describeFromClassStringify(target: Function, parent?: boolean): string[];
|
|
2
|
-
/**
|
|
3
|
-
* Describe fields assigne through @DefaultModelWithMapping decorator
|
|
4
|
-
* without functions
|
|
5
|
-
*/
|
|
6
|
-
export declare function describeByDefaultModelsAndMapping(target: Function): string[];
|
|
1
|
+
export declare function describeFromClassStringify(target: Function, parent?: boolean): string[];
|
|
2
|
+
/**
|
|
3
|
+
* Describe fields assigne through @DefaultModelWithMapping decorator
|
|
4
|
+
* without functions
|
|
5
|
+
*/
|
|
6
|
+
export declare function describeByDefaultModelsAndMapping(target: Function): string[];
|
package/lib/errors-messages.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ERROR_MSG_CLASS_WITHOUT_DECORATOR = "[typescript-class-helpers][getClassName(...)](PRODUCTION MODE ERROR)\nPlease use decoartor @CLASSNAME for each entity or controller\nThis is preventing class name problem in minified code.\n\nimport { CLASS } from 'typescript-class-helpers';\n\n@CLASS.NAME('ExampleClass')\nclass ExampleClass {\n ...\n}\n";
|
|
1
|
+
export declare const ERROR_MSG_CLASS_WITHOUT_DECORATOR = "[typescript-class-helpers][getClassName(...)](PRODUCTION MODE ERROR)\nPlease use decoartor @CLASSNAME for each entity or controller\nThis is preventing class name problem in minified code.\n\nimport { CLASS } from 'typescript-class-helpers';\n\n@CLASS.NAME('ExampleClass')\nclass ExampleClass {\n ...\n}\n";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { CLASSNAME } from './classname';
|
|
2
|
-
import { Models } from './models';
|
|
3
|
-
import { setClassName } from './set-class-name';
|
|
4
|
-
export { Models } from './models';
|
|
5
|
-
export { SYMBOL } from './symbols';
|
|
6
|
-
export declare class TchHelpers {
|
|
7
|
-
static getBy(className: string | Function): Function;
|
|
8
|
-
static getFromObject(o: Object): any;
|
|
9
|
-
static getName(target: Function, production?: boolean): string;
|
|
10
|
-
static getNameFromObject(o: Object): string;
|
|
11
|
-
static getConfigs(target: Function): Models.ClassConfig[];
|
|
12
|
-
static describeProperites(target: Function): string[];
|
|
13
|
-
}
|
|
14
|
-
export declare const CLASS: {
|
|
15
|
-
NAME: typeof CLASSNAME.CLASSNAME;
|
|
16
|
-
setName: typeof setClassName;
|
|
17
|
-
getBy: typeof TchHelpers.getBy;
|
|
18
|
-
getSingleton<T = any>(target: Function): T;
|
|
19
|
-
setSingletonObj(target: Function, singletonObject: any): void;
|
|
20
|
-
getConfigs: typeof TchHelpers.getConfigs;
|
|
21
|
-
getConfig: (target: Function) => Models.ClassConfig;
|
|
22
|
-
getFromObject: typeof TchHelpers.getFromObject;
|
|
23
|
-
getName: typeof TchHelpers.getName;
|
|
24
|
-
getNameFromObject: typeof TchHelpers.getNameFromObject;
|
|
25
|
-
describeProperites: typeof TchHelpers.describeProperites;
|
|
26
|
-
OBJECT: (obj: any) => {
|
|
27
|
-
readonly indexValue: any;
|
|
28
|
-
readonly indexProperty: string;
|
|
29
|
-
readonly isClassObject: boolean;
|
|
30
|
-
isEqual: (anotherObj: any, compareDeep?: boolean) => boolean;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export * from 'enum-values';
|
|
1
|
+
import { CLASSNAME } from './classname';
|
|
2
|
+
import { Models } from './models';
|
|
3
|
+
import { setClassName } from './set-class-name';
|
|
4
|
+
export { Models } from './models';
|
|
5
|
+
export { SYMBOL } from './symbols';
|
|
6
|
+
export declare class TchHelpers {
|
|
7
|
+
static getBy(className: string | Function): Function;
|
|
8
|
+
static getFromObject(o: Object): any;
|
|
9
|
+
static getName(target: Function, production?: boolean): string;
|
|
10
|
+
static getNameFromObject(o: Object): string;
|
|
11
|
+
static getConfigs(target: Function): Models.ClassConfig[];
|
|
12
|
+
static describeProperites(target: Function): string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const CLASS: {
|
|
15
|
+
NAME: typeof CLASSNAME.CLASSNAME;
|
|
16
|
+
setName: typeof setClassName;
|
|
17
|
+
getBy: typeof TchHelpers.getBy;
|
|
18
|
+
getSingleton<T = any>(target: Function): T;
|
|
19
|
+
setSingletonObj(target: Function, singletonObject: any): void;
|
|
20
|
+
getConfigs: typeof TchHelpers.getConfigs;
|
|
21
|
+
getConfig: (target: Function) => Models.ClassConfig;
|
|
22
|
+
getFromObject: typeof TchHelpers.getFromObject;
|
|
23
|
+
getName: typeof TchHelpers.getName;
|
|
24
|
+
getNameFromObject: typeof TchHelpers.getNameFromObject;
|
|
25
|
+
describeProperites: typeof TchHelpers.describeProperites;
|
|
26
|
+
OBJECT: (obj: any) => {
|
|
27
|
+
readonly indexValue: any;
|
|
28
|
+
readonly indexProperty: string;
|
|
29
|
+
readonly isClassObject: boolean;
|
|
30
|
+
isEqual: (anotherObj: any, compareDeep?: boolean) => boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export * from 'enum-values';
|
package/lib/models.d.ts
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { ConfigModels } from 'tnp-config';
|
|
2
|
-
export declare namespace Models {
|
|
3
|
-
type CLASSNAMEOptions = {
|
|
4
|
-
uniqueKey?: string;
|
|
5
|
-
/**
|
|
6
|
-
* autoinstance - create instance of singleton automaticly inside decorator
|
|
7
|
-
* first-instance - use first instace of created class as decorator
|
|
8
|
-
*/
|
|
9
|
-
singleton?: 'autoinstance' | 'first-instance' | 'last-instance' | boolean;
|
|
10
|
-
classFamily?: string;
|
|
11
|
-
classNameInBrowser?: string;
|
|
12
|
-
};
|
|
13
|
-
class ParamConfig {
|
|
14
|
-
paramName: string;
|
|
15
|
-
paramType: ConfigModels.ParamType;
|
|
16
|
-
index: number;
|
|
17
|
-
defaultType: any;
|
|
18
|
-
expireInSeconds?: number;
|
|
19
|
-
}
|
|
20
|
-
class MethodConfig {
|
|
21
|
-
methodName: string;
|
|
22
|
-
/**
|
|
23
|
-
* path is global in express app
|
|
24
|
-
*/
|
|
25
|
-
global?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* override default content type
|
|
28
|
-
*/
|
|
29
|
-
contentType?: any;
|
|
30
|
-
/**
|
|
31
|
-
* override default axiso response type
|
|
32
|
-
*/
|
|
33
|
-
responseType?: any;
|
|
34
|
-
path: string;
|
|
35
|
-
descriptor: PropertyDescriptor;
|
|
36
|
-
type: ConfigModels.HttpMethod;
|
|
37
|
-
requestHandler: any;
|
|
38
|
-
parameters: {
|
|
39
|
-
[paramName: string]: ParamConfig;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface ClassMeta {
|
|
43
|
-
uniqueKey?: string;
|
|
44
|
-
className?: string;
|
|
45
|
-
classFamily?: string;
|
|
46
|
-
classNameInBrowser?: string;
|
|
47
|
-
target?: Function;
|
|
48
|
-
}
|
|
49
|
-
class ClassConfig {
|
|
50
|
-
browserTransformFn?: (entity: any) => any;
|
|
51
|
-
singleton: Object;
|
|
52
|
-
injections: {
|
|
53
|
-
getter: Function;
|
|
54
|
-
propertyName: string;
|
|
55
|
-
}[];
|
|
56
|
-
calculatedPath: string;
|
|
57
|
-
path: string;
|
|
58
|
-
vChildren?: ClassConfig[];
|
|
59
|
-
vParent?: ClassConfig;
|
|
60
|
-
classReference: Function;
|
|
61
|
-
className?: string;
|
|
62
|
-
uniqueKey?: string;
|
|
63
|
-
classNameInBrowser?: string;
|
|
64
|
-
methods: {
|
|
65
|
-
[methodName: string]: MethodConfig;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
import { ConfigModels } from 'tnp-config';
|
|
2
|
+
export declare namespace Models {
|
|
3
|
+
type CLASSNAMEOptions = {
|
|
4
|
+
uniqueKey?: string;
|
|
5
|
+
/**
|
|
6
|
+
* autoinstance - create instance of singleton automaticly inside decorator
|
|
7
|
+
* first-instance - use first instace of created class as decorator
|
|
8
|
+
*/
|
|
9
|
+
singleton?: 'autoinstance' | 'first-instance' | 'last-instance' | boolean;
|
|
10
|
+
classFamily?: string;
|
|
11
|
+
classNameInBrowser?: string;
|
|
12
|
+
};
|
|
13
|
+
class ParamConfig {
|
|
14
|
+
paramName: string;
|
|
15
|
+
paramType: ConfigModels.ParamType;
|
|
16
|
+
index: number;
|
|
17
|
+
defaultType: any;
|
|
18
|
+
expireInSeconds?: number;
|
|
19
|
+
}
|
|
20
|
+
class MethodConfig {
|
|
21
|
+
methodName: string;
|
|
22
|
+
/**
|
|
23
|
+
* path is global in express app
|
|
24
|
+
*/
|
|
25
|
+
global?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* override default content type
|
|
28
|
+
*/
|
|
29
|
+
contentType?: any;
|
|
30
|
+
/**
|
|
31
|
+
* override default axiso response type
|
|
32
|
+
*/
|
|
33
|
+
responseType?: any;
|
|
34
|
+
path: string;
|
|
35
|
+
descriptor: PropertyDescriptor;
|
|
36
|
+
type: ConfigModels.HttpMethod;
|
|
37
|
+
requestHandler: any;
|
|
38
|
+
parameters: {
|
|
39
|
+
[paramName: string]: ParamConfig;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface ClassMeta {
|
|
43
|
+
uniqueKey?: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
classFamily?: string;
|
|
46
|
+
classNameInBrowser?: string;
|
|
47
|
+
target?: Function;
|
|
48
|
+
}
|
|
49
|
+
class ClassConfig {
|
|
50
|
+
browserTransformFn?: (entity: any) => any;
|
|
51
|
+
singleton: Object;
|
|
52
|
+
injections: {
|
|
53
|
+
getter: Function;
|
|
54
|
+
propertyName: string;
|
|
55
|
+
}[];
|
|
56
|
+
calculatedPath: string;
|
|
57
|
+
path: string;
|
|
58
|
+
vChildren?: ClassConfig[];
|
|
59
|
+
vParent?: ClassConfig;
|
|
60
|
+
classReference: Function;
|
|
61
|
+
className?: string;
|
|
62
|
+
uniqueKey?: string;
|
|
63
|
+
classNameInBrowser?: string;
|
|
64
|
+
methods: {
|
|
65
|
+
[methodName: string]: MethodConfig;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
package/lib/registerd-db.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Models } from './models';
|
|
2
|
-
export declare const registerd: {
|
|
3
|
-
configs: Models.ClassConfig[];
|
|
4
|
-
classes: Function[];
|
|
5
|
-
};
|
|
1
|
+
import { Models } from './models';
|
|
2
|
+
export declare const registerd: {
|
|
3
|
+
configs: Models.ClassConfig[];
|
|
4
|
+
classes: Function[];
|
|
5
|
+
};
|
package/lib/set-class-name.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Models } from './models';
|
|
2
|
-
export declare function setClassName(target: Function, className: string, options?: Models.CLASSNAMEOptions): (...args: any[]) => any;
|
|
1
|
+
import { Models } from './models';
|
|
2
|
+
export declare function setClassName(target: Function, className: string, options?: Models.CLASSNAMEOptions): (...args: any[]) => any;
|
package/lib/storage.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStorage<T = any>(property?: string): T;
|
|
1
|
+
export declare function getStorage<T = any>(property?: string): T;
|
package/lib/symbols.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const SYMBOL: {
|
|
2
|
-
MODELS_MAPPING: symbol;
|
|
3
|
-
DEFAULT_MODEL: symbol;
|
|
4
|
-
STORAGE: string;
|
|
5
|
-
CLASSES: string;
|
|
6
|
-
};
|
|
1
|
+
export declare const SYMBOL: {
|
|
2
|
+
MODELS_MAPPING: symbol;
|
|
3
|
+
DEFAULT_MODEL: symbol;
|
|
4
|
+
STORAGE: string;
|
|
5
|
+
CLASSES: string;
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-class-helpers",
|
|
3
3
|
"description": "Usefull helper to have in your typescript project",
|
|
4
|
-
"version": "13.2.
|
|
4
|
+
"version": "13.2.4",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "mocha --require ts-node/register src/**/*.spec.ts",
|
|
7
7
|
"test:watch": "mocha --compilers ts-node/register src/**/*.spec.ts --watch"
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"homepage": "https://github.com/darekf77/typescript-class-helpers#readme",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"enum-values": "1.2.1",
|
|
25
|
-
"ng2-logger": "~13.1.
|
|
25
|
+
"ng2-logger": "~13.1.18"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"private": false,
|
|
29
|
-
"lastBuildTagHash": "
|
|
29
|
+
"lastBuildTagHash": "2e1ef3f326452ea767ddf30aa13832bcbaef45c9",
|
|
30
30
|
"devDependencies": {}
|
|
31
31
|
}
|