clientnode 3.0.843 → 3.0.847
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 +83 -59
- package/index.js +1 -1
- package/package.json +2 -1
- package/testHelper.js +1 -1
- package/type.d.ts +11 -5
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ChildProcess } from 'child_process';
|
|
3
|
-
import { AnyFunction, CheckReachabilityOptions, CompareOptions, CompilationResult, Encoding, EvaluationResult, File, FirstParameter, GetterFunction, ImportFunction, LockCallbackFunction, Mapping, ObjectMaskConfiguration, Options, Page, PaginateOptions, ParametersExceptFirst, PlainObject, ProcessCloseCallback, ProcessErrorCallback, ProcessHandler, ProxyHandler, ProxyType, QueryParameters, RecursiveEvaluateable, RecursivePartial, RelativePosition, SecondParameter, Selector, SetterFunction, TimeoutPromise, $
|
|
3
|
+
import { AnyFunction, CheckReachabilityOptions, CompareOptions, CompilationResult, Encoding, EvaluationResult, File, FirstParameter, GetterFunction, ImportFunction, LockCallbackFunction, Mapping, ObjectMaskConfiguration, Options, Page, PaginateOptions, ParametersExceptFirst, PlainObject, ProcessCloseCallback, ProcessErrorCallback, ProcessHandler, ProxyHandler, ProxyType, QueryParameters, RecursiveEvaluateable, RecursivePartial, RelativePosition, SecondParameter, Selector, SetterFunction, TimeoutPromise, $DomNodes, $Global, $T, $TStatic } from './type';
|
|
4
4
|
export declare const CloseEventNames: readonly ["close", "exit", "SIGINT", "SIGTERM", "SIGQUIT", "uncaughtException"];
|
|
5
5
|
export declare const ConsoleOutputMethods: readonly ["debug", "error", "info", "log", "warn"];
|
|
6
6
|
export declare const ValueCopySymbol: unique symbol;
|
|
@@ -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;
|
|
@@ -106,8 +146,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
106
146
|
static _dateTimePatternCache: Array<RegExp>;
|
|
107
147
|
static _defaultOptions: Partial<Options>;
|
|
108
148
|
static _javaScriptDependentContentHandled: boolean;
|
|
109
|
-
$domNode: null | $
|
|
110
|
-
locks: Mapping<Array<LockCallbackFunction<LockType>>>;
|
|
149
|
+
$domNode: null | $T<TElement>;
|
|
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?: $
|
|
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.
|
|
@@ -423,7 +428,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
423
428
|
*
|
|
424
429
|
* @returns Returns true if both dom representations are equivalent.
|
|
425
430
|
*/
|
|
426
|
-
static isEquivalentDOM(this: void, first: Node | string | $
|
|
431
|
+
static isEquivalentDOM(this: void, first: Node | string | $T<Node>, second: Node | string | $T<Node>, forceHTMLString?: boolean): boolean;
|
|
427
432
|
/**
|
|
428
433
|
* Determines where current dom node is relative to current view port
|
|
429
434
|
* position.
|
|
@@ -453,9 +458,10 @@ 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
|
-
removeDirective(directiveName: string): null | $
|
|
464
|
+
removeDirective(directiveName: string): null | $T<TElement>;
|
|
459
465
|
/**
|
|
460
466
|
* Hide or show all marked nodes which should be displayed depending on
|
|
461
467
|
* java script availability.
|
|
@@ -514,7 +520,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
514
520
|
* @returns Returns All $ wrapped dom nodes corresponding to given
|
|
515
521
|
* selectors.
|
|
516
522
|
*/
|
|
517
|
-
grabDomNodes(domNodeSelectors: Mapping, wrapperDomNode?: Node | null | string | $
|
|
523
|
+
grabDomNodes(domNodeSelectors: Mapping, wrapperDomNode?: Node | null | string | $T<Node>): $DomNodes;
|
|
518
524
|
/**
|
|
519
525
|
* Overwrites all inherited variables from parent scope with "undefined".
|
|
520
526
|
* @param this - Indicates an unbound method.
|
|
@@ -619,7 +625,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
619
625
|
*
|
|
620
626
|
* @returns Returns $'s grabbed dom node.
|
|
621
627
|
*/
|
|
622
|
-
on<TElement = HTMLElement>(...parameters: Array<unknown>): $
|
|
628
|
+
on<TElement = HTMLElement>(...parameters: Array<unknown>): $T<TElement>;
|
|
623
629
|
/**
|
|
624
630
|
* A wrapper method fo "$.off()". It sets current plugin name as event
|
|
625
631
|
* scope if no scope is given. Given arguments are modified and passed
|
|
@@ -628,7 +634,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
628
634
|
*
|
|
629
635
|
* @returns Returns $'s grabbed dom node.
|
|
630
636
|
*/
|
|
631
|
-
off<TElement = HTMLElement>(...parameters: Array<unknown>): $
|
|
637
|
+
off<TElement = HTMLElement>(...parameters: Array<unknown>): $T<TElement>;
|
|
632
638
|
/**
|
|
633
639
|
* Adds dynamic getter and setter to any given data structure such as maps.
|
|
634
640
|
* @param this - Indicates an unbound method.
|
|
@@ -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: $
|
|
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.
|
|
@@ -1557,7 +1581,7 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
1557
1581
|
*
|
|
1558
1582
|
* @returns Returns the dynamically created iframe.
|
|
1559
1583
|
*/
|
|
1560
|
-
sendToExternalURL: (url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean) => $
|
|
1584
|
+
sendToExternalURL: (url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean) => $T<HTMLIFrameElement>;
|
|
1561
1585
|
/**
|
|
1562
1586
|
* Copies given source directory via path to given target directory
|
|
1563
1587
|
* location with same target name as source file has or copy to given
|
|
@@ -1709,13 +1733,13 @@ export declare class Tools<TElement = HTMLElement, LockType = string | void> {
|
|
|
1709
1733
|
*
|
|
1710
1734
|
* @returns Returns $'s wrapped dom node.
|
|
1711
1735
|
*/
|
|
1712
|
-
_bindEventHelper: <TElement_1 = HTMLElement>(parameters: Array<unknown>, removeEvent?: boolean, eventFunctionName?: string | undefined) => $
|
|
1736
|
+
_bindEventHelper: <TElement_1 = HTMLElement>(parameters: Array<unknown>, removeEvent?: boolean, eventFunctionName?: string | undefined) => $T<TElement_1>;
|
|
1713
1737
|
}
|
|
1714
1738
|
/**
|
|
1715
1739
|
* Dom bound version of Tools class.
|
|
1716
1740
|
*/
|
|
1717
|
-
export declare class BoundTools<TElement extends HTMLElement = HTMLElement
|
|
1718
|
-
$domNode: $
|
|
1741
|
+
export declare class BoundTools<TElement extends HTMLElement = HTMLElement> extends Tools<TElement> {
|
|
1742
|
+
$domNode: $T<TElement>;
|
|
1719
1743
|
readonly self: typeof BoundTools;
|
|
1720
1744
|
/**
|
|
1721
1745
|
* This method should be overwritten normally. It is triggered if current
|
|
@@ -1732,7 +1756,7 @@ export declare class BoundTools<TElement extends HTMLElement = HTMLElement, Lock
|
|
|
1732
1756
|
*
|
|
1733
1757
|
* @returns Nothing.
|
|
1734
1758
|
*/
|
|
1735
|
-
constructor($domNode: $
|
|
1759
|
+
constructor($domNode: $T<TElement>, ...additionalParameters: ParametersExceptFirst<Tools['constructor']>);
|
|
1736
1760
|
}
|
|
1737
1761
|
export default Tools;
|
|
1738
1762
|
export declare const augment$: (value: $TStatic) => void;
|