xdbc 1.0.212 → 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/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/package.json +2 -9
- package/tsconfig.json +1 -0
package/dist/DBC/AE.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that all elements of an {@link object }s have to fulfill
|
|
4
|
+
* a given {@link object }'s check-method (**( toCheck : any ) => boolean | string**).
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
8
|
+
export declare class AE extends DBC {
|
|
9
|
+
protected conditions: Array<{
|
|
10
|
+
check: (toCheck: any) => boolean | string;
|
|
11
|
+
}> | {
|
|
12
|
+
check: (toCheck: any) => boolean | string;
|
|
13
|
+
};
|
|
14
|
+
protected index: number | undefined;
|
|
15
|
+
protected idxEnd: number | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Checks each element of the **value**-{@link Array < any >} against the given **condition**, if it is one. If it is not
|
|
18
|
+
* the **value** itself will be checked.
|
|
19
|
+
*
|
|
20
|
+
* @param condition The { check: (toCheck: any) => boolean | string } to check the **value** against.
|
|
21
|
+
* @param value Either **value**-{@link Array < any >}, which's elements will be checked, or the value to be
|
|
22
|
+
* checked itself.
|
|
23
|
+
* @param index If specified with **idxEnd** being undefined, this {@link Number } will be seen as the index of
|
|
24
|
+
* the value-{@link Array }'s element to check. If value isn't an {@link Array } this parameter
|
|
25
|
+
* will not have any effect.
|
|
26
|
+
* With **idxEnd** not undefined this parameter indicates the beginning of the span of elements to
|
|
27
|
+
* check within the value-{@link Array }.
|
|
28
|
+
* @param idxEnd Indicates the last element's index (including) of the span of value-{@link Array } elements to check.
|
|
29
|
+
* Setting this parameter to -1 specifies that all value-{@link Array }'s elements beginning from the
|
|
30
|
+
* specified **index** shall be checked.
|
|
31
|
+
*
|
|
32
|
+
* @returns As soon as the **condition** returns a {@link string }, instead of TRUE, the returned string. TRUE if the
|
|
33
|
+
* **condition** never returns a {@link string}. */
|
|
34
|
+
static checkAlgorithm(condition: {
|
|
35
|
+
check: (toCheck: unknown | null | undefined) => boolean | string;
|
|
36
|
+
}, value: object, index: number | undefined, idxEnd: number | undefined): boolean | string;
|
|
37
|
+
/**
|
|
38
|
+
* A parameter-decorator factory using the {@link AE.checkAlgorithm } with either multiple or a single one
|
|
39
|
+
* of the **realConditions** to check the tagged parameter-value against with.
|
|
40
|
+
* When specifying an **index** and the tagged parameter's **value** is an {@link Array }, the **realConditions** apply to the
|
|
41
|
+
* element at the specified **index**.
|
|
42
|
+
* If the {@link Array } is too short the currently processed { check: (toCheck: any) => boolean | string } of
|
|
43
|
+
* **realConditions** will be verified to TRUE automatically, considering optional parameters.
|
|
44
|
+
* If an **index** is specified but the tagged parameter's value isn't an array, the **index** is treated as being undefined.
|
|
45
|
+
* If **index** is undefined and the tagged parameter's value is an {@link Array } each element of it will be checked
|
|
46
|
+
* against the **realConditions**.
|
|
47
|
+
*
|
|
48
|
+
* @param realConditions Either one or more { check: (toCheck: any) => boolean | string } to check the tagged parameter-value
|
|
49
|
+
* against with.
|
|
50
|
+
* @param index See the {@link AE.checkAlgorithm }.
|
|
51
|
+
* @param idxEnd See the {@link AE.checkAlgorithm }.
|
|
52
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
53
|
+
* @param hint See {@link DBC.decPrecondition }.
|
|
54
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
55
|
+
*
|
|
56
|
+
* @returns A {@link string } as soon as one { check: (toCheck: any) => boolean | string } of **realConditions** returns one.
|
|
57
|
+
* Otherwise TRUE. */
|
|
58
|
+
static PRE(realConditions: Array<{
|
|
59
|
+
check: (toCheck: unknown | undefined | null) => boolean | string;
|
|
60
|
+
}> | {
|
|
61
|
+
check: (toCheck: unknown | undefined | null) => boolean | string;
|
|
62
|
+
}, index?: number | undefined, idxEnd?: number | undefined, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, methodName: string | symbol, parameterIndex: number) => void;
|
|
63
|
+
/**
|
|
64
|
+
* A method-decorator factory using the {@link AE.checkAlgorithm } with either multiple or a single one
|
|
65
|
+
* of the **realConditions** to check the tagged method's return-value against with.
|
|
66
|
+
*
|
|
67
|
+
* @param realConditions Either one or more { check: (toCheck: any) => boolean | string } to check the tagged parameter-value
|
|
68
|
+
* against with.
|
|
69
|
+
* @param index See the {@link AE.checkAlgorithm }.
|
|
70
|
+
* @param idxEnd See the {@link AE.checkAlgorithm }.
|
|
71
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
72
|
+
* @param hint See {@link DBC.decPrecondition }.
|
|
73
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
74
|
+
*
|
|
75
|
+
* @returns A {@link string } as soon as one { check: (toCheck: any) => boolean | string } of **realConditions** return one.
|
|
76
|
+
* Otherwise TRUE. */
|
|
77
|
+
static POST(realConditions: Array<{
|
|
78
|
+
check: (toCheck: any) => boolean | string;
|
|
79
|
+
}> | {
|
|
80
|
+
check: (toCheck: any) => boolean | string;
|
|
81
|
+
}, index?: number | undefined, idxEnd?: number | undefined, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
82
|
+
/**
|
|
83
|
+
* A field-decorator factory using the {@link AE.checkAlgorithm } with either multiple or a single one
|
|
84
|
+
* of the **realConditions** to check the tagged field.
|
|
85
|
+
*
|
|
86
|
+
* @param realConditions Either one or more { check: (toCheck: any) => boolean | string } to check the tagged parameter-value
|
|
87
|
+
* against with.
|
|
88
|
+
* @param index See the {@link AE.checkAlgorithm }.
|
|
89
|
+
* @param idxEnd See the {@link AE.checkAlgorithm }.
|
|
90
|
+
* @param path See {@link DBC.decInvariant }.
|
|
91
|
+
* @param hint See {@link DBC.decInvariant }.
|
|
92
|
+
* @param dbc See {@link DBC.decInvariant }.
|
|
93
|
+
*
|
|
94
|
+
* @returns See {@link DBC.decInvariant }. */
|
|
95
|
+
static INVARIANT(realConditions: Array<{
|
|
96
|
+
check: (toCheck: any) => boolean | string;
|
|
97
|
+
}> | {
|
|
98
|
+
check: (toCheck: any) => boolean | string;
|
|
99
|
+
}, index?: number | undefined, idxEnd?: number | undefined, path?: string | undefined, hint?: string | undefined, dbc?: string | undefined): (target: unknown, propertyKey: string | symbol) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Invokes the {@link AE.checkAlgorithm } with all {@link AE.conditions } and the {@link object } {@link toCheck },
|
|
102
|
+
* {@link AE.index } & {@link AE.idxEnd }.
|
|
103
|
+
*
|
|
104
|
+
* @param toCheck See {@link AE.checkAlgorithm }.
|
|
105
|
+
*
|
|
106
|
+
* @returns See {@link EQ.checkAlgorithm}. */
|
|
107
|
+
check(toCheck: any): string | boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Creates this {@link AE } by setting the protected property {@link AE.conditions }, {@link AE.index } and {@link AE.idxEnd } used by {@link AE.check }.
|
|
110
|
+
*
|
|
111
|
+
* @param equivalent See {@link EQ.check }. */
|
|
112
|
+
constructor(conditions: Array<{
|
|
113
|
+
check: (toCheck: any) => boolean | string;
|
|
114
|
+
}> | {
|
|
115
|
+
check: (toCheck: any) => boolean | string;
|
|
116
|
+
}, index?: number | undefined, idxEnd?: number | undefined);
|
|
117
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPARISON } from "../COMPARISON";
|
|
2
|
+
/** See {@link COMPARISON }. */
|
|
3
|
+
export declare class GREATER 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 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
|
+
}
|