clientnode 3.0.845 → 3.0.849
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/index.d.ts +72 -48
- package/index.js +1 -1
- package/package.json +1 -1
- package/testHelper.js +1 -1
- package/type.d.ts +10 -3
package/index.d.ts
CHANGED
|
@@ -13,9 +13,51 @@ export declare const currentImport: null | ImportFunction;
|
|
|
13
13
|
export declare const optionalRequire: <T = unknown>(id: string) => T | null;
|
|
14
14
|
export declare const determine$: (() => $TStatic);
|
|
15
15
|
export declare let $: $TStatic;
|
|
16
|
+
/**
|
|
17
|
+
* Represents the lock state.
|
|
18
|
+
*
|
|
19
|
+
* @property locks - Mapping of lock descriptions to there corresponding
|
|
20
|
+
* callbacks.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Lock<Type = string | void> {
|
|
23
|
+
locks: Mapping<Array<LockCallbackFunction<Type>>>;
|
|
24
|
+
/**
|
|
25
|
+
* Initializes locks.
|
|
26
|
+
* @param locks - Mapping of a lock description to callbacks for calling
|
|
27
|
+
* when given lock should be released.
|
|
28
|
+
*
|
|
29
|
+
* @returns Nothing.
|
|
30
|
+
*/
|
|
31
|
+
constructor(locks?: Mapping<Array<LockCallbackFunction<Type>>>);
|
|
32
|
+
/**
|
|
33
|
+
* Calling this method introduces a starting point for a critical area with
|
|
34
|
+
* potential race conditions. The area will be binded to given description
|
|
35
|
+
* string. So don't use same names for different areas.
|
|
36
|
+
* @param description - A short string describing the critical areas
|
|
37
|
+
* properties.
|
|
38
|
+
* @param callback - A procedure which should only be executed if the
|
|
39
|
+
* interpreter isn't in the given critical area. The lock description
|
|
40
|
+
* string will be given to the callback function.
|
|
41
|
+
* @param autoRelease - Release the lock after execution of given callback.
|
|
42
|
+
*
|
|
43
|
+
* @returns Returns a promise which will be resolved after releasing lock.
|
|
44
|
+
*/
|
|
45
|
+
acquire(description: string, callback?: LockCallbackFunction<Type>, autoRelease?: boolean): Promise<Type>;
|
|
46
|
+
/**
|
|
47
|
+
* Calling this method causes the given critical area to be finished and
|
|
48
|
+
* all functions given to "acquire()" will be executed in right order.
|
|
49
|
+
* @param description - A short string describing the critical areas
|
|
50
|
+
* properties.
|
|
51
|
+
*
|
|
52
|
+
* @returns Returns the return (maybe promise resolved) value of the
|
|
53
|
+
* callback given to the "acquire" method.
|
|
54
|
+
*/
|
|
55
|
+
release(description: string): Promise<Type | void>;
|
|
56
|
+
}
|
|
16
57
|
/**
|
|
17
58
|
* Represents the semaphore state.
|
|
18
59
|
* @property queue - List of waiting resource requests.
|
|
60
|
+
*
|
|
19
61
|
* @property numberOfFreeResources - Number free allowed concurrent resource
|
|
20
62
|
* uses.
|
|
21
63
|
* @property numberOfResources - Number of allowed concurrent resource uses.
|
|
@@ -32,8 +74,8 @@ export declare class Semaphore {
|
|
|
32
74
|
constructor(numberOfResources?: number);
|
|
33
75
|
/**
|
|
34
76
|
* Acquires a new resource and runs given callback if available.
|
|
35
|
-
* @returns A promise which will be resolved if requested resource
|
|
36
|
-
*
|
|
77
|
+
* @returns A promise which will be resolved if requested resource is
|
|
78
|
+
* available.
|
|
37
79
|
*/
|
|
38
80
|
acquire(): Promise<number>;
|
|
39
81
|
/**
|
|
@@ -87,12 +129,10 @@ export declare class Semaphore {
|
|
|
87
129
|
*
|
|
88
130
|
* @property $domNode - $-extended dom node if one was given to the constructor
|
|
89
131
|
* method.
|
|
90
|
-
* @property locks - Mapping of lock descriptions to there corresponding
|
|
91
|
-
* callbacks.
|
|
92
132
|
*
|
|
93
133
|
* @property options - Options given to the constructor.
|
|
94
134
|
*/
|
|
95
|
-
export declare class Tools<TElement = HTMLElement
|
|
135
|
+
export declare class Tools<TElement = HTMLElement> {
|
|
96
136
|
static abbreviations: Array<string>;
|
|
97
137
|
static readonly animationEndEventNames = "animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";
|
|
98
138
|
static readonly classToTypeMapping: Mapping;
|
|
@@ -107,7 +147,6 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
107
147
|
static _defaultOptions: Partial<Options>;
|
|
108
148
|
static _javaScriptDependentContentHandled: boolean;
|
|
109
149
|
$domNode: null | $T<TElement>;
|
|
110
|
-
locks: Mapping<Array<LockCallbackFunction<LockType>>>;
|
|
111
150
|
options: Options;
|
|
112
151
|
/**
|
|
113
152
|
* Triggered if current object is created via the "new" keyword. The dom
|
|
@@ -118,17 +157,15 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
118
157
|
* the dry concept.
|
|
119
158
|
* @param $domNode - $-extended dom node to use as reference in various
|
|
120
159
|
* methods.
|
|
121
|
-
* @param locks - Mapping of a lock description to callbacks for calling
|
|
122
|
-
* when given lock should be released.
|
|
123
160
|
*
|
|
124
161
|
* @returns Nothing.
|
|
125
162
|
*/
|
|
126
|
-
constructor($domNode?: $T<TElement
|
|
163
|
+
constructor($domNode?: $T<TElement>);
|
|
127
164
|
/**
|
|
128
165
|
* This method could be overwritten normally. It acts like a destructor.
|
|
129
166
|
* @returns Returns the current instance.
|
|
130
167
|
*/
|
|
131
|
-
destructor():
|
|
168
|
+
destructor(): this;
|
|
132
169
|
/**
|
|
133
170
|
* This method should be overwritten normally. It is triggered if current
|
|
134
171
|
* object was created via the "new" keyword and is called now.
|
|
@@ -136,7 +173,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
136
173
|
*
|
|
137
174
|
* @returns Returns the current instance.
|
|
138
175
|
*/
|
|
139
|
-
initialize(options?: RecursivePartial<Options>):
|
|
176
|
+
initialize<R = this>(options?: RecursivePartial<Options>): R;
|
|
140
177
|
/**
|
|
141
178
|
* Formats given date or current via given format specification.
|
|
142
179
|
* @param this - Indicates an unbound method.
|
|
@@ -160,39 +197,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
160
197
|
*
|
|
161
198
|
* @returns Returns whatever the initializer method returns.
|
|
162
199
|
*/
|
|
163
|
-
static controller<TElement = HTMLElement
|
|
164
|
-
/**
|
|
165
|
-
* Calling this method introduces a starting point for a critical area with
|
|
166
|
-
* potential race conditions. The area will be binded to given description
|
|
167
|
-
* string. So don't use same names for different areas.
|
|
168
|
-
* @param description - A short string describing the critical areas
|
|
169
|
-
* properties.
|
|
170
|
-
* @param callback - A procedure which should only be executed if the
|
|
171
|
-
* interpreter isn't in the given critical area. The lock description
|
|
172
|
-
* string will be given to the callback function.
|
|
173
|
-
* @param autoRelease - Release the lock after execution of given callback.
|
|
174
|
-
*
|
|
175
|
-
* @returns Returns a promise which will be resolved after releasing lock.
|
|
176
|
-
*/
|
|
177
|
-
acquireLock(description: string, callback?: LockCallbackFunction<LockType>, autoRelease?: boolean): Promise<LockType>;
|
|
178
|
-
/**
|
|
179
|
-
* Calling this method causes the given critical area to be finished and
|
|
180
|
-
* all functions given to "acquireLock()" will be executed in right order.
|
|
181
|
-
* @param description - A short string describing the critical areas
|
|
182
|
-
* properties.
|
|
183
|
-
*
|
|
184
|
-
* @returns Returns the return (maybe promise resolved) value of the
|
|
185
|
-
* callback given to the "acquireLock" method.
|
|
186
|
-
*/
|
|
187
|
-
releaseLock(description: string): Promise<LockType | void>;
|
|
188
|
-
/**
|
|
189
|
-
* Generate a semaphore object with given number of resources.
|
|
190
|
-
* @param this - Indicates an unbound method.
|
|
191
|
-
* @param numberOfResources - Number of allowed concurrent resource uses.
|
|
192
|
-
*
|
|
193
|
-
* @returns The requested semaphore instance.
|
|
194
|
-
*/
|
|
195
|
-
static getSemaphore(this: void, numberOfResources?: number): Semaphore;
|
|
200
|
+
static controller<TElement = HTMLElement>(this: void, object: unknown, parameters: unknown, $domNode?: null | $T<TElement>): unknown;
|
|
196
201
|
/**
|
|
197
202
|
* Determines whether its argument represents a JavaScript number.
|
|
198
203
|
* @param this - Indicates an unbound method.
|
|
@@ -395,12 +400,12 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
395
400
|
* Normalizes class name order of current dom node.
|
|
396
401
|
* @returns Current instance.
|
|
397
402
|
*/
|
|
398
|
-
get normalizedClassNames():
|
|
403
|
+
get normalizedClassNames(): this;
|
|
399
404
|
/**
|
|
400
405
|
* Normalizes style attributes order of current dom node.
|
|
401
406
|
* @returns Returns current instance.
|
|
402
407
|
*/
|
|
403
|
-
get normalizedStyles():
|
|
408
|
+
get normalizedStyles(): this;
|
|
404
409
|
/**
|
|
405
410
|
* Retrieves a mapping of computed style attributes to their corresponding
|
|
406
411
|
* values.
|
|
@@ -453,6 +458,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
453
458
|
/**
|
|
454
459
|
* Removes a directive name corresponding class or attribute.
|
|
455
460
|
* @param directiveName - The directive name.
|
|
461
|
+
*
|
|
456
462
|
* @returns Returns current dom node.
|
|
457
463
|
*/
|
|
458
464
|
removeDirective(directiveName: string): null | $T<TElement>;
|
|
@@ -1486,6 +1492,24 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
1486
1492
|
* @returns Returns the rounded number.
|
|
1487
1493
|
*/
|
|
1488
1494
|
static numberRound(this: void, number: number, digits?: number): number;
|
|
1495
|
+
/**
|
|
1496
|
+
* Rounds a given number up accurate to given number of digits.
|
|
1497
|
+
* @param this - Indicates an unbound method.
|
|
1498
|
+
* @param number - The number to round.
|
|
1499
|
+
* @param digits - The number of digits after comma.
|
|
1500
|
+
*
|
|
1501
|
+
* @returns Returns the rounded number.
|
|
1502
|
+
*/
|
|
1503
|
+
static numberCeil(this: void, number: number, digits?: number): number;
|
|
1504
|
+
/**
|
|
1505
|
+
* Rounds a given number down accurate to given number of digits.
|
|
1506
|
+
* @param this - Indicates an unbound method.
|
|
1507
|
+
* @param number - The number to round.
|
|
1508
|
+
* @param digits - The number of digits after comma.
|
|
1509
|
+
*
|
|
1510
|
+
* @returns Returns the rounded number.
|
|
1511
|
+
*/
|
|
1512
|
+
static numberFloor(this: void, number: number, digits?: number): number;
|
|
1489
1513
|
/**
|
|
1490
1514
|
* Checks if given url response with given status code.
|
|
1491
1515
|
* @param this - Indicates an unbound method.
|
|
@@ -1545,7 +1569,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
1545
1569
|
*
|
|
1546
1570
|
* @returns Returns the given target as extended dom node.
|
|
1547
1571
|
*/
|
|
1548
|
-
static sendToIFrame(this: void, target: $T | HTMLIFrameElement | string, url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean): $T
|
|
1572
|
+
static sendToIFrame(this: void, target: $T<HTMLIFrameElement> | HTMLIFrameElement | string, url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean): $T<HTMLIFrameElement>;
|
|
1549
1573
|
/**
|
|
1550
1574
|
* Send given data to a temporary created iframe.
|
|
1551
1575
|
* @param url - URL to send to data to.
|
|
@@ -1714,7 +1738,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
1714
1738
|
/**
|
|
1715
1739
|
* Dom bound version of Tools class.
|
|
1716
1740
|
*/
|
|
1717
|
-
export declare class BoundTools<TElement extends HTMLElement = HTMLElement
|
|
1741
|
+
export declare class BoundTools<TElement extends HTMLElement = HTMLElement> extends Tools<TElement> {
|
|
1718
1742
|
$domNode: $T<TElement>;
|
|
1719
1743
|
readonly self: typeof BoundTools;
|
|
1720
1744
|
/**
|