xdbc 1.0.211 → 1.0.213
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/.gitattributes +8 -0
- package/.github/workflows/ci.yml +51 -0
- package/.vscode/tasks.json +23 -23
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +1 -0
- package/__tests__/DBC/AE.test.ts +1 -1
- package/__tests__/DBC/DEFINED.test.ts +49 -49
- package/__tests__/DBC/Decorators.test.ts +334 -332
- package/__tests__/DBC/HasAttribute.test.ts +56 -52
- package/__tests__/DBC/IF.test.ts +57 -57
- package/__tests__/DBC/OR.test.ts +1 -1
- package/__tests__/DBC/UNDEFINED.test.ts +41 -41
- package/__tests__/DBC/ZOD.test.ts +50 -50
- package/biome.json +40 -33
- package/dist/DBC/AE.d.ts +117 -0
- package/dist/DBC/COMPARISON/GREATER.d.ts +13 -0
- package/dist/DBC/COMPARISON/GREATER_OR_EQUAL.d.ts +13 -0
- package/dist/DBC/COMPARISON/LESS.d.ts +13 -0
- package/dist/DBC/COMPARISON/LESS_OR_EQUAL.d.ts +13 -0
- package/dist/DBC/COMPARISON.d.ts +70 -0
- package/dist/DBC/DEFINED.d.ts +62 -0
- package/dist/DBC/EQ/DIFFERENT.d.ts +26 -0
- package/dist/DBC/EQ.d.ts +70 -0
- package/dist/DBC/HasAttribute.d.ts +72 -0
- package/dist/DBC/IF.d.ts +90 -0
- package/dist/DBC/INSTANCE.d.ts +84 -0
- package/dist/DBC/JSON.OP.d.ts +94 -0
- package/dist/DBC/JSON.Parse.d.ts +69 -0
- package/dist/DBC/OR.d.ts +104 -0
- package/dist/DBC/REGEX.d.ts +96 -0
- package/dist/DBC/TYPE.d.ts +75 -0
- package/dist/DBC/UNDEFINED.d.ts +62 -0
- package/dist/DBC/ZOD.d.ts +72 -0
- package/dist/DBC.d.ts +244 -0
- package/dist/Demo.d.ts +20 -0
- package/dist/bundle.js +2297 -0
- package/docs/assets/highlight.css +22 -22
- package/docs/assets/icons.js +17 -17
- package/docs/assets/main.js +60 -60
- package/docs/assets/style.css +1640 -1640
- package/docs/classes/DBC.DBC.html +98 -98
- package/docs/classes/DBC_AE.AE.html +160 -160
- package/docs/classes/DBC_EQ.EQ.html +131 -131
- package/docs/classes/DBC_GREATER.GREATER.html +139 -139
- package/docs/classes/DBC_INSTANCE.INSTANCE.html +130 -130
- package/docs/classes/DBC_JSON.OP.JSON_OP.html +138 -138
- package/docs/classes/DBC_JSON.Parse.JSON_Parse.html +129 -129
- package/docs/classes/DBC_OR.OR.html +137 -137
- package/docs/classes/DBC_REGEX.REGEX.html +136 -136
- package/docs/classes/DBC_TYPE.TYPE.html +130 -130
- package/docs/classes/Demo.Demo.html +14 -14
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/modules/DBC.html +1 -1
- package/docs/modules/DBC_AE.html +1 -1
- package/docs/modules/DBC_EQ.html +1 -1
- package/docs/modules/DBC_GREATER.html +1 -1
- package/docs/modules/DBC_INSTANCE.html +1 -1
- package/docs/modules/DBC_JSON.OP.html +1 -1
- package/docs/modules/DBC_JSON.Parse.html +1 -1
- package/docs/modules/DBC_OR.html +1 -1
- package/docs/modules/DBC_REGEX.html +1 -1
- package/docs/modules/DBC_TYPE.html +1 -1
- package/docs/modules/Demo.html +1 -1
- package/jest.config.js +29 -18
- package/package.json +6 -2
- package/src/DBC/AE.ts +14 -9
- package/src/DBC/COMPARISON/GREATER.ts +2 -2
- package/src/DBC/COMPARISON.ts +159 -136
- package/src/DBC/DEFINED.ts +10 -10
- package/src/DBC/EQ/DIFFERENT.ts +3 -3
- package/src/DBC/EQ.ts +25 -9
- package/src/DBC/HasAttribute.ts +17 -3
- package/src/DBC/IF.ts +63 -19
- package/src/DBC/INSTANCE.ts +29 -14
- package/src/DBC/JSON.OP.ts +18 -3
- package/src/DBC/JSON.Parse.ts +21 -4
- package/src/DBC/OR.ts +12 -7
- package/src/DBC/REGEX.ts +30 -21
- package/src/DBC/TYPE.ts +15 -11
- package/src/DBC/UNDEFINED.ts +7 -10
- package/src/DBC/ZOD.ts +14 -9
- package/src/DBC.ts +165 -69
- package/src/Demo.ts +21 -18
- package/test.drawio +0 -0
- package/tsconfig.json +3 -5
- package/tsconfig.test.json +6 -11
- package/webpack.config.js +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPARISON } from "../COMPARISON";
|
|
2
|
+
/** See {@link COMPARISON }. */
|
|
3
|
+
export declare class GREATER_OR_EQUAL extends COMPARISON {
|
|
4
|
+
equivalent: any;
|
|
5
|
+
/** See {@link COMPARISON.PRE }. */
|
|
6
|
+
static PRE(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
7
|
+
/** See {@link COMPARISON.POST }. */
|
|
8
|
+
static POST(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
9
|
+
/** See {@link COMPARISON.INVARIANT }. */
|
|
10
|
+
static INVARIANT(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
11
|
+
/** See {@link COMPARISON.constructor }. */
|
|
12
|
+
constructor(equivalent: any);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPARISON } from "../COMPARISON";
|
|
2
|
+
/** See {@link COMPARISON }. */
|
|
3
|
+
export declare class LESS extends COMPARISON {
|
|
4
|
+
equivalent: any;
|
|
5
|
+
/** See {@link COMPARISON.PRE }. */
|
|
6
|
+
static PRE(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
7
|
+
/** See {@link COMPARISON.POST }. */
|
|
8
|
+
static POST(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
9
|
+
/** See {@link COMPARISON.INVARIANT }. */
|
|
10
|
+
static INVARIANT(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
11
|
+
/** See {@link COMPARISON.constructor }. */
|
|
12
|
+
constructor(equivalent: any);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPARISON } from "../COMPARISON";
|
|
2
|
+
/** See {@link COMPARISON }. */
|
|
3
|
+
export declare class LESS_OR_EQUAL extends COMPARISON {
|
|
4
|
+
equivalent: any;
|
|
5
|
+
/** See {@link COMPARISON.PRE }. */
|
|
6
|
+
static PRE(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
7
|
+
/** See {@link COMPARISON.POST }. */
|
|
8
|
+
static POST(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
9
|
+
/** See {@link COMPARISON.INVARIANT }. */
|
|
10
|
+
static INVARIANT(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
11
|
+
/** See {@link COMPARISON.constructor }. */
|
|
12
|
+
constructor(equivalent: any);
|
|
13
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining a comparison between two {@link object }s.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class COMPARISON extends DBC {
|
|
8
|
+
equivalent: any;
|
|
9
|
+
equalityPermitted: boolean;
|
|
10
|
+
invert: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Does a comparison between the {@link object } **toCheck** and the **equivalent**.
|
|
13
|
+
*
|
|
14
|
+
* @param toCheck The value that has to be equal to it's possible **equivalent** for this {@link DBC } to be fulfilled.
|
|
15
|
+
* @param equivalent The {@link object } the one **toCheck** has to be equal to in order for this {@link DBC } to be
|
|
16
|
+
* fulfilled.
|
|
17
|
+
*
|
|
18
|
+
* @returns TRUE if the value **toCheck** and the **equivalent** are equal to each other, otherwise FALSE. */
|
|
19
|
+
static checkAlgorithm(toCheck: any, equivalent: any, equalityPermitted: boolean, invert: boolean): string | true;
|
|
20
|
+
/**
|
|
21
|
+
* A parameter-decorator factory using the {@link COMPARISON.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
22
|
+
* by the tagged parameter.
|
|
23
|
+
*
|
|
24
|
+
* @param equivalent See {@link COMPARISON.checkAlgorithm }.
|
|
25
|
+
* @param equalityPermitted See {@link COMPARISON.checkAlgorithm }.
|
|
26
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
27
|
+
* @param hint See {@link DBC.decPrecondition }.
|
|
28
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
29
|
+
*
|
|
30
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
31
|
+
static PRE(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
32
|
+
/**
|
|
33
|
+
* A method-decorator factory using the {@link COMPARISON.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
34
|
+
* by the tagged method's returnvalue.
|
|
35
|
+
*
|
|
36
|
+
* @param equivalent See {@link COMPARISON.checkAlgorithm }.
|
|
37
|
+
* @param equalityPermitted See {@link COMPARISON.checkAlgorithm }.
|
|
38
|
+
* @param path See {@link DBC.Postcondition }.
|
|
39
|
+
* @param hint See {@link DBC.decPostcondition }.
|
|
40
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
41
|
+
*
|
|
42
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
43
|
+
static POST(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
44
|
+
/**
|
|
45
|
+
* A field-decorator factory using the {@link COMPARISON.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
46
|
+
* by the tagged field.
|
|
47
|
+
*
|
|
48
|
+
* @param equivalent See {@link COMPARISON.checkAlgorithm }.
|
|
49
|
+
* @param equalityPermitted See {@link COMPARISON.checkAlgorithm }.
|
|
50
|
+
* @param path See {@link DBC.decInvariant }.
|
|
51
|
+
* @param hint See {@link DBC.decInvariant }.
|
|
52
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
53
|
+
*
|
|
54
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
55
|
+
static INVARIANT(equivalent: any, equalityPermitted?: boolean, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Invokes the {@link COMPARISON.checkAlgorithm } passing the value **toCheck**, {@link COMPARISON.equivalent } and {@link COMPARISON.invert }.
|
|
58
|
+
*
|
|
59
|
+
* @param toCheck See {@link COMPARISON.checkAlgorithm }.
|
|
60
|
+
*
|
|
61
|
+
* @returns See {@link COMPARISON.checkAlgorithm}. */
|
|
62
|
+
check(toCheck: any): string | true;
|
|
63
|
+
/**
|
|
64
|
+
* Creates this {@link COMPARISON } by setting the protected property {@link COMPARISON.equivalent }, {@link COMPARISON.equalityPermitted } and {@link COMPARISON.invert } used by {@link COMPARISON.check }.
|
|
65
|
+
*
|
|
66
|
+
* @param equivalent See {@link COMPARISON.check }.
|
|
67
|
+
* @param equalityPermitted See {@link COMPARISON.check }.
|
|
68
|
+
* @param invert See {@link COMPARISON.check }. */
|
|
69
|
+
constructor(equivalent: any, equalityPermitted?: boolean, invert?: boolean);
|
|
70
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that an {@link object }s must be defined thus it's value may not be **null** or **undefined**.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Salvatore Callari (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class DEFINED extends DBC {
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the value **toCheck** is null or undefined.
|
|
10
|
+
*
|
|
11
|
+
* @param toCheck The {@link Object } to check.
|
|
12
|
+
*
|
|
13
|
+
* @returns TRUE if the value **toCheck** is of the specified **type**, otherwise FALSE. */
|
|
14
|
+
static checkAlgorithm(toCheck: any): boolean | string;
|
|
15
|
+
/**
|
|
16
|
+
* A parameter-decorator factory using the {@link DEFINED.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
17
|
+
* by the tagged parameter.
|
|
18
|
+
*
|
|
19
|
+
* @param type See {@link DEFINED.checkAlgorithm }.
|
|
20
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
21
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
22
|
+
*
|
|
23
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
24
|
+
static PRE(path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
25
|
+
/**
|
|
26
|
+
* A method-decorator factory using the {@link DEFINED.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
27
|
+
* by the tagged method's returnvalue.
|
|
28
|
+
*
|
|
29
|
+
* @param type See {@link DEFINED.checkAlgorithm }.
|
|
30
|
+
* @param path See {@link DBC.Postcondition }.
|
|
31
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
32
|
+
*
|
|
33
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
34
|
+
static POST(type: string, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
35
|
+
/**
|
|
36
|
+
* A field-decorator factory using the {@link DEFINED.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
37
|
+
* by the tagged field.
|
|
38
|
+
*
|
|
39
|
+
* @param type See {@link DEFINED.checkAlgorithm }.
|
|
40
|
+
* @param path See {@link DBC.decInvariant }.
|
|
41
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
42
|
+
*
|
|
43
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
44
|
+
static INVARIANT(type: string, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Invokes the {@link DEFINED.checkAlgorithm } passing the value **toCheck** and the {@link DEFINED.type } .
|
|
47
|
+
*
|
|
48
|
+
* @param toCheck See {@link DEFINED.checkAlgorithm }.
|
|
49
|
+
*
|
|
50
|
+
* @returns See {@link DEFINED.checkAlgorithm}. */
|
|
51
|
+
check(toCheck: any): string | boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Invokes the {@link DEFINED.checkAlgorithm } passing the value **toCheck** and the {@link DEFINED.type } .
|
|
54
|
+
*
|
|
55
|
+
* @param toCheck See {@link DEFINED.checkAlgorithm }.
|
|
56
|
+
* @param id A {@link string } identifying this {@link INSTANCE } via the {@link DBC.Infringement }-Message.
|
|
57
|
+
*
|
|
58
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link DEFINED }.
|
|
59
|
+
*
|
|
60
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }.*/
|
|
61
|
+
static tsCheck<CANDIDATE = unknown>(toCheck: CANDIDATE | undefined | null, hint?: string | undefined, id?: string | undefined): CANDIDATE;
|
|
62
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EQ } from "../EQ";
|
|
2
|
+
/**
|
|
3
|
+
* DIFFERENT class for inequality comparisons.
|
|
4
|
+
*
|
|
5
|
+
* This class extends EQ and provides methods to check if a value is different (not equal)
|
|
6
|
+
* from a specified equivalent value. It inverts the equality check by always passing
|
|
7
|
+
* `true` for the invert parameter to the parent EQ class methods.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The class provides precondition (PRE), postcondition (POST), and invariant (INVARIANT)
|
|
11
|
+
* checks for Design by Contract programming patterns.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link COMPARISON}
|
|
14
|
+
* @see {@link EQ}
|
|
15
|
+
*/
|
|
16
|
+
export declare class DIFFERENT extends EQ {
|
|
17
|
+
equivalent: any;
|
|
18
|
+
/** See {@link EQ.PRE }. Always inverts equality check. */
|
|
19
|
+
static PRE(equivalent: any, _invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
20
|
+
/** See {@link EQ.POST }. Always inverts equality check. */
|
|
21
|
+
static POST(equivalent: any, _invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
22
|
+
/** See {@link EQ.INVARIANT }. Always inverts equality check. */
|
|
23
|
+
static INVARIANT(equivalent: any, _invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
24
|
+
/** See {@link EQ.constructor }. */
|
|
25
|
+
constructor(equivalent: any);
|
|
26
|
+
}
|
package/dist/DBC/EQ.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that two {@link object }s gotta be equal.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class EQ extends DBC {
|
|
8
|
+
protected equivalent: any;
|
|
9
|
+
protected invert: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the value **toCheck** is equal to the specified **equivalent**.
|
|
12
|
+
*
|
|
13
|
+
* @param toCheck The value that has to be equal to it's possible **equivalent** for this {@link DBC } to be fulfilled.
|
|
14
|
+
* @param equivalent The {@link object } the one **toCheck** has to be equal to in order for this {@link DBC } to be
|
|
15
|
+
* fulfilled.
|
|
16
|
+
*
|
|
17
|
+
* @returns TRUE if the value **toCheck** and the **equivalent** are equal to each other, otherwise FALSE. */
|
|
18
|
+
static checkAlgorithm(toCheck: any, equivalent: object, invert: boolean): boolean | string;
|
|
19
|
+
/**
|
|
20
|
+
* A parameter-decorator factory using the {@link EQ.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
21
|
+
* by the tagged parameter.
|
|
22
|
+
*
|
|
23
|
+
* @param equivalent See {@link EQ.checkAlgorithm }.
|
|
24
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
25
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
26
|
+
*
|
|
27
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
28
|
+
static PRE(equivalent: any, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* A method-decorator factory using the {@link EQ.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
31
|
+
* by the tagged method's returnvalue.
|
|
32
|
+
*
|
|
33
|
+
* @param equivalent See {@link EQ.checkAlgorithm }.
|
|
34
|
+
* @param path See {@link DBC.Postcondition }.
|
|
35
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
36
|
+
*
|
|
37
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
38
|
+
static POST(equivalent: any, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
39
|
+
/**
|
|
40
|
+
* A field-decorator factory using the {@link EQ.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
41
|
+
* by the tagged field.
|
|
42
|
+
*
|
|
43
|
+
* @param equivalent See {@link EQ.checkAlgorithm }.
|
|
44
|
+
* @param path See {@link DBC.decInvariant }.
|
|
45
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
46
|
+
*
|
|
47
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
48
|
+
static INVARIANT(equivalent: any, invert?: boolean, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Invokes the {@link EQ.checkAlgorithm } passing the value **toCheck**, {@link EQ.equivalent } and {@link EQ.invert }.
|
|
51
|
+
*
|
|
52
|
+
* @param toCheck See {@link EQ.checkAlgorithm }.
|
|
53
|
+
*
|
|
54
|
+
* @returns See {@link EQ.checkAlgorithm}. */
|
|
55
|
+
check(toCheck: any): string | boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Invokes the {@link EQ.checkAlgorithm } passing the value **toCheck** and the specified **type** .
|
|
58
|
+
*
|
|
59
|
+
* @param toCheck See {@link EQ.checkAlgorithm }.
|
|
60
|
+
*
|
|
61
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link EQ }.
|
|
62
|
+
*
|
|
63
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link EQ }.*/
|
|
64
|
+
static tsCheck<CANDIDATE>(toCheck: CANDIDATE | undefined | null, equivalent: any, hint?: string | undefined, id?: string | undefined): CANDIDATE;
|
|
65
|
+
/**
|
|
66
|
+
* Creates this {@link EQ } by setting the protected property {@link EQ.equivalent } used by {@link EQ.check }.
|
|
67
|
+
*
|
|
68
|
+
* @param equivalent See {@link EQ.check }. */
|
|
69
|
+
constructor(equivalent: any, invert?: boolean);
|
|
70
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that a {@link HTMLElement } gotta have a certain attribute set.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class HasAttribute extends DBC {
|
|
8
|
+
protected toCheckFor: string;
|
|
9
|
+
protected invert: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the {@link HTMLElement } **toCheck** has the attribute **toCheckFor**.
|
|
12
|
+
*
|
|
13
|
+
* @param toCheckFor name of the attribute to check for whether it is set or not.
|
|
14
|
+
*
|
|
15
|
+
* @returns TRUE if the {@link HTMLElement } **toCheck** has set the attribute **toCheckFor**,
|
|
16
|
+
* otherwise a proper errormessage. */
|
|
17
|
+
static checkAlgorithm(toCheck: any, toCheckFor: string, invert: any): boolean | string;
|
|
18
|
+
/**
|
|
19
|
+
* A parameter-decorator factory using the {@link HasAttribute.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
20
|
+
* by the tagged parameter.
|
|
21
|
+
*
|
|
22
|
+
* @param toCheckFor See {@link HasAttribute.checkAlgorithm }.
|
|
23
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
24
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
25
|
+
*
|
|
26
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
27
|
+
static PRE(toCheckFor: string, invert?: boolean, path?: string | undefined, dbc?: string): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
28
|
+
/**
|
|
29
|
+
* A method-decorator factory using the {@link HasAttribute.checkAlgorithm } to determine whether this {@link DBC } is
|
|
30
|
+
* fulfilled by the tagged method's returnvalue.
|
|
31
|
+
*
|
|
32
|
+
* @param toCheckFor See {@link HasAttribute.checkAlgorithm }.
|
|
33
|
+
* @param path See {@link DBC.Postcondition }.
|
|
34
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
35
|
+
*
|
|
36
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
37
|
+
static POST(toCheckFor: string, invert?: boolean, path?: string | undefined, dbc?: string): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
38
|
+
/**
|
|
39
|
+
* A field-decorator factory using the {@link hasAttribute.checkAlgorithm } to determine whether this {@link DBC } is
|
|
40
|
+
* fulfilled by the tagged field.
|
|
41
|
+
*
|
|
42
|
+
* @param toCheckFor See {@link hasAttribute.checkAlgorithm }.
|
|
43
|
+
* @param path See {@link DBC.decInvariant }.
|
|
44
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
45
|
+
*
|
|
46
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
47
|
+
static INVARIANT(toCheckFor: any, invert?: boolean, path?: string | undefined, dbc?: string): (target: unknown, propertyKey: string | symbol) => void;
|
|
48
|
+
/**
|
|
49
|
+
* A field-decorator factory using the {@link hasAttribute.checkAlgorithm } to determine whether this {@link DBC } is
|
|
50
|
+
* fulfilled by the tagged field's class instance.
|
|
51
|
+
*
|
|
52
|
+
* @param toCheckFor See {@link hasAttribute.checkAlgorithm }.
|
|
53
|
+
* @param path See {@link DBC.decInvariant }.
|
|
54
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
55
|
+
*
|
|
56
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
57
|
+
static cINVARIANT(toCheckFor: any, invert?: boolean, path?: string | undefined, dbc?: string): (target: unknown, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Invokes the {@link hasAttribute.checkAlgorithm } passing the value **toCheck**, {@link hasAttribute.equivalent } and
|
|
60
|
+
* {@link hasAttribute.invert }.
|
|
61
|
+
*
|
|
62
|
+
* @param toCheck See {@link EQ.checkAlgorithm }.
|
|
63
|
+
*
|
|
64
|
+
* @returns See {@link EQ.checkAlgorithm}. */
|
|
65
|
+
check(toCheck: any): string | boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Creates this {@link DBC } by setting the protected property {@link hasAttribute.equivalent } used by
|
|
68
|
+
* {@link hasAttribute.check }.
|
|
69
|
+
*
|
|
70
|
+
* @param toCheckFor See {@link hasAttribute.check }. */
|
|
71
|
+
constructor(toCheckFor: string, invert?: boolean);
|
|
72
|
+
}
|
package/dist/DBC/IF.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that an {@link object } has also to comply to a certain {@link DBC } if it complies to
|
|
4
|
+
* another specified one.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
8
|
+
export declare class IF extends DBC {
|
|
9
|
+
protected condition: {
|
|
10
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
11
|
+
};
|
|
12
|
+
protected inCase: {
|
|
13
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
14
|
+
};
|
|
15
|
+
protected invert: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the value **toCheck** complies to the specified **condition** and if so does also comply to the one **inCase**.
|
|
18
|
+
*
|
|
19
|
+
* @param toCheck The value that has to be equal to it's possible **equivalent** for this {@link DBC } to be fulfilled.
|
|
20
|
+
* @param condition The contract **toCheck** has to comply to in order to also have to comply to the one **inCase**.
|
|
21
|
+
* @param inCase The contract **toCheck** has to also comply to if it complies to **condition**.
|
|
22
|
+
*
|
|
23
|
+
* @returns TRUE if the value **toCheck** and the **equivalent** are equal to each other, otherwise FALSE. */
|
|
24
|
+
static checkAlgorithm(toCheck: any, condition: {
|
|
25
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
26
|
+
}, inCase: {
|
|
27
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
28
|
+
}, invert?: boolean): boolean | string;
|
|
29
|
+
/**
|
|
30
|
+
* A parameter-decorator factory using the {@link EQ.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
31
|
+
* by the tagged parameter.
|
|
32
|
+
*
|
|
33
|
+
* @param condition See {@link IF.checkAlgorithm }.
|
|
34
|
+
* @param inCase See {@link IF.checkAlgorithm }.
|
|
35
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
36
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
37
|
+
*
|
|
38
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
39
|
+
static PRE(condition: {
|
|
40
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
41
|
+
}, inCase: {
|
|
42
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
43
|
+
}, path?: string | undefined, invert?: boolean, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
44
|
+
/**
|
|
45
|
+
* A method-decorator factory using the {@link IF.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
46
|
+
* by the tagged method's returnvalue.
|
|
47
|
+
*
|
|
48
|
+
* @param condition See {@link IF.checkAlgorithm }.
|
|
49
|
+
* @param inCase See {@link IF.checkAlgorithm }.
|
|
50
|
+
* @param path See {@link DBC.Postcondition }.
|
|
51
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
52
|
+
*
|
|
53
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
54
|
+
static POST(condition: {
|
|
55
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
56
|
+
}, inCase: {
|
|
57
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
58
|
+
}, path?: string | undefined, invert?: boolean, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
59
|
+
/**
|
|
60
|
+
* A field-decorator factory using the {@link IF.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
61
|
+
* by the tagged field.
|
|
62
|
+
*
|
|
63
|
+
* @param condition See {@link IF.checkAlgorithm }.
|
|
64
|
+
* @param inCase See {@link IF.checkAlgorithm }.
|
|
65
|
+
* @param path See {@link DBC.decInvariant }.
|
|
66
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
67
|
+
*
|
|
68
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
69
|
+
static INVARIANT(condition: {
|
|
70
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
71
|
+
}, inCase: {
|
|
72
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
73
|
+
}, path?: string | undefined, invert?: boolean, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Invokes the {@link IF.checkAlgorithm } passing the value **toCheck**, {@link IF.equivalent } and {@link IF.invert }.
|
|
76
|
+
*
|
|
77
|
+
* @param toCheck See {@link IF.checkAlgorithm }.
|
|
78
|
+
*
|
|
79
|
+
* @returns See {@link IF.checkAlgorithm}. */
|
|
80
|
+
check(toCheck: any): string | boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Creates this {@link IF } by setting the protected property {@link IF.equivalent } used by {@link IF.check }.
|
|
83
|
+
*
|
|
84
|
+
* @param equivalent See {@link IF.check }. */
|
|
85
|
+
constructor(condition: {
|
|
86
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
87
|
+
}, inCase: {
|
|
88
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
89
|
+
}, invert?: boolean);
|
|
90
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that the an {@link object }s gotta be an instance of a certain {@link INSTANCE.reference }.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Salvatore Callari (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class INSTANCE extends DBC {
|
|
8
|
+
protected reference: any;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the value **toCheck** is an instance of the specified **reference**.
|
|
11
|
+
*
|
|
12
|
+
* @param toCheck The value that has to be an instance of the **reference** in order for this {@link DBC }
|
|
13
|
+
* to be fulfilled.
|
|
14
|
+
* @param reference The {@link object } the one **toCheck** has to be an instance of.
|
|
15
|
+
*
|
|
16
|
+
* @returns TRUE if the value **toCheck** is is an instance of the *reference**, **undefined** or **null**, otherwise FALSE. */
|
|
17
|
+
static checkAlgorithm(toCheck: any, ...references: any[]): boolean | string;
|
|
18
|
+
/**
|
|
19
|
+
* A parameter-decorator factory using the {@link INSTANCE.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
20
|
+
* by the tagged parameter.
|
|
21
|
+
*
|
|
22
|
+
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
23
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
24
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
25
|
+
*
|
|
26
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
27
|
+
static PRE(reference: any | any[], path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
28
|
+
/**
|
|
29
|
+
* A method-decorator factory using the {@link INSTANCE.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
30
|
+
* by the tagged method's returnvalue.
|
|
31
|
+
*
|
|
32
|
+
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
33
|
+
* @param path See {@link DBC.Postcondition }.
|
|
34
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
35
|
+
*
|
|
36
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
37
|
+
static POST(reference: any | any[], path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
38
|
+
/**
|
|
39
|
+
* A field-decorator factory using the {@link INSTANCE.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
40
|
+
* by the tagged method's returnvalue.
|
|
41
|
+
*
|
|
42
|
+
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
43
|
+
* @param path See {@link DBC.decInvariant }.
|
|
44
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
45
|
+
*
|
|
46
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
47
|
+
static INVARIANT(reference: any | any[], path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Invokes the {@link INSTANCE.checkAlgorithm } passing the value **toCheck** and the {@link INSTANCE.reference } .
|
|
50
|
+
*
|
|
51
|
+
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
52
|
+
*
|
|
53
|
+
* @returns See {@link INSTANCE.checkAlgorithm}. */
|
|
54
|
+
check(toCheck: any): string | boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Type-safe check that validates if a value is an instance of a specified reference.
|
|
57
|
+
*
|
|
58
|
+
* @param toCheck The value to check for instance validity.
|
|
59
|
+
* @param reference The {@link object } the one **toCheck** has to be an instance of.
|
|
60
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
61
|
+
* @param id A {@link string } identifying this {@link INSTANCE } via the {@link DBC.Infringement }-Message.
|
|
62
|
+
*
|
|
63
|
+
* @returns The **CANDIDATE** **toCheck** if it fulfills this {@link INSTANCE }.
|
|
64
|
+
*
|
|
65
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link INSTANCE }. */
|
|
66
|
+
static tsCheck<CANDIDATE = unknown>(toCheck: any, reference: any, hint?: string, id?: string | undefined): CANDIDATE;
|
|
67
|
+
/**
|
|
68
|
+
* Invokes the {@link INSTANCE.checkAlgorithm } passing the value **toCheck** and the {@link INSTANCE.reference } .
|
|
69
|
+
*
|
|
70
|
+
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
71
|
+
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
72
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
73
|
+
* @param id A {@link string } identifying this {@link INSTANCE } via the {@link DBC.Infringement }-Message.
|
|
74
|
+
*
|
|
75
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link INSTANCE }.
|
|
76
|
+
*
|
|
77
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
78
|
+
static tsCheckMulti<CANDIDATE = unknown>(toCheck: any, references: any[], hint?: string, id?: string | undefined): CANDIDATE;
|
|
79
|
+
/**
|
|
80
|
+
* Creates this {@link INSTANCE } by setting the protected property {@link INSTANCE.reference } used by {@link INSTANCE.check }.
|
|
81
|
+
*
|
|
82
|
+
* @param reference See {@link INSTANCE.check }. */
|
|
83
|
+
constructor(reference: any);
|
|
84
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } demanding that an {@link object } has specific properties of specific types.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export declare class JSON_OP extends DBC {
|
|
8
|
+
necessaryProperties: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
}>;
|
|
12
|
+
checkElements: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the object **toCheck** has the **necessaryProperties** of necessary type.
|
|
15
|
+
*
|
|
16
|
+
* @param toCheck The {@link object } to check for the necessary properties.
|
|
17
|
+
* @param necessaryProperties The **{ name : string, type : string }**s defining the properties and type the {@link object } to
|
|
18
|
+
* check needs to have.
|
|
19
|
+
* @param checkElements Indicates if **toCheck** is an iterable object of which all elements have to be checked.
|
|
20
|
+
* Elements will only be checked if **toCheck** is iterable, otherwise **toCheck** itself
|
|
21
|
+
* will be checked.
|
|
22
|
+
*
|
|
23
|
+
* @returns TRUE if the value **toCheck** or it's elements, if **checkElements** is TRUE, has all **necessaryProperties**, otherwise a {@link string } to report the infringement. */
|
|
24
|
+
static checkAlgorithm(toCheck: any, necessaryProperties: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}>, checkElements: any): boolean | string;
|
|
28
|
+
/**
|
|
29
|
+
* A parameter-decorator factory using the {@link JSON_OP.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
30
|
+
* by the tagged parameter.
|
|
31
|
+
*
|
|
32
|
+
* @param expression See {@link JSON.checkAlgorithm }.
|
|
33
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
34
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
35
|
+
*
|
|
36
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
37
|
+
static PRE(necessaryProperties: Array<{
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}>, checkElements?: boolean, path?: string | undefined, dbc?: string): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
41
|
+
/**
|
|
42
|
+
* A method-decorator factory using the {@link JSON_OP.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
43
|
+
* by the tagged method's returnvalue.
|
|
44
|
+
*
|
|
45
|
+
* @param expression See {@link JSON.checkAlgorithm }.
|
|
46
|
+
* @param path See {@link DBC.Postcondition }.
|
|
47
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
48
|
+
*
|
|
49
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
50
|
+
static POST(necessaryProperties: Array<{
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
}>, checkElements?: boolean, path?: string | undefined, dbc?: string): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
54
|
+
/**
|
|
55
|
+
* A field-decorator factory using the {@link JSON_OP.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
56
|
+
* by the tagged field.
|
|
57
|
+
*
|
|
58
|
+
* @param expression See {@link JSON.checkAlgorithm }.
|
|
59
|
+
* @param path See {@link DBC.decInvariant }.
|
|
60
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
61
|
+
*
|
|
62
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
63
|
+
static INVARIANT(necessaryProperties: Array<{
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
}>, checkElements?: boolean, path?: string | undefined, dbc?: string): (target: unknown, propertyKey: string | symbol) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Invokes the {@link JSON_OP.checkAlgorithm } passing the value **toCheck**, {@link JSON_OP.necessaryProperties } and {@link JSON_OP.checkElements }.
|
|
69
|
+
*
|
|
70
|
+
* @param toCheck See {@link JSON_OP.checkAlgorithm }.
|
|
71
|
+
*
|
|
72
|
+
* @returns See {@link JSON_OP.checkAlgorithm}. */
|
|
73
|
+
check(toCheck: any): string | boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Creates this {@link JSON_OP } by setting the protected property {@link JSON_OP.necessaryProperties } and {@link checkElements } used by {@link JSON_OP.check }.
|
|
76
|
+
*
|
|
77
|
+
* @param necessaryProperties See {@link JSON_OP.check }.
|
|
78
|
+
* @param checkElements See {@link JSON_OP.check }. */
|
|
79
|
+
constructor(necessaryProperties: Array<{
|
|
80
|
+
name: string;
|
|
81
|
+
type: string;
|
|
82
|
+
}>, checkElements?: boolean);
|
|
83
|
+
/**
|
|
84
|
+
* Invokes the {@link JSON_OP.checkAlgorithm } passing the value **toCheck**, {@link JSON_OP.necessaryProperties } and {@link JSON_OP.checkElements }.
|
|
85
|
+
*
|
|
86
|
+
* @param toCheck See {@link JSON_OP.checkAlgorithm} }.
|
|
87
|
+
* @param necessaryProperties See {@link JSON_OP.checkAlgorithm} }.
|
|
88
|
+
* @param checkElements See {@link JSON_OP.checkAlgorithm} }.
|
|
89
|
+
*/
|
|
90
|
+
static check(toCheck: any, necessaryProperties: Array<{
|
|
91
|
+
name: string;
|
|
92
|
+
type: string;
|
|
93
|
+
}>, checkElements?: boolean): void;
|
|
94
|
+
}
|