clientnode 4.0.1491 → 4.0.1492

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 (113) hide show
  1. package/dist/Lock.js +83 -68
  2. package/dist/Logger.js +163 -693
  3. package/dist/Semaphore.js +46 -55
  4. package/dist/array.js +337 -545
  5. package/dist/cli.js +37 -44
  6. package/dist/constants.js +110 -184
  7. package/dist/context.js +25 -209
  8. package/dist/cookie.js +48 -204
  9. package/dist/data-transfer.js +166 -701
  10. package/dist/datetime.js +245 -1042
  11. package/dist/domNode.js +277 -427
  12. package/dist/expression/evaluators.js +234 -1108
  13. package/dist/expression/helper.js +82 -100
  14. package/dist/expression/index.js +10 -1253
  15. package/dist/expression/indicator-functions.js +21 -208
  16. package/dist/expression/type.js +5 -1
  17. package/dist/filesystem.js +324 -286
  18. package/dist/function.js +51 -90
  19. package/dist/index.js +26 -3059
  20. package/dist/indicators.js +79 -418
  21. package/dist/module.js +109 -154
  22. package/dist/number.js +25 -397
  23. package/dist/object.js +803 -849
  24. package/dist/process.js +38 -200
  25. package/dist/property-types.js +96 -17
  26. package/dist/scope.js +56 -1982
  27. package/dist/string.js +626 -924
  28. package/dist/test-helper.js +289 -514
  29. package/dist/type.js +9 -4
  30. package/dist/utility.js +91 -310
  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/index.js +0 -4507
  37. package/dist/cli.d.ts +0 -31
  38. package/dist/compatible/Lock.js +0 -85
  39. package/dist/compatible/Logger.js +0 -715
  40. package/dist/compatible/Semaphore.js +0 -74
  41. package/dist/compatible/array.js +0 -660
  42. package/dist/compatible/cli.js +0 -58
  43. package/dist/compatible/constants.js +0 -200
  44. package/dist/compatible/context.js +0 -224
  45. package/dist/compatible/cookie.js +0 -240
  46. package/dist/compatible/data-transfer.js +0 -751
  47. package/dist/compatible/datetime.js +0 -1083
  48. package/dist/compatible/domNode.js +0 -481
  49. package/dist/compatible/expression/evaluators.js +0 -1147
  50. package/dist/compatible/expression/helper.js +0 -115
  51. package/dist/compatible/expression/index.js +0 -1269
  52. package/dist/compatible/expression/indicator-functions.js +0 -224
  53. package/dist/compatible/expression/type.js +0 -16
  54. package/dist/compatible/filesystem.js +0 -373
  55. package/dist/compatible/function.js +0 -114
  56. package/dist/compatible/index.js +0 -3076
  57. package/dist/compatible/indicators.js +0 -471
  58. package/dist/compatible/module.js +0 -168
  59. package/dist/compatible/number.js +0 -433
  60. package/dist/compatible/object.js +0 -1037
  61. package/dist/compatible/process.js +0 -230
  62. package/dist/compatible/property-types.js +0 -36
  63. package/dist/compatible/scope.js +0 -2011
  64. package/dist/compatible/string.js +0 -1151
  65. package/dist/compatible/test-helper.js +0 -837
  66. package/dist/compatible/type.js +0 -16
  67. package/dist/compatible/utility.js +0 -358
  68. package/dist/constants.d.ts +0 -99
  69. package/dist/context.d.ts +0 -8
  70. package/dist/cookie.d.ts +0 -31
  71. package/dist/data-transfer.d.ts +0 -45
  72. package/dist/datetime.d.ts +0 -37
  73. package/dist/domNode.d.ts +0 -82
  74. package/dist/expression/evaluators.d.ts +0 -55
  75. package/dist/expression/helper.d.ts +0 -4
  76. package/dist/expression/index.d.ts +0 -7
  77. package/dist/expression/indicator-functions.d.ts +0 -14
  78. package/dist/expression/type.d.ts +0 -70
  79. package/dist/filesystem.d.ts +0 -143
  80. package/dist/function.d.ts +0 -20
  81. package/dist/index.d.ts +0 -23
  82. package/dist/indicators.d.ts +0 -68
  83. package/dist/module.d.ts +0 -10
  84. package/dist/number.d.ts +0 -35
  85. package/dist/object.d.ts +0 -231
  86. package/dist/process.d.ts +0 -22
  87. package/dist/property-types.d.ts +0 -460
  88. package/dist/scope.d.ts +0 -44
  89. package/dist/string.d.ts +0 -319
  90. package/dist/test/Lock.d.ts +0 -1
  91. package/dist/test/Logger.d.ts +0 -1
  92. package/dist/test/Semaphore.d.ts +0 -1
  93. package/dist/test/array.d.ts +0 -1
  94. package/dist/test/cookie.d.ts +0 -1
  95. package/dist/test/data-transfer.d.ts +0 -1
  96. package/dist/test/datetime.d.ts +0 -1
  97. package/dist/test/domNode.d.ts +0 -1
  98. package/dist/test/expression/evaluators.d.ts +0 -1
  99. package/dist/test/expression/helper.d.ts +0 -1
  100. package/dist/test/expression/indicator-functions.d.ts +0 -1
  101. package/dist/test/filesystem.d.ts +0 -1
  102. package/dist/test/function.d.ts +0 -1
  103. package/dist/test/indicators.d.ts +0 -1
  104. package/dist/test/number.d.ts +0 -1
  105. package/dist/test/object.d.ts +0 -1
  106. package/dist/test/process.d.ts +0 -1
  107. package/dist/test/property-types.d.ts +0 -1
  108. package/dist/test/scope.d.ts +0 -1
  109. package/dist/test/string.d.ts +0 -1
  110. package/dist/test/utility.d.ts +0 -1
  111. package/dist/test-helper.d.ts +0 -245
  112. package/dist/type.d.ts +0 -248
  113. package/dist/utility.d.ts +0 -44
package/dist/type.d.ts DELETED
@@ -1,248 +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 FunctionTestAgainstResolvedPromiseTuple<FunctionType extends AnyFunction> = [Promise<ReturnType<FunctionType>>, ...Parameters<FunctionType>];
17
- export type FunctionTestPromiseTuple<FunctionType extends AnyFunction> = [
18
- ThenParameter<ReturnType<FunctionType>>,
19
- ...Parameters<FunctionType>
20
- ];
21
- export type FunctionTestPromiseAgainstResolvedPromiseTuple<FunctionType extends AnyFunction> = [
22
- Promise<ThenParameter<ReturnType<FunctionType>>>,
23
- ...Parameters<FunctionType>
24
- ];
25
- export type FunctionTestPromiseRejectionTuple<FunctionType extends AnyFunction> = [Error, ...Parameters<FunctionType>];
26
- export type FunctionTestPromiseRejectionAgainstResolvedPromiseTuple<FunctionType extends AnyFunction> = [Promise<Error>, ...Parameters<FunctionType>];
27
- export type TestSymbol = (typeof TEST_DEFINED_SYMBOL | typeof TEST_THROW_SYMBOL | typeof TEST_UNDEFINED_SYMBOL);
28
- export type ThenParameter<Type> = Type extends PromiseLike<infer U> ? U : Type;
29
- export type ThenParameterRecursive<Type> = Type extends PromiseLike<infer U> ? ThenParameterRecursive<U> : Type;
30
- export type ValueOf<Type> = Type[keyof Type];
31
- export type RecursiveNonNullable<Type> = {
32
- [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]>;
33
- };
34
- export type RecursivePartial<Type> = Partial<Type> | {
35
- [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]>;
36
- };
37
- export type FileTraverseResult = false | null | Promise<false | null | undefined> | undefined;
38
- export type TestMatchers<T extends Promise<void> | void> = Matchers<T> & {
39
- not: Matchers<T>;
40
- };
41
- export type ImportFunction = (id: string) => Promise<ReturnType<typeof require>>;
42
- export type HTMLItem = Comment | HTMLElement | Text;
43
- export type Primitive = boolean | null | number | string | undefined;
44
- export type Mapping<V = string, K extends string = string> = Record<K, V>;
45
- export type PlainObject<V = Primitive, K extends string = string> = {
46
- [key in K]: Array<PlainObject<V, K> | V> | PlainObject<V, K> | V;
47
- };
48
- export interface ProxyHandler<T = unknown> {
49
- deleteProperty: (target: T, key: string | symbol) => boolean;
50
- get: (target: T, key: string | symbol) => unknown;
51
- has: (target: T, key: string | symbol) => boolean;
52
- set: (target: T, key: string | symbol, value: unknown) => boolean;
53
- }
54
- export type ProxyType<T = unknown> = T & {
55
- __revoke__?: () => void;
56
- __target__: T;
57
- };
58
- export interface CookieOptions {
59
- domain: string;
60
- httpOnly: boolean;
61
- minimal: boolean;
62
- numberOfDaysUntilExpiration: number;
63
- path: string;
64
- sameSite: 'Lax' | 'None' | 'Strict' | '';
65
- secure: boolean;
66
- }
67
- export interface KnownWindowEventMap extends WindowEventMap {
68
- DOMMouseScroll: Event;
69
- mousewheel: Event;
70
- }
71
- export type KnownEventName = keyof KnownWindowEventMap;
72
- export type UnknownFunction = (...parameters: Array<unknown>) => unknown;
73
- export type ArrayTransformer<T = unknown, R = unknown, P = unknown> = (data: Array<T>, ...additionalParameter: Array<P>) => Array<R>;
74
- export type SynchronousProcedureFunction = (...parameters: Array<unknown>) => void;
75
- export type AsynchronousProcedureFunction = (...parameters: Array<unknown>) => Promise<void>;
76
- export type ProcedureFunction = AsynchronousProcedureFunction | SynchronousProcedureFunction;
77
- export type GetterFunction = (keyOrValue: unknown, key: string | symbol, target: unknown) => unknown;
78
- export type SetterFunction = (key: string | symbol, value: unknown, target: unknown) => unknown;
79
- export interface CheckReachabilityOptions {
80
- abortController: AbortController;
81
- expectedIntermediateStatusCodes: Array<number> | number;
82
- options: RequestInit;
83
- pollIntervallInSeconds: number;
84
- statusCodes: Array<number> | number;
85
- timeoutInSeconds: number;
86
- wait: boolean;
87
- }
88
- export interface CompareOptions {
89
- compareBlobs: boolean;
90
- deep: number;
91
- exceptionPrefixes: Array<string>;
92
- ignoreFunctions: boolean;
93
- properties: Array<string> | null;
94
- returnReasonIfNotEqual: boolean;
95
- }
96
- export type Encoding = 'ascii' | 'base64' | 'base64url' | 'binary' | 'hex' | 'latin1' | 'ucs2' | 'ucs-2' | 'utf8' | 'utf16le' | 'utf-8';
97
- export interface File {
98
- directoryPath: string;
99
- directoryEntry: DirectoryEntry | null;
100
- error: Error | null;
101
- name: string;
102
- path: string;
103
- stats: FileStats | null;
104
- }
105
- export interface ProcessError extends Error {
106
- parameters: Array<unknown>;
107
- returnCode: number;
108
- }
109
- export type QueryParameters = Array<Array<string> | string> & Mapping<Array<string> | string>;
110
- export interface TimeoutPromise extends Promise<boolean> {
111
- clear: () => void;
112
- timeoutID: NodeJS.Timeout;
113
- }
114
- export type ObjectMask = Array<string> | boolean | {
115
- [key: string]: ObjectMask;
116
- };
117
- export type NormalizedObjectMask = boolean | Mapping<ObjectMask>;
118
- export interface ObjectMaskConfiguration {
119
- exclude?: ObjectMask;
120
- include?: ObjectMask;
121
- }
122
- export interface ExpressionOptions {
123
- async: boolean;
124
- execute: boolean;
125
- removeGlobalScope: boolean;
126
- binding: unknown;
127
- }
128
- export interface CompileExpressionOptions<N extends Array<string> = Array<string>> extends ExpressionOptions {
129
- scope: Mapping<unknown> | N | N[number] | string;
130
- }
131
- export interface EvaluateExpressionOptions<S extends object = object> extends ExpressionOptions {
132
- scope: S;
133
- }
134
- export interface EvaluateObject {
135
- __evaluate__: string;
136
- }
137
- export interface ExecuteObject {
138
- __execute__: string;
139
- }
140
- export type Evaluateable = EvaluateObject | ExecuteObject;
141
- export type EvaluatedObject<Type extends object> = {
142
- [Property in keyof Type]: (Type[Property] extends Evaluateable ? unknown : Type[Property] extends object ? EvaluatedObject<Type[Property]> : Type[Property]);
143
- };
144
- export type RecursiveEvaluateable<Type> = Evaluateable | {
145
- [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]));
146
- };
147
- export interface AsyncEvaluateObject {
148
- __await_evaluate__: string;
149
- }
150
- export interface AsyncExecuteObject {
151
- __await_execute__: string;
152
- }
153
- export type AsyncEvaluateable = AsyncEvaluateObject | AsyncExecuteObject;
154
- export type AsyncEvaluatedObject<Type extends object> = {
155
- [Property in keyof Type]: (Type[Property] extends AsyncEvaluateable ? unknown : Type[Property] extends object ? AsyncEvaluatedObject<Type[Property]> : Type[Property]);
156
- };
157
- export type RecursiveAsyncEvaluateable<Type> = AsyncEvaluateable | {
158
- [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]));
159
- };
160
- export interface PaginateOptions {
161
- boundaryCount: number;
162
- disabled: boolean;
163
- hideNextButton: boolean;
164
- hidePrevButton: boolean;
165
- page: number;
166
- pageSize?: null | number;
167
- showFirstButton: boolean;
168
- showLastButton: boolean;
169
- siblingCount: number;
170
- total: number;
171
- }
172
- export interface Page {
173
- disabled: boolean;
174
- page?: number;
175
- selected: boolean;
176
- type: PageType;
177
- }
178
- export type PageType = 'end-ellipsis' | 'first' | 'last' | 'next' | 'page' | 'previous' | 'start-ellipsis';
179
- export interface Offset {
180
- left: number;
181
- top: number;
182
- }
183
- export interface Position extends Offset {
184
- bottom: number;
185
- right: number;
186
- }
187
- export type ProcessHandler = (returnCode: unknown, ...parameters: Array<unknown>) => void;
188
- export interface ProcessCloseReason {
189
- parameters: Array<unknown>;
190
- reason: unknown;
191
- }
192
- export type ProcessCloseCallback = (reason: ProcessCloseReason) => void;
193
- export type ProcessErrorCallback = (reason: ProcessError) => void;
194
- export type RelativePosition = 'above' | 'below' | 'in' | 'left' | 'right';
195
- export type TemplateFunction<Type = string> = (...parameters: Array<unknown>) => Type;
196
- export interface CompilationResult<T = string, N extends Array<string> = Array<string>> {
197
- error: null | string;
198
- globalNames: Array<string>;
199
- globalNamesUndefinedList: Array<undefined>;
200
- originalScopeNames: N;
201
- scopeNameMapping: Record<N[number], string>;
202
- scopeNames: Array<string>;
203
- templateFunction: TemplateFunction<T>;
204
- }
205
- export interface NegativeEvaluationResult {
206
- compileError: null | string;
207
- error: string;
208
- result: undefined;
209
- runtimeError: null | string;
210
- }
211
- export interface PositiveEvaluationResult<Type = string> {
212
- compileError: null;
213
- error: null;
214
- result: Type;
215
- runtimeError: null;
216
- }
217
- export type EvaluationResult<Type = string> = PositiveEvaluationResult<Type> | NegativeEvaluationResult;
218
- export type LockCallbackFunction<Type> = (description?: string) => Promise<Type> | Type;
219
- export interface StringMarkOptions {
220
- marker: ((foundWord: string, markedTarget: Array<unknown>) => unknown) | string;
221
- normalizer: (value: unknown) => string;
222
- skipTagDelimitedParts: null | [string, string];
223
- }
224
- export interface InterruptableScrollToOptions {
225
- targetDomNode: HTMLElement;
226
- containerDomNode: HTMLElement | Window;
227
- durationInMilliseconds: number;
228
- interruptOnManualScroll: boolean;
229
- offset: {
230
- top: number;
231
- left: number;
232
- };
233
- }
234
- export interface GivenInterruptableScrollToOptions extends Partial<ScrollToOptions> {
235
- targetDomNode?: Node | null;
236
- containerDomNode?: Node | null | Window;
237
- offset?: Partial<InterruptableScrollToOptions['offset']>;
238
- }
239
- export interface LoggerOptions {
240
- level: Level;
241
- name: string;
242
- }
243
- export interface EvaluateDynamicDataOptions {
244
- scope: Mapping<unknown>;
245
- selfReferenceName: string;
246
- expressionIndicatorKey: string;
247
- executionIndicatorKey: string;
248
- }
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;