clientnode 4.0.1447 → 4.0.1448

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.
Files changed (142) hide show
  1. package/dist/Lock.js +83 -69
  2. package/dist/Logger.js +163 -756
  3. package/dist/Semaphore.js +46 -56
  4. package/dist/array.js +337 -661
  5. package/dist/cli.js +37 -45
  6. package/dist/constants.js +110 -198
  7. package/dist/context.js +25 -265
  8. package/dist/cookie.js +48 -265
  9. package/dist/data-transfer.js +166 -775
  10. package/dist/datetime.js +241 -1107
  11. package/dist/domNode.js +277 -495
  12. package/dist/expression/evaluators.js +234 -1189
  13. package/dist/expression/helper.js +82 -102
  14. package/dist/expression/index.js +10 -1341
  15. package/dist/expression/indicator-functions.js +21 -316
  16. package/dist/expression/type.js +5 -1
  17. package/dist/filesystem.js +323 -349
  18. package/dist/function.js +51 -93
  19. package/dist/index.js +26 -3232
  20. package/dist/indicators.js +68 -512
  21. package/dist/module.js +99 -197
  22. package/dist/number.js +25 -491
  23. package/dist/object.js +783 -917
  24. package/dist/process.js +38 -261
  25. package/dist/property-types.js +96 -17
  26. package/dist/scope.js +56 -2092
  27. package/dist/string.js +603 -991
  28. package/dist/test-helper.js +171 -633
  29. package/dist/type.js +9 -4
  30. package/dist/utility.js +91 -372
  31. package/package.json +2 -2
  32. package/dist/Lock.d.ts +0 -39
  33. package/dist/Logger.d.ts +0 -102
  34. package/dist/Semaphore.d.ts +0 -29
  35. package/dist/array.d.ts +0 -150
  36. package/dist/bundle/Lock.js +0 -86
  37. package/dist/bundle/Logger.js +0 -778
  38. package/dist/bundle/Semaphore.js +0 -75
  39. package/dist/bundle/array.js +0 -776
  40. package/dist/bundle/cli.js +0 -59
  41. package/dist/bundle/constants.js +0 -214
  42. package/dist/bundle/context.js +0 -280
  43. package/dist/bundle/cookie.js +0 -301
  44. package/dist/bundle/data-transfer.js +0 -825
  45. package/dist/bundle/datetime.js +0 -1148
  46. package/dist/bundle/domNode.js +0 -549
  47. package/dist/bundle/expression/evaluators.js +0 -1228
  48. package/dist/bundle/expression/helper.js +0 -117
  49. package/dist/bundle/expression/index.js +0 -1357
  50. package/dist/bundle/expression/indicator-functions.js +0 -332
  51. package/dist/bundle/expression/type.js +0 -16
  52. package/dist/bundle/filesystem.js +0 -436
  53. package/dist/bundle/function.js +0 -117
  54. package/dist/bundle/index.js +0 -3249
  55. package/dist/bundle/indicators.js +0 -565
  56. package/dist/bundle/module.js +0 -213
  57. package/dist/bundle/number.js +0 -527
  58. package/dist/bundle/object.js +0 -1104
  59. package/dist/bundle/process.js +0 -291
  60. package/dist/bundle/property-types.js +0 -36
  61. package/dist/bundle/scope.js +0 -2121
  62. package/dist/bundle/string.js +0 -1213
  63. package/dist/bundle/test-helper.js +0 -802
  64. package/dist/bundle/type.js +0 -16
  65. package/dist/bundle/utility.js +0 -420
  66. package/dist/cli.d.ts +0 -31
  67. package/dist/compatible/Lock.js +0 -86
  68. package/dist/compatible/Logger.js +0 -778
  69. package/dist/compatible/Semaphore.js +0 -75
  70. package/dist/compatible/array.js +0 -776
  71. package/dist/compatible/cli.js +0 -59
  72. package/dist/compatible/constants.js +0 -214
  73. package/dist/compatible/context.js +0 -280
  74. package/dist/compatible/cookie.js +0 -301
  75. package/dist/compatible/data-transfer.js +0 -825
  76. package/dist/compatible/datetime.js +0 -1148
  77. package/dist/compatible/domNode.js +0 -549
  78. package/dist/compatible/expression/evaluators.js +0 -1228
  79. package/dist/compatible/expression/helper.js +0 -117
  80. package/dist/compatible/expression/index.js +0 -1357
  81. package/dist/compatible/expression/indicator-functions.js +0 -332
  82. package/dist/compatible/expression/type.js +0 -16
  83. package/dist/compatible/filesystem.js +0 -436
  84. package/dist/compatible/function.js +0 -117
  85. package/dist/compatible/index.js +0 -3249
  86. package/dist/compatible/indicators.js +0 -565
  87. package/dist/compatible/module.js +0 -213
  88. package/dist/compatible/number.js +0 -527
  89. package/dist/compatible/object.js +0 -1104
  90. package/dist/compatible/process.js +0 -291
  91. package/dist/compatible/property-types.js +0 -36
  92. package/dist/compatible/scope.js +0 -2121
  93. package/dist/compatible/string.js +0 -1213
  94. package/dist/compatible/test-helper.js +0 -802
  95. package/dist/compatible/type.js +0 -16
  96. package/dist/compatible/utility.js +0 -420
  97. package/dist/constants.d.ts +0 -99
  98. package/dist/context.d.ts +0 -8
  99. package/dist/cookie.d.ts +0 -31
  100. package/dist/data-transfer.d.ts +0 -45
  101. package/dist/datetime.d.ts +0 -37
  102. package/dist/domNode.d.ts +0 -82
  103. package/dist/expression/evaluators.d.ts +0 -55
  104. package/dist/expression/helper.d.ts +0 -4
  105. package/dist/expression/index.d.ts +0 -7
  106. package/dist/expression/indicator-functions.d.ts +0 -14
  107. package/dist/expression/type.d.ts +0 -70
  108. package/dist/filesystem.d.ts +0 -143
  109. package/dist/function.d.ts +0 -20
  110. package/dist/index.d.ts +0 -23
  111. package/dist/indicators.d.ts +0 -68
  112. package/dist/module.d.ts +0 -8
  113. package/dist/number.d.ts +0 -35
  114. package/dist/object.d.ts +0 -231
  115. package/dist/process.d.ts +0 -22
  116. package/dist/property-types.d.ts +0 -460
  117. package/dist/scope.d.ts +0 -44
  118. package/dist/string.d.ts +0 -312
  119. package/dist/test/Lock.d.ts +0 -1
  120. package/dist/test/Logger.d.ts +0 -1
  121. package/dist/test/Semaphore.d.ts +0 -1
  122. package/dist/test/array.d.ts +0 -1
  123. package/dist/test/cookie.d.ts +0 -1
  124. package/dist/test/data-transfer.d.ts +0 -1
  125. package/dist/test/datetime.d.ts +0 -1
  126. package/dist/test/domNode.d.ts +0 -1
  127. package/dist/test/expression/evaluators.d.ts +0 -1
  128. package/dist/test/expression/helper.d.ts +0 -1
  129. package/dist/test/expression/indicator-functions.d.ts +0 -1
  130. package/dist/test/filesystem.d.ts +0 -1
  131. package/dist/test/function.d.ts +0 -1
  132. package/dist/test/indicators.d.ts +0 -1
  133. package/dist/test/number.d.ts +0 -1
  134. package/dist/test/object.d.ts +0 -1
  135. package/dist/test/process.d.ts +0 -1
  136. package/dist/test/property-types.d.ts +0 -1
  137. package/dist/test/scope.d.ts +0 -1
  138. package/dist/test/string.d.ts +0 -1
  139. package/dist/test/utility.d.ts +0 -1
  140. package/dist/test-helper.d.ts +0 -143
  141. package/dist/type.d.ts +0 -230
  142. package/dist/utility.d.ts +0 -44
package/dist/type.d.ts DELETED
@@ -1,230 +0,0 @@
1
- import type { Matchers } from 'expect';
2
- import type { Dirent as DirectoryEntry, Stats as FileStats } from 'fs';
3
- import type { Level } from './Logger';
4
- import type { TEST_DEFINED_SYMBOL, TEST_THROW_SYMBOL, TEST_UNDEFINED_SYMBOL } from './test-helper';
5
- export type AnyFunction = (...parameters: Array<any>) => any;
6
- export type Unpacked<T> = T extends Array<infer U> ? U : T extends (...parameters: Array<unknown>) => infer U ? U : T extends Promise<infer U> ? U : T;
7
- export type FirstParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[0];
8
- export type SecondParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[1];
9
- export type ThirdParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[2];
10
- export type ParametersExceptFirst<FunctionType> = FunctionType extends (parameter: any, ...additionalParameters: infer AdditionalParameters) => any ? AdditionalParameters : [
11
- ];
12
- export type FunctionTestTuple<FunctionType extends AnyFunction> = [
13
- ReturnType<FunctionType>,
14
- ...Parameters<FunctionType>
15
- ];
16
- export type FunctionTestPromiseTuple<FunctionType extends AnyFunction> = [
17
- ThenParameter<ReturnType<FunctionType>>,
18
- ...Parameters<FunctionType>
19
- ];
20
- export type FunctionTestPromiseRejectionTuple<FunctionType extends AnyFunction> = [Error, ...Parameters<FunctionType>];
21
- export type TestSymbol = (typeof TEST_DEFINED_SYMBOL | typeof TEST_THROW_SYMBOL | typeof TEST_UNDEFINED_SYMBOL);
22
- export type ThenParameter<Type> = Type extends PromiseLike<infer U> ? U : Type;
23
- export type ThenParameterRecursive<Type> = Type extends PromiseLike<infer U> ? ThenParameterRecursive<U> : Type;
24
- export type ValueOf<Type> = Type[keyof Type];
25
- export type RecursiveNonNullable<Type> = {
26
- [Property in keyof Type]: Type[Property] extends Array<infer OtherType> ? Array<RecursiveNonNullable<OtherType>> : Type[Property] extends AnyFunction ? NonNullable<Type[Property]> : Type[Property] extends Mapping<unknown> ? RecursiveNonNullable<Type[Property]> : NonNullable<Type[Property]>;
27
- };
28
- export type RecursivePartial<Type> = Partial<Type> | {
29
- [Property in keyof Type]?: Type[Property] extends Array<infer OtherType> ? Array<RecursivePartial<OtherType>> : Type[Property] extends AnyFunction ? Partial<Type[Property]> : Type[Property] extends Mapping<unknown> ? RecursivePartial<Type[Property]> : Partial<Type[Property]>;
30
- };
31
- export type FileTraverseResult = false | null | Promise<false | null | undefined> | undefined;
32
- export type TestMatchers<T extends Promise<void> | void> = Matchers<T> & {
33
- not: Matchers<T>;
34
- };
35
- export type ImportFunction = (id: string) => Promise<ReturnType<typeof require>>;
36
- export type HTMLItem = Comment | HTMLElement | Text;
37
- export type Primitive = boolean | null | number | string | undefined;
38
- export type Mapping<V = string, K extends string = string> = Record<K, V>;
39
- export type PlainObject<V = Primitive, K extends string = string> = {
40
- [key in K]: Array<PlainObject<V, K> | V> | PlainObject<V, K> | V;
41
- };
42
- export interface ProxyHandler<T = unknown> {
43
- deleteProperty: (target: T, key: string | symbol) => boolean;
44
- get: (target: T, key: string | symbol) => unknown;
45
- has: (target: T, key: string | symbol) => boolean;
46
- set: (target: T, key: string | symbol, value: unknown) => boolean;
47
- }
48
- export type ProxyType<T = unknown> = T & {
49
- __revoke__?: () => void;
50
- __target__: T;
51
- };
52
- export interface CookieOptions {
53
- domain: string;
54
- httpOnly: boolean;
55
- minimal: boolean;
56
- numberOfDaysUntilExpiration: number;
57
- path: string;
58
- sameSite: 'Lax' | 'None' | 'Strict' | '';
59
- secure: boolean;
60
- }
61
- export interface KnownWindowEventMap extends WindowEventMap {
62
- DOMMouseScroll: Event;
63
- mousewheel: Event;
64
- }
65
- export type KnownEventName = keyof KnownWindowEventMap;
66
- export type UnknownFunction = (...parameters: Array<unknown>) => unknown;
67
- export type ArrayTransformer<T = unknown, R = unknown, P = unknown> = (data: Array<T>, ...additionalParameter: Array<P>) => Array<R>;
68
- export type SynchronousProcedureFunction = (...parameters: Array<unknown>) => void;
69
- export type AsynchronousProcedureFunction = (...parameters: Array<unknown>) => Promise<void>;
70
- export type ProcedureFunction = AsynchronousProcedureFunction | SynchronousProcedureFunction;
71
- export type GetterFunction = (keyOrValue: unknown, key: string | symbol, target: unknown) => unknown;
72
- export type SetterFunction = (key: string | symbol, value: unknown, target: unknown) => unknown;
73
- export interface CheckReachabilityOptions {
74
- abortController: AbortController;
75
- expectedIntermediateStatusCodes: Array<number> | number;
76
- options: RequestInit;
77
- pollIntervallInSeconds: number;
78
- statusCodes: Array<number> | number;
79
- timeoutInSeconds: number;
80
- wait: boolean;
81
- }
82
- export interface CompareOptions {
83
- compareBlobs: boolean;
84
- deep: number;
85
- exceptionPrefixes: Array<string>;
86
- ignoreFunctions: boolean;
87
- properties: Array<string> | null;
88
- returnReasonIfNotEqual: boolean;
89
- }
90
- export type Encoding = 'ascii' | 'base64' | 'base64url' | 'binary' | 'hex' | 'latin1' | 'ucs2' | 'ucs-2' | 'utf8' | 'utf16le' | 'utf-8';
91
- export interface File {
92
- directoryPath: string;
93
- directoryEntry: DirectoryEntry | null;
94
- error: Error | null;
95
- name: string;
96
- path: string;
97
- stats: FileStats | null;
98
- }
99
- export interface ProcessError extends Error {
100
- parameters: Array<unknown>;
101
- returnCode: number;
102
- }
103
- export type QueryParameters = Array<Array<string> | string> & Mapping<Array<string> | string>;
104
- export interface TimeoutPromise extends Promise<boolean> {
105
- clear: () => void;
106
- timeoutID: NodeJS.Timeout;
107
- }
108
- export type ObjectMask = Array<string> | boolean | {
109
- [key: string]: ObjectMask;
110
- };
111
- export type NormalizedObjectMask = boolean | Mapping<ObjectMask>;
112
- export interface ObjectMaskConfiguration {
113
- exclude?: ObjectMask;
114
- include?: ObjectMask;
115
- }
116
- export interface EvaluateObject {
117
- __evaluate__: string;
118
- }
119
- export interface ExecuteObject {
120
- __execute__: string;
121
- }
122
- export type Evaluateable = EvaluateObject | ExecuteObject;
123
- export type EvaluatedObject<Type extends object> = {
124
- [Property in keyof Type]: (Type[Property] extends Evaluateable ? unknown : Type[Property] extends object ? EvaluatedObject<Type[Property]> : Type[Property]);
125
- };
126
- export type RecursiveEvaluateable<Type> = Evaluateable | {
127
- [Property in keyof Type]: (Evaluateable | (Type[Property] extends Array<infer OtherType> ? Array<RecursiveEvaluateable<OtherType>> : Type[Property] extends Mapping<unknown> ? RecursiveEvaluateable<Type[Property]> : Evaluateable | Type[Property]));
128
- };
129
- export interface AsyncEvaluateObject {
130
- __await_evaluate__: string;
131
- }
132
- export interface AsyncExecuteObject {
133
- __await_execute__: string;
134
- }
135
- export type AsyncEvaluateable = AsyncEvaluateObject | AsyncExecuteObject;
136
- export type AsyncEvaluatedObject<Type extends object> = {
137
- [Property in keyof Type]: (Type[Property] extends AsyncEvaluateable ? unknown : Type[Property] extends object ? AsyncEvaluatedObject<Type[Property]> : Type[Property]);
138
- };
139
- export type RecursiveAsyncEvaluateable<Type> = AsyncEvaluateable | {
140
- [Property in keyof Type]: (AsyncEvaluateable | (Type[Property] extends Array<infer OtherType> ? Array<RecursiveAsyncEvaluateable<OtherType>> : Type[Property] extends Mapping<unknown> ? RecursiveAsyncEvaluateable<Type[Property]> : AsyncEvaluateable | Type[Property]));
141
- };
142
- export interface PaginateOptions {
143
- boundaryCount: number;
144
- disabled: boolean;
145
- hideNextButton: boolean;
146
- hidePrevButton: boolean;
147
- page: number;
148
- pageSize?: null | number;
149
- showFirstButton: boolean;
150
- showLastButton: boolean;
151
- siblingCount: number;
152
- total: number;
153
- }
154
- export interface Page {
155
- disabled: boolean;
156
- page?: number;
157
- selected: boolean;
158
- type: PageType;
159
- }
160
- export type PageType = 'end-ellipsis' | 'first' | 'last' | 'next' | 'page' | 'previous' | 'start-ellipsis';
161
- export interface Offset {
162
- left: number;
163
- top: number;
164
- }
165
- export interface Position extends Offset {
166
- bottom: number;
167
- right: number;
168
- }
169
- export type ProcessHandler = (returnCode: unknown, ...parameters: Array<unknown>) => void;
170
- export interface ProcessCloseReason {
171
- parameters: Array<unknown>;
172
- reason: unknown;
173
- }
174
- export type ProcessCloseCallback = (reason: ProcessCloseReason) => void;
175
- export type ProcessErrorCallback = (reason: ProcessError) => void;
176
- export type RelativePosition = 'above' | 'below' | 'in' | 'left' | 'right';
177
- export type TemplateFunction<Type = string> = (...parameters: Array<unknown>) => Type;
178
- export interface CompilationResult<T = string, N extends Array<string> = Array<string>> {
179
- error: null | string;
180
- globalNames: Array<string>;
181
- globalNamesUndefinedList: Array<undefined>;
182
- originalScopeNames: N;
183
- scopeNameMapping: Record<N[number], string>;
184
- scopeNames: Array<string>;
185
- templateFunction: TemplateFunction<T>;
186
- }
187
- export interface NegativeEvaluationResult {
188
- compileError: null | string;
189
- error: string;
190
- result: undefined;
191
- runtimeError: null | string;
192
- }
193
- export interface PositiveEvaluationResult<Type = string> {
194
- compileError: null;
195
- error: null;
196
- result: Type;
197
- runtimeError: null;
198
- }
199
- export type EvaluationResult<Type = string> = PositiveEvaluationResult<Type> | NegativeEvaluationResult;
200
- export type LockCallbackFunction<Type> = (description?: string) => Promise<Type> | Type;
201
- export interface StringMarkOptions {
202
- marker: ((foundWord: string, markedTarget: Array<unknown>) => unknown) | string;
203
- normalizer: (value: unknown) => string;
204
- skipTagDelimitedParts: null | [string, string];
205
- }
206
- export interface InterruptableScrollToOptions {
207
- targetDomNode: HTMLElement;
208
- containerDomNode: HTMLElement | Window;
209
- durationInMilliseconds: number;
210
- interruptOnManualScroll: boolean;
211
- offset: {
212
- top: number;
213
- left: number;
214
- };
215
- }
216
- export interface GivenInterruptableScrollToOptions extends Partial<ScrollToOptions> {
217
- targetDomNode?: Node | null;
218
- containerDomNode?: Node | null | Window;
219
- offset?: Partial<InterruptableScrollToOptions['offset']>;
220
- }
221
- export interface LoggerOptions {
222
- level: Level;
223
- name: string;
224
- }
225
- export interface EvaluateDynamicDataOptions {
226
- scope: Mapping<unknown>;
227
- selfReferenceName: string;
228
- expressionIndicatorKey: string;
229
- executionIndicatorKey: string;
230
- }
package/dist/utility.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import type { TimeoutPromise } from './type';
2
- /**
3
- * Prevents event functions from triggering too often by defining a minimal
4
- * span between each function call. Additional arguments given to this function
5
- * will be forwarded to the given event function call.
6
- * @param callback - The function to call debounced.
7
- * @param thresholdInMilliseconds - The minimum time span between each
8
- * function call.
9
- * @param additionalArguments - Additional arguments to forward to given
10
- * function.
11
- * @returns Returns the wrapped method.
12
- */
13
- export declare const trailingThrottle: <T = unknown>(callback: (...parameters: Array<unknown>) => T, thresholdInMilliseconds?: number, ...additionalArguments: Array<unknown>) => (...parameters: Array<unknown>) => void;
14
- /**
15
- * Prevents event functions from triggering too close after each trigger by
16
- * defining a minimal span between each function call. Additional arguments
17
- * given to this function will be forwarded to the given event function call.
18
- * @param callback - The function to call debounced.
19
- * @param thresholdInMilliseconds - The minimum time span between each
20
- * function call.
21
- * @param additionalArguments - Additional arguments to forward to given
22
- * function.
23
- * @returns Returns the wrapped method.
24
- */
25
- export declare const debounce: <T = unknown>(callback: (...parameters: Array<unknown>) => T, thresholdInMilliseconds?: number, ...additionalArguments: Array<unknown>) => ((...parameters: Array<unknown>) => Promise<T>);
26
- /**
27
- * Triggers given callback after given duration. Supports unlimited
28
- * duration length and returns a promise which will be resolved after given
29
- * duration has been passed.
30
- * @param parameters - Observes the first three existing parameters. If one
31
- * is a number it will be interpreted as delay in milliseconds until given
32
- * callback will be triggered. If one is of type function it will be used
33
- * as callback and if one is of type boolean it will indicate if returning
34
- * promise should be rejected or resolved if given internally created
35
- * timeout should be canceled. Additional parameters will be forwarded to
36
- * given callback.
37
- * @returns A promise resolving after given delay or being rejected if
38
- * value "true" is within one of the first three parameters. The promise
39
- * holds a boolean indicating whether timeout has been canceled or
40
- * resolved.
41
- */
42
- export declare const timeout: (...parameters: Array<unknown>) => TimeoutPromise;
43
- export declare const preventDefault: (event: Event) => void;
44
- export declare const stopPropagation: (event: Event) => void;