typescript-class-helpers 13.2.3 → 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/browser/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/browser/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/browser/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/client/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# MyLib
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
-
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# MyLib
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
+
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|