clientnode 3.0.1144 → 3.0.1146
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/Lock.d.ts +38 -0
- package/dist/Lock.js +1 -0
- package/dist/Semaphore.d.ts +29 -0
- package/dist/Semaphore.js +1 -0
- package/dist/Tools.d.ts +301 -0
- package/dist/Tools.js +1 -0
- package/dist/array.d.ts +150 -0
- package/dist/array.js +1 -0
- package/dist/constants.d.ts +63 -0
- package/dist/constants.js +1 -0
- package/dist/context.d.ts +11 -0
- package/dist/context.js +1 -0
- package/dist/cookie.d.ts +31 -0
- package/dist/cookie.js +1 -0
- package/dist/data-transfer.d.ts +64 -0
- package/dist/data-transfer.js +1 -0
- package/dist/datetime.d.ts +37 -0
- package/dist/datetime.js +1 -0
- package/dist/filesystem.d.ts +127 -0
- package/dist/filesystem.js +1 -0
- package/dist/function.d.ts +20 -0
- package/dist/function.js +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +1 -0
- package/dist/indicators.d.ts +68 -0
- package/dist/indicators.js +1 -0
- package/dist/number.d.ts +35 -0
- package/dist/number.js +1 -0
- package/dist/object.d.ts +221 -0
- package/dist/object.js +1 -0
- package/dist/process.d.ts +22 -0
- package/dist/process.js +1 -0
- package/dist/property-types.js +1 -0
- package/dist/require.d.ts +4 -0
- package/dist/require.js +1 -0
- package/dist/scope.d.ts +42 -0
- package/dist/scope.js +1 -0
- package/dist/string.d.ts +289 -0
- package/dist/string.js +1 -0
- package/dist/test/Lock.d.ts +1 -0
- package/dist/test/Semaphore.d.ts +1 -0
- package/dist/test/Tools.d.ts +1 -0
- package/dist/test/array.d.ts +1 -0
- package/dist/test/cookie.d.ts +1 -0
- package/dist/test/data-transfer.d.ts +1 -0
- package/dist/test/datetime.d.ts +1 -0
- package/dist/test/filesystem.d.ts +1 -0
- package/dist/test/function.d.ts +1 -0
- package/dist/test/indicators.d.ts +1 -0
- package/dist/test/number.d.ts +1 -0
- package/dist/test/object.d.ts +1 -0
- package/dist/test/process.d.ts +1 -0
- package/dist/test/property-types.d.ts +1 -0
- package/dist/test/scope.d.ts +1 -0
- package/dist/test/string.d.ts +1 -0
- package/dist/test/utility.d.ts +1 -0
- package/{testHelper.d.ts → dist/test-helper.d.ts} +5 -24
- package/dist/test-helper.js +1 -0
- package/{type.d.ts → dist/type.d.ts} +3 -7
- package/dist/type.js +1 -0
- package/dist/utility.d.ts +30 -0
- package/dist/utility.js +1 -0
- package/package.json +36 -24
- package/index.d.ts +0 -1694
- package/index.js +0 -1
- package/property-types.js +0 -1
- package/testHelper.js +0 -1
- /package/{property-types.d.ts → dist/property-types.d.ts} +0 -0
package/index.d.ts
DELETED
|
@@ -1,1694 +0,0 @@
|
|
|
1
|
-
/// <reference types="webpack-env" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import { ChildProcess } from 'child_process';
|
|
6
|
-
import { AnyFunction, CookieOptions, CheckReachabilityOptions, CompareOptions, CompilationResult, Encoding, EvaluationResult, File, FileTraversionResult, FirstParameter, GetterFunction, ImportFunction, LockCallbackFunction, Mapping, ObjectMaskConfiguration, Options, Page, PaginateOptions, ParametersExceptFirst, PlainObject, ProcessCloseCallback, ProcessErrorCallback, ProcessHandler, ProxyHandler, ProxyType, QueryParameters, RecursiveEvaluateable, RecursivePartial, RelativePosition, SecondParameter, Selector, SetterFunction, StringMarkOptions, TimeoutPromise, UnknownFunction, $DomNodes, $Global, $T, $TStatic } from './type';
|
|
7
|
-
export declare const DEFAULT_ENCODING: Encoding;
|
|
8
|
-
export declare const CloseEventNames: readonly ["close", "exit", "SIGINT", "SIGTERM", "SIGQUIT", "uncaughtException"];
|
|
9
|
-
export declare const ConsoleOutputMethods: readonly ["debug", "error", "info", "log", "warn"];
|
|
10
|
-
export declare const ValueCopySymbol: unique symbol;
|
|
11
|
-
export declare const IgnoreNullAndUndefinedSymbol: unique symbol;
|
|
12
|
-
export declare const determineGlobalContext: (() => $Global);
|
|
13
|
-
export declare let globalContext: $Global;
|
|
14
|
-
export declare const setGlobalContext: (context: $Global) => void;
|
|
15
|
-
export declare const currentRequire: null | typeof require;
|
|
16
|
-
export declare const currentImport: null | ImportFunction;
|
|
17
|
-
export declare const optionalRequire: <T = unknown>(id: string) => null | T;
|
|
18
|
-
export declare const determine$: (() => $TStatic);
|
|
19
|
-
export declare let $: JQueryStatic;
|
|
20
|
-
/**
|
|
21
|
-
* Represents the lock state.
|
|
22
|
-
* @property locks - Mapping of lock descriptions to there corresponding
|
|
23
|
-
* callbacks.
|
|
24
|
-
*/
|
|
25
|
-
export declare class Lock<Type = string | void> {
|
|
26
|
-
locks: Mapping<Array<LockCallbackFunction<Type>>>;
|
|
27
|
-
/**
|
|
28
|
-
* Initializes locks.
|
|
29
|
-
* @param locks - Mapping of a lock description to callbacks for calling
|
|
30
|
-
* when given lock should be released.
|
|
31
|
-
*
|
|
32
|
-
* @returns Nothing.
|
|
33
|
-
*/
|
|
34
|
-
constructor(locks?: Mapping<Array<LockCallbackFunction<Type>>>);
|
|
35
|
-
/**
|
|
36
|
-
* Calling this method introduces a starting point for a critical area with
|
|
37
|
-
* potential race conditions. The area will be binded to given description
|
|
38
|
-
* string. So don't use same names for different areas.
|
|
39
|
-
* @param description - A short string describing the critical areas
|
|
40
|
-
* properties.
|
|
41
|
-
* @param callback - A procedure which should only be executed if the
|
|
42
|
-
* interpreter isn't in the given critical area. The lock description
|
|
43
|
-
* string will be given to the callback function.
|
|
44
|
-
* @param autoRelease - Release the lock after execution of given callback.
|
|
45
|
-
*
|
|
46
|
-
* @returns Returns a promise which will be resolved after releasing lock.
|
|
47
|
-
*/
|
|
48
|
-
acquire(description: string, callback?: LockCallbackFunction<Type>, autoRelease?: boolean): Promise<Type>;
|
|
49
|
-
/**
|
|
50
|
-
* Calling this method causes the given critical area to be finished and
|
|
51
|
-
* all functions given to "acquire()" will be executed in right order.
|
|
52
|
-
* @param description - A short string describing the critical areas
|
|
53
|
-
* properties.
|
|
54
|
-
*
|
|
55
|
-
* @returns Returns the return (maybe promise resolved) value of the
|
|
56
|
-
* callback given to the "acquire" method.
|
|
57
|
-
*/
|
|
58
|
-
release(description: string): Promise<Type | void>;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Represents the semaphore state.
|
|
62
|
-
* @property queue - List of waiting resource requests.
|
|
63
|
-
*
|
|
64
|
-
* @property numberOfFreeResources - Number free allowed concurrent resource
|
|
65
|
-
* uses.
|
|
66
|
-
* @property numberOfResources - Number of allowed concurrent resource uses.
|
|
67
|
-
*/
|
|
68
|
-
export declare class Semaphore {
|
|
69
|
-
queue: Array<AnyFunction>;
|
|
70
|
-
numberOfResources: number;
|
|
71
|
-
numberOfFreeResources: number;
|
|
72
|
-
/**
|
|
73
|
-
* Initializes number of resources.
|
|
74
|
-
* @param numberOfResources - Number of resources to manage.
|
|
75
|
-
* @returns Nothing.
|
|
76
|
-
*/
|
|
77
|
-
constructor(numberOfResources?: number);
|
|
78
|
-
/**
|
|
79
|
-
* Acquires a new resource and runs given callback if available.
|
|
80
|
-
* @returns A promise which will be resolved if requested resource is
|
|
81
|
-
* available.
|
|
82
|
-
*/
|
|
83
|
-
acquire(): Promise<number>;
|
|
84
|
-
/**
|
|
85
|
-
* Releases a resource and runs a waiting resolver if there exists some.
|
|
86
|
-
* @returns Nothing.
|
|
87
|
-
*/
|
|
88
|
-
release(): void;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* This plugin provides such interface logic like generic controller logic for
|
|
92
|
-
* integrating plugins into $, mutual exclusion for depending gui elements,
|
|
93
|
-
* logging additional string, array or function handling. A set of helper
|
|
94
|
-
* functions to parse option objects dom trees or handle events is also
|
|
95
|
-
* provided.
|
|
96
|
-
* @property static:abbreviations - Lists all known abbreviation for proper
|
|
97
|
-
* camel case to delimited and back conversion.
|
|
98
|
-
* @property static:animationEndEventNames - Saves a string with all css3
|
|
99
|
-
* browser specific animation end event names.
|
|
100
|
-
* @property static:classToTypeMapping - String representation to object type
|
|
101
|
-
* name mapping.
|
|
102
|
-
* @property static:keyCode - Saves a mapping from key codes to their
|
|
103
|
-
* corresponding name.
|
|
104
|
-
* @property static:maximalSupportedInternetExplorerVersion - Saves currently
|
|
105
|
-
* maximal supported internet explorer version. Saves zero if no internet
|
|
106
|
-
* explorer present.
|
|
107
|
-
* @property static:name - Not minifyable class name.
|
|
108
|
-
* @property static:noop - A no-op dummy function.
|
|
109
|
-
* @property static:specialRegexSequences - A list of special regular
|
|
110
|
-
* expression symbols.
|
|
111
|
-
* @property static:transitionEndEventNames - Saves a string with all css3
|
|
112
|
-
* browser specific transition end event names.
|
|
113
|
-
*
|
|
114
|
-
* @property static:_dateTimePatternCache - Caches compiled date tine pattern
|
|
115
|
-
* regular expressions.
|
|
116
|
-
*
|
|
117
|
-
* @property static:_defaultOptions - Fallback options if not overwritten by
|
|
118
|
-
* the options given to the constructor method.
|
|
119
|
-
* @property static:_defaultOptions.logging {boolean} - Indicates whether
|
|
120
|
-
* logging should be active.
|
|
121
|
-
* @property static:_defaultOptions.domNodeSelectorInfix {string} - Selector
|
|
122
|
-
* infix for all needed dom nodes.
|
|
123
|
-
* @property static:_defaultOptions.domNodeSelectorPrefix {string} - Selector
|
|
124
|
-
* prefix for all needed dom nodes.
|
|
125
|
-
* @property static:_defaultOptions.domNodes {Object.<string, string>} -
|
|
126
|
-
* Mapping of names to needed dom nodes referenced by there selector.
|
|
127
|
-
* @property static:_defaultOptions.domNodes.hideJavaScriptEnabled {string} -
|
|
128
|
-
* Selector to dom nodes which should be hidden if javaScript is available.
|
|
129
|
-
* @property static:_defaultOptions.domNodes.showJavaScriptEnabled {string} -
|
|
130
|
-
* Selector to dom nodes which should be visible if javaScript is available.
|
|
131
|
-
*
|
|
132
|
-
* @property static:_javaScriptDependentContentHandled - Indicates whether
|
|
133
|
-
* javaScript dependent content where hide or shown.
|
|
134
|
-
*
|
|
135
|
-
* @property $domNode - $-extended dom node if one was given to the constructor
|
|
136
|
-
* method.
|
|
137
|
-
*
|
|
138
|
-
* @property options - Options given to the constructor.
|
|
139
|
-
*/
|
|
140
|
-
export declare class Tools<TElement = HTMLElement> {
|
|
141
|
-
static abbreviations: Array<string>;
|
|
142
|
-
static readonly animationEndEventNames = "animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";
|
|
143
|
-
static readonly classToTypeMapping: Mapping;
|
|
144
|
-
static readonly keyCode: Mapping<number>;
|
|
145
|
-
static locales: Array<string>;
|
|
146
|
-
static readonly maximalSupportedInternetExplorerVersion: number;
|
|
147
|
-
static noop: AnyFunction;
|
|
148
|
-
static plainObjectPrototypes: Array<FirstParameter<typeof Object.getPrototypeOf>>;
|
|
149
|
-
static readonly specialRegexSequences: Array<string>;
|
|
150
|
-
static readonly transitionEndEventNames = "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd";
|
|
151
|
-
static _dateTimePatternCache: Array<RegExp>;
|
|
152
|
-
static _defaultOptions: Partial<Options>;
|
|
153
|
-
static _javaScriptDependentContentHandled: boolean;
|
|
154
|
-
$domNode: null | $T<TElement>;
|
|
155
|
-
options: Options;
|
|
156
|
-
/**
|
|
157
|
-
* Triggered if current object is created via the "new" keyword. The dom
|
|
158
|
-
* node selector prefix enforces to not globally select any dom nodes which
|
|
159
|
-
* aren't in the expected scope of this plugin. "{1}" will be automatically
|
|
160
|
-
* replaced with this plugin name suffix ("tools"). You don't have to use
|
|
161
|
-
* "{1}" but it can help you to write code which is more reconcilable with
|
|
162
|
-
* the dry concept.
|
|
163
|
-
* @param $domNode - $-extended dom node to use as reference in various
|
|
164
|
-
* methods.
|
|
165
|
-
*
|
|
166
|
-
* @returns Nothing.
|
|
167
|
-
*/
|
|
168
|
-
constructor($domNode?: $T<TElement>);
|
|
169
|
-
/**
|
|
170
|
-
* This method could be overwritten normally. It acts like a destructor.
|
|
171
|
-
* @returns Returns the current instance.
|
|
172
|
-
*/
|
|
173
|
-
destructor(): this;
|
|
174
|
-
/**
|
|
175
|
-
* This method should be overwritten normally. It is triggered if current
|
|
176
|
-
* object was created via the "new" keyword and is called now.
|
|
177
|
-
* @param options - An options object.
|
|
178
|
-
*
|
|
179
|
-
* @returns Returns the current instance.
|
|
180
|
-
*/
|
|
181
|
-
initialize<R = this>(options?: RecursivePartial<Options>): R;
|
|
182
|
-
/**
|
|
183
|
-
* Defines a generic controller for dom node aware plugins.
|
|
184
|
-
* @param object - The object or class to control. If "object" is a class
|
|
185
|
-
* an instance will be generated.
|
|
186
|
-
* @param parameters - The initially given arguments object.
|
|
187
|
-
* @param $domNode - Optionally a $-extended dom node to use as reference.
|
|
188
|
-
*
|
|
189
|
-
* @returns Returns whatever the initializer method returns.
|
|
190
|
-
*/
|
|
191
|
-
static controller<TElement = HTMLElement>(this: void, object: unknown, parameters: unknown, $domNode?: null | $T<TElement>): unknown;
|
|
192
|
-
/**
|
|
193
|
-
* Formats given date or current via given format specification.
|
|
194
|
-
* @param format - Format specification.
|
|
195
|
-
* @param dateTime - Date time to format.
|
|
196
|
-
* @param options - Additional configuration options for
|
|
197
|
-
* "Intl.DateTimeFormat".
|
|
198
|
-
* @param locales - Locale or list of locales to use for formatting. First
|
|
199
|
-
* one take precedence of latter ones.
|
|
200
|
-
*
|
|
201
|
-
* @returns Formatted date time string.
|
|
202
|
-
*/
|
|
203
|
-
static dateTimeFormat(this: void, format?: string, dateTime?: Date | number | string, options?: SecondParameter<typeof Intl.DateTimeFormat>, locales?: Array<string> | string): string;
|
|
204
|
-
/**
|
|
205
|
-
* Determines whether its argument represents a JavaScript number.
|
|
206
|
-
* @param value - Value to analyze.
|
|
207
|
-
*
|
|
208
|
-
* @returns A boolean value indicating whether given object is numeric
|
|
209
|
-
* like.
|
|
210
|
-
*/
|
|
211
|
-
static isNumeric(this: void, value: unknown): value is number;
|
|
212
|
-
/**
|
|
213
|
-
* Determine whether the argument is a window.
|
|
214
|
-
* @param value - Value to check for.
|
|
215
|
-
*
|
|
216
|
-
* @returns Boolean value indicating the result.
|
|
217
|
-
*/
|
|
218
|
-
static isWindow(this: void, value: unknown): value is Window;
|
|
219
|
-
/**
|
|
220
|
-
* Checks if given object is similar to an array and can be handled like an
|
|
221
|
-
* array.
|
|
222
|
-
* @param object - Object to check behavior for.
|
|
223
|
-
*
|
|
224
|
-
* @returns A boolean value indicating whether given object is array like.
|
|
225
|
-
*/
|
|
226
|
-
static isArrayLike(this: void, object: unknown): boolean;
|
|
227
|
-
/**
|
|
228
|
-
* Checks whether one of the given pattern matches given string.
|
|
229
|
-
* @param target - Target to check in pattern for.
|
|
230
|
-
* @param pattern - List of pattern to check for.
|
|
231
|
-
*
|
|
232
|
-
* @returns Value "true" if given object is matches by at leas one of the
|
|
233
|
-
* given pattern and "false" otherwise.
|
|
234
|
-
*/
|
|
235
|
-
static isAnyMatching(this: void, target: string, pattern: Array<string | RegExp>): boolean;
|
|
236
|
-
/**
|
|
237
|
-
* Checks whether given object is a native object but not null.
|
|
238
|
-
* @param value - Value to check.
|
|
239
|
-
*
|
|
240
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
241
|
-
* "false" otherwise.
|
|
242
|
-
*/
|
|
243
|
-
static isObject(this: void, value: unknown): value is Mapping<unknown>;
|
|
244
|
-
/**
|
|
245
|
-
* Checks whether given object is a plain native object.
|
|
246
|
-
* @param value - Value to check.
|
|
247
|
-
*
|
|
248
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
249
|
-
* "false" otherwise.
|
|
250
|
-
*/
|
|
251
|
-
static isPlainObject(this: void, value: unknown): value is PlainObject;
|
|
252
|
-
/**
|
|
253
|
-
* Checks whether given object is a set.
|
|
254
|
-
* @param value - Value to check.
|
|
255
|
-
*
|
|
256
|
-
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
257
|
-
*/
|
|
258
|
-
static isSet(this: void, value: unknown): value is Set<unknown>;
|
|
259
|
-
/**
|
|
260
|
-
* Checks whether given object is a map.
|
|
261
|
-
* @param value - Value to check.
|
|
262
|
-
*
|
|
263
|
-
* @returns Value "true" if given object is a map and "false" otherwise.
|
|
264
|
-
*/
|
|
265
|
-
static isMap(this: void, value: unknown): value is Map<unknown, unknown>;
|
|
266
|
-
/**
|
|
267
|
-
* Checks whether given object is a proxy.
|
|
268
|
-
* @param value - Value to check.
|
|
269
|
-
*
|
|
270
|
-
* @returns Value "true" if given object is a proxy and "false" otherwise.
|
|
271
|
-
*/
|
|
272
|
-
static isProxy(this: void, value: unknown): value is ProxyType;
|
|
273
|
-
/**
|
|
274
|
-
* Checks whether given object is a function.
|
|
275
|
-
* @param value - Value to check.
|
|
276
|
-
*
|
|
277
|
-
* @returns Value "true" if given object is a function and "false"
|
|
278
|
-
* otherwise.
|
|
279
|
-
*/
|
|
280
|
-
static isFunction(this: void, value: unknown): value is AnyFunction;
|
|
281
|
-
/**
|
|
282
|
-
* Shows the given object's representation in the browsers console if
|
|
283
|
-
* possible or in a standalone alert-window as fallback.
|
|
284
|
-
* @param object - Any object to print.
|
|
285
|
-
* @param force - If set to "true" given input will be shown independently
|
|
286
|
-
* from current logging configuration or interpreter's console
|
|
287
|
-
* implementation.
|
|
288
|
-
* @param avoidAnnotation - If set to "true" given input has no module or
|
|
289
|
-
* log level specific annotations.
|
|
290
|
-
* @param level - Description of log messages importance.
|
|
291
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
292
|
-
* formatting.
|
|
293
|
-
*
|
|
294
|
-
* @returns Nothing.
|
|
295
|
-
*/
|
|
296
|
-
log(object: unknown, force?: boolean, avoidAnnotation?: boolean, level?: keyof Console, ...additionalArguments: Array<unknown>): void;
|
|
297
|
-
/**
|
|
298
|
-
* Wrapper method for the native console method usually provided by
|
|
299
|
-
* interpreter.
|
|
300
|
-
* @param object - Any object to print.
|
|
301
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
302
|
-
* formatting.
|
|
303
|
-
*
|
|
304
|
-
* @returns Nothing.
|
|
305
|
-
*/
|
|
306
|
-
info(object: unknown, ...additionalArguments: Array<unknown>): void;
|
|
307
|
-
/**
|
|
308
|
-
* Wrapper method for the native console method usually provided by
|
|
309
|
-
* interpreter.
|
|
310
|
-
* @param object - Any object to print.
|
|
311
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
312
|
-
* formatting.
|
|
313
|
-
*
|
|
314
|
-
* @returns Nothing.
|
|
315
|
-
*/
|
|
316
|
-
debug(object: unknown, ...additionalArguments: Array<unknown>): void;
|
|
317
|
-
/**
|
|
318
|
-
* Wrapper method for the native console method usually provided by
|
|
319
|
-
* interpreter.
|
|
320
|
-
* @param object - Any object to print.
|
|
321
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
322
|
-
* formatting.
|
|
323
|
-
*
|
|
324
|
-
* @returns Nothing.
|
|
325
|
-
*/
|
|
326
|
-
error(object: unknown, ...additionalArguments: Array<unknown>): void;
|
|
327
|
-
/**
|
|
328
|
-
* Wrapper method for the native console method usually provided by
|
|
329
|
-
* interpreter.
|
|
330
|
-
* @param object - Any object to print.
|
|
331
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
332
|
-
* formatting.
|
|
333
|
-
*
|
|
334
|
-
* @returns Nothing.
|
|
335
|
-
*/
|
|
336
|
-
critical(object: unknown, ...additionalArguments: Array<unknown>): void;
|
|
337
|
-
/**
|
|
338
|
-
* Wrapper method for the native console method usually provided by
|
|
339
|
-
* interpreter.
|
|
340
|
-
* @param object - Any object to print.
|
|
341
|
-
* @param additionalArguments - Additional arguments are used for string
|
|
342
|
-
* formatting.
|
|
343
|
-
*
|
|
344
|
-
* @returns Nothing.
|
|
345
|
-
*/
|
|
346
|
-
warn(object: unknown, ...additionalArguments: Array<unknown>): void;
|
|
347
|
-
/**
|
|
348
|
-
* Dumps a given object in a human readable format.
|
|
349
|
-
* @param object - Any object to show.
|
|
350
|
-
* @param level - Number of levels to dig into given object recursively.
|
|
351
|
-
* @param currentLevel - Maximal number of recursive function calls to
|
|
352
|
-
* represent given object.
|
|
353
|
-
*
|
|
354
|
-
* @returns Returns the serialized version of given object.
|
|
355
|
-
*/
|
|
356
|
-
static show(this: void, object: unknown, level?: number, currentLevel?: number): string;
|
|
357
|
-
/**
|
|
358
|
-
* Deletes a cookie value by given name.
|
|
359
|
-
* @param name - Name to identify requested value.
|
|
360
|
-
*
|
|
361
|
-
* @returns Nothing.
|
|
362
|
-
*/
|
|
363
|
-
static deleteCookie(this: void, name: string): void;
|
|
364
|
-
/**
|
|
365
|
-
* Gets a cookie value by given name.
|
|
366
|
-
* @param name - Name to identify requested value.
|
|
367
|
-
*
|
|
368
|
-
* @returns Requested value.
|
|
369
|
-
*/
|
|
370
|
-
static getCookie(this: void, name: string): string | null;
|
|
371
|
-
/**
|
|
372
|
-
* Sets a cookie key-value-pair.
|
|
373
|
-
* @param name - Name to identify given value.
|
|
374
|
-
* @param value - Value to set.
|
|
375
|
-
* @param givenOptions - Cookie set options.
|
|
376
|
-
* @param givenOptions.domain - Domain to reference with given
|
|
377
|
-
* key-value-pair.
|
|
378
|
-
* @param givenOptions.httpOnly - Indicates if this cookie should be
|
|
379
|
-
* accessible from client or not.
|
|
380
|
-
|
|
381
|
-
* @param givenOptions.minimal - Set only minimum number of options.
|
|
382
|
-
* @param givenOptions.numberOfDaysUntilExpiration - Number of days until
|
|
383
|
-
* given key shouldn't be deleted.
|
|
384
|
-
* @param givenOptions.path - Path to reference with given key-value-pair.
|
|
385
|
-
* @param givenOptions.sameSite - Set same site policy to "Lax", "None" or
|
|
386
|
-
* "Strict".
|
|
387
|
-
* @param givenOptions.secure - Indicates if this cookie is only valid for
|
|
388
|
-
* "https" connections.
|
|
389
|
-
*
|
|
390
|
-
* @returns A boolean indicating whether cookie could be set or not.
|
|
391
|
-
*/
|
|
392
|
-
static setCookie(this: void, name: string, value: string, givenOptions?: Partial<CookieOptions>): boolean;
|
|
393
|
-
/**
|
|
394
|
-
* Normalizes class name order of current dom node.
|
|
395
|
-
* @returns Current instance.
|
|
396
|
-
*/
|
|
397
|
-
get normalizedClassNames(): this;
|
|
398
|
-
/**
|
|
399
|
-
* Normalizes style attributes order of current dom node.
|
|
400
|
-
* @returns Returns current instance.
|
|
401
|
-
*/
|
|
402
|
-
get normalizedStyles(): this;
|
|
403
|
-
/**
|
|
404
|
-
* Retrieves a mapping of computed style attributes to their corresponding
|
|
405
|
-
* values.
|
|
406
|
-
* @returns The computed style mapping.
|
|
407
|
-
*/
|
|
408
|
-
get style(): Mapping<number | string>;
|
|
409
|
-
/**
|
|
410
|
-
* Get text content of current element without it children's text contents.
|
|
411
|
-
* @returns The text string.
|
|
412
|
-
*/
|
|
413
|
-
get text(): string;
|
|
414
|
-
/**
|
|
415
|
-
* Checks whether given html or text strings are equal.
|
|
416
|
-
* @param first - First html, selector to dom node or text to compare.
|
|
417
|
-
* @param second - Second html, selector to dom node or text to compare.
|
|
418
|
-
* @param forceHTMLString - Indicates whether given contents are
|
|
419
|
-
* interpreted as html string (otherwise an automatic detection will be
|
|
420
|
-
* triggered).
|
|
421
|
-
*
|
|
422
|
-
* @returns Returns true if both dom representations are equivalent.
|
|
423
|
-
*/
|
|
424
|
-
static isEquivalentDOM(this: void, first: Node | string | $T<HTMLElement> | $T<Node>, second: Node | string | $T<HTMLElement> | $T<Node>, forceHTMLString?: boolean): boolean;
|
|
425
|
-
/**
|
|
426
|
-
* Determines where current dom node is relative to current view port
|
|
427
|
-
* position.
|
|
428
|
-
* @param givenDelta - Allows deltas for "top", "left", "bottom" and
|
|
429
|
-
* "right" for determining positions.
|
|
430
|
-
* @param givenDelta.bottom - Bottom delta.
|
|
431
|
-
* @param givenDelta.left - Left delta.
|
|
432
|
-
* @param givenDelta.right - Right delta.
|
|
433
|
-
* @param givenDelta.top - Top delta.
|
|
434
|
-
*
|
|
435
|
-
* @returns Returns one of "above", "left", "below", "right" or "in".
|
|
436
|
-
*/
|
|
437
|
-
getPositionRelativeToViewport(givenDelta?: {
|
|
438
|
-
bottom?: number;
|
|
439
|
-
left?: number;
|
|
440
|
-
right?: number;
|
|
441
|
-
top?: number;
|
|
442
|
-
}): RelativePosition;
|
|
443
|
-
/**
|
|
444
|
-
* Generates a directive name corresponding selector string.
|
|
445
|
-
* @param directiveName - The directive name.
|
|
446
|
-
*
|
|
447
|
-
* @returns Returns generated selector.
|
|
448
|
-
*/
|
|
449
|
-
static generateDirectiveSelector(this: void, directiveName: string): string;
|
|
450
|
-
/**
|
|
451
|
-
* Removes a directive name corresponding class or attribute.
|
|
452
|
-
* @param directiveName - The directive name.
|
|
453
|
-
*
|
|
454
|
-
* @returns Returns current dom node.
|
|
455
|
-
*/
|
|
456
|
-
removeDirective(directiveName: string): null | $T<TElement>;
|
|
457
|
-
/**
|
|
458
|
-
* Hide or show all marked nodes which should be displayed depending on
|
|
459
|
-
* java script availability.
|
|
460
|
-
* @returns Nothing.
|
|
461
|
-
*/
|
|
462
|
-
renderJavaScriptDependentVisibility(): void;
|
|
463
|
-
/**
|
|
464
|
-
* Determines a normalized camel case directive name representation.
|
|
465
|
-
* @param directiveName - The directive name.
|
|
466
|
-
*
|
|
467
|
-
* @returns Returns the corresponding name.
|
|
468
|
-
*/
|
|
469
|
-
static getNormalizedDirectiveName(this: void, directiveName: string): string;
|
|
470
|
-
/**
|
|
471
|
-
* Determines a directive attribute value.
|
|
472
|
-
* @param directiveName - The directive name.
|
|
473
|
-
*
|
|
474
|
-
* @returns Returns the corresponding attribute value or "null" if no
|
|
475
|
-
* attribute value exists.
|
|
476
|
-
*/
|
|
477
|
-
getDirectiveValue(directiveName: string): null | string;
|
|
478
|
-
/**
|
|
479
|
-
* Removes a selector prefix from a given selector. This methods searches
|
|
480
|
-
* in the options object for a given "domNodeSelectorPrefix".
|
|
481
|
-
* @param domNodeSelector - The dom node selector to slice.
|
|
482
|
-
* @returns Returns the sliced selector.
|
|
483
|
-
*/
|
|
484
|
-
sliceDomNodeSelectorPrefix(domNodeSelector: string): string;
|
|
485
|
-
/**
|
|
486
|
-
* Determines the dom node name of a given dom node string.
|
|
487
|
-
* @param domNodeSelector - A given to dom node selector to determine its
|
|
488
|
-
* name.
|
|
489
|
-
*
|
|
490
|
-
* @returns Returns The dom node name.
|
|
491
|
-
* @example
|
|
492
|
-
* // returns 'div'
|
|
493
|
-
* $.Tools.getDomNodeName('<div>')
|
|
494
|
-
* @example
|
|
495
|
-
* // returns 'div'
|
|
496
|
-
* $.Tools.getDomNodeName('<div></div>')
|
|
497
|
-
* @example
|
|
498
|
-
* // returns 'br'
|
|
499
|
-
* $.Tools.getDomNodeName('<br/>')
|
|
500
|
-
*/
|
|
501
|
-
static getDomNodeName(this: void, domNodeSelector: string): null | string;
|
|
502
|
-
/**
|
|
503
|
-
* Converts an object of dom selectors to an array of $ wrapped dom nodes.
|
|
504
|
-
* Note if selector description as one of "class" or "id" as suffix element
|
|
505
|
-
* will be ignored.
|
|
506
|
-
* @param domNodeSelectors - An object with dom node selectors.
|
|
507
|
-
* @param wrapperDomNode - A dom node to be the parent or wrapper of all
|
|
508
|
-
* retrieved dom nodes.
|
|
509
|
-
*
|
|
510
|
-
* @returns Returns All $ wrapped dom nodes corresponding to given
|
|
511
|
-
* selectors.
|
|
512
|
-
*/
|
|
513
|
-
grabDomNodes(domNodeSelectors: Mapping, wrapperDomNode?: Node | null | string | $T<Node>): $DomNodes;
|
|
514
|
-
/**
|
|
515
|
-
* Overwrites all inherited variables from parent scope with "undefined".
|
|
516
|
-
* @param scope - A scope where inherited names will be removed.
|
|
517
|
-
* @param prefixesToIgnore - Name prefixes to ignore during deleting names
|
|
518
|
-
* in given scope.
|
|
519
|
-
*
|
|
520
|
-
* @returns The isolated scope.
|
|
521
|
-
*/
|
|
522
|
-
static isolateScope<T extends Mapping<unknown>>(this: void, scope: T, prefixesToIgnore?: Array<string>): T;
|
|
523
|
-
/**
|
|
524
|
-
* Generates a unique name in given scope (useful for jsonp requests).
|
|
525
|
-
* @param prefix - A prefix which will be prepended to unique name.
|
|
526
|
-
* @param suffix - A suffix which will be prepended to unique name.
|
|
527
|
-
* @param scope - A scope where the name should be unique.
|
|
528
|
-
* @param initialUniqueName - An initial scope name to use if not exists.
|
|
529
|
-
*
|
|
530
|
-
* @returns The function name.
|
|
531
|
-
*/
|
|
532
|
-
static determineUniqueScopeName(this: void, prefix?: string, suffix?: string, scope?: Mapping<unknown>, initialUniqueName?: string): string;
|
|
533
|
-
/**
|
|
534
|
-
* Determines all parameter names from given callable (function or class,
|
|
535
|
-
* ...).
|
|
536
|
-
* @param callable - Function or function code to inspect.
|
|
537
|
-
*
|
|
538
|
-
* @returns List of parameter names.
|
|
539
|
-
*/
|
|
540
|
-
static getParameterNames(this: void, callable: AnyFunction | string): Array<string>;
|
|
541
|
-
/**
|
|
542
|
-
* Implements the identity function.
|
|
543
|
-
* @param value - A value to return.
|
|
544
|
-
*
|
|
545
|
-
* @returns Returns the given value.
|
|
546
|
-
*/
|
|
547
|
-
static identity<T>(this: void, value: T): T;
|
|
548
|
-
/**
|
|
549
|
-
* Inverted filter helper to inverse each given filter.
|
|
550
|
-
* @param filter - A function that filters an array.
|
|
551
|
-
*
|
|
552
|
-
* @returns The inverted filter.
|
|
553
|
-
*/
|
|
554
|
-
static invertArrayFilter<T>(this: void, filter: T): T;
|
|
555
|
-
/**
|
|
556
|
-
* Triggers given callback after given duration. Supports unlimited
|
|
557
|
-
* duration length and returns a promise which will be resolved after given
|
|
558
|
-
* duration has been passed.
|
|
559
|
-
* @param parameters - Observes the first three existing parameters. If one
|
|
560
|
-
* is a number it will be interpret as delay in milliseconds until given
|
|
561
|
-
* callback will be triggered. If one is of type function it will be used
|
|
562
|
-
* as callback and if one is of type boolean it will indicate if returning
|
|
563
|
-
* promise should be rejected or resolved if given internally created
|
|
564
|
-
* timeout should be canceled. Additional parameters will be forwarded to
|
|
565
|
-
* given callback.
|
|
566
|
-
*
|
|
567
|
-
* @returns A promise resolving after given delay or being rejected if
|
|
568
|
-
* value "true" is within one of the first three parameters. The promise
|
|
569
|
-
* holds a boolean indicating whether timeout has been canceled or
|
|
570
|
-
* resolved.
|
|
571
|
-
*/
|
|
572
|
-
static timeout(this: void, ...parameters: Array<unknown>): TimeoutPromise;
|
|
573
|
-
/**
|
|
574
|
-
* Prevents event functions from triggering to often by defining a minimal
|
|
575
|
-
* span between each function call. Additional arguments given to this
|
|
576
|
-
* function will be forwarded to given event function call.
|
|
577
|
-
* @param callback - The function to call debounced.
|
|
578
|
-
* @param thresholdInMilliseconds - The minimum time span between each
|
|
579
|
-
* function call.
|
|
580
|
-
* @param additionalArguments - Additional arguments to forward to given
|
|
581
|
-
* function.
|
|
582
|
-
*
|
|
583
|
-
* @returns Returns the wrapped method.
|
|
584
|
-
*/
|
|
585
|
-
static debounce<T = unknown>(this: void, callback: UnknownFunction, thresholdInMilliseconds?: number, ...additionalArguments: Array<unknown>): ((...parameters: Array<unknown>) => Promise<T>);
|
|
586
|
-
/**
|
|
587
|
-
* Searches for internal event handler methods and runs them by default. In
|
|
588
|
-
* addition this method searches for a given event method by the options
|
|
589
|
-
* object. Additional arguments are forwarded to respective event
|
|
590
|
-
* functions.
|
|
591
|
-
* @param eventName - An event name.
|
|
592
|
-
* @param callOnlyOptionsMethod - Prevents from trying to call an internal
|
|
593
|
-
* event handler.
|
|
594
|
-
* @param scope - The scope from where the given event handler should be
|
|
595
|
-
* called.
|
|
596
|
-
* @param additionalArguments - Additional arguments to forward to
|
|
597
|
-
* corresponding event handlers.
|
|
598
|
-
*
|
|
599
|
-
* @returns - Returns result of an options event handler (when called) and
|
|
600
|
-
* "true" otherwise.
|
|
601
|
-
*/
|
|
602
|
-
fireEvent(eventName: string, callOnlyOptionsMethod?: boolean, scope?: unknown, ...additionalArguments: Array<unknown>): unknown;
|
|
603
|
-
/**
|
|
604
|
-
* A wrapper method for "$.on()". It sets current plugin name as event
|
|
605
|
-
* scope if no scope is given. Given arguments are modified and passed
|
|
606
|
-
* through "$.on()".
|
|
607
|
-
* @param parameters - Parameter to forward.
|
|
608
|
-
*
|
|
609
|
-
* @returns Returns $'s grabbed dom node.
|
|
610
|
-
*/
|
|
611
|
-
on<TElement = HTMLElement>(...parameters: Array<unknown>): $T<TElement>;
|
|
612
|
-
/**
|
|
613
|
-
* A wrapper method fo "$.off()". It sets current plugin name as event
|
|
614
|
-
* scope if no scope is given. Given arguments are modified and passed
|
|
615
|
-
* through "$.off()".
|
|
616
|
-
* @param parameters - Parameter to forward.
|
|
617
|
-
*
|
|
618
|
-
* @returns Returns $'s grabbed dom node.
|
|
619
|
-
*/
|
|
620
|
-
off<TElement = HTMLElement>(...parameters: Array<unknown>): $T<TElement>;
|
|
621
|
-
/**
|
|
622
|
-
* Adds dynamic getter and setter to any given data structure such as maps.
|
|
623
|
-
* @param object - Object to proxy.
|
|
624
|
-
* @param getterWrapper - Function to wrap each property get.
|
|
625
|
-
* @param setterWrapper - Function to wrap each property set.
|
|
626
|
-
* @param methodNames - Method names to perform actions on the given
|
|
627
|
-
* object.
|
|
628
|
-
* @param deep - Indicates to perform a deep wrapping of specified types.
|
|
629
|
-
* @param typesToExtend - Types which should be extended (Checks are
|
|
630
|
-
* performed via "value instanceof type".).
|
|
631
|
-
*
|
|
632
|
-
* @returns Returns given object wrapped with a dynamic getter proxy.
|
|
633
|
-
*/
|
|
634
|
-
static addDynamicGetterAndSetter<T = unknown>(this: void, object: T, getterWrapper?: GetterFunction | null, setterWrapper?: null | SetterFunction, methodNames?: Mapping, deep?: boolean, typesToExtend?: Array<unknown>): ProxyType<T> | T;
|
|
635
|
-
/**
|
|
636
|
-
* Converts given object into its serialized json representation by
|
|
637
|
-
* replacing circular references with a given provided value.
|
|
638
|
-
*
|
|
639
|
-
* This method traverses given object recursively and tracks of seen and
|
|
640
|
-
* already serialized structures to reuse generated strings or mark a
|
|
641
|
-
* circular reference.
|
|
642
|
-
* @param object - Object to serialize.
|
|
643
|
-
* @param determineCircularReferenceValue - Callback to create a fallback
|
|
644
|
-
* value depending on given redundant value.
|
|
645
|
-
* @param numberOfSpaces - Number of spaces to use for string formatting.
|
|
646
|
-
*
|
|
647
|
-
* @returns The formatted json string.
|
|
648
|
-
*/
|
|
649
|
-
static convertCircularObjectToJSON(this: void, object: unknown, determineCircularReferenceValue?: ((serializedValue: unknown, key: null | string, value: unknown, seenObjects: Map<unknown, unknown>) => unknown), numberOfSpaces?: number): ReturnType<typeof JSON.stringify> | undefined;
|
|
650
|
-
/**
|
|
651
|
-
* Converts given map and all nested found maps objects to corresponding
|
|
652
|
-
* object.
|
|
653
|
-
* @param object - Map to convert to.
|
|
654
|
-
* @param deep - Indicates whether to perform a recursive conversion.
|
|
655
|
-
*
|
|
656
|
-
* @returns Given map as object.
|
|
657
|
-
*/
|
|
658
|
-
static convertMapToPlainObject(this: void, object: unknown, deep?: boolean): unknown;
|
|
659
|
-
/**
|
|
660
|
-
* Converts given plain object and all nested found objects to
|
|
661
|
-
* corresponding map.
|
|
662
|
-
* @param object - Object to convert to.
|
|
663
|
-
* @param deep - Indicates whether to perform a recursive conversion.
|
|
664
|
-
*
|
|
665
|
-
* @returns Given object as map.
|
|
666
|
-
*/
|
|
667
|
-
static convertPlainObjectToMap(this: void, object: unknown, deep?: boolean): unknown;
|
|
668
|
-
/**
|
|
669
|
-
* Replaces given pattern in each value in given object recursively with
|
|
670
|
-
* given string replacement.
|
|
671
|
-
* @param object - Object to convert substrings in.
|
|
672
|
-
* @param pattern - Regular expression to replace.
|
|
673
|
-
* @param replacement - String to use as replacement for found patterns.
|
|
674
|
-
*
|
|
675
|
-
* @returns Converted object with replaced patterns.
|
|
676
|
-
*/
|
|
677
|
-
static convertSubstringInPlainObject<Type extends Mapping<unknown> = PlainObject>(this: void, object: Type, pattern: RegExp | string, replacement: string): Type;
|
|
678
|
-
/**
|
|
679
|
-
* Copies given object (of any type) into optionally given destination.
|
|
680
|
-
* @param source - Object to copy.
|
|
681
|
-
* @param recursionLimit - Specifies how deep we should traverse into given
|
|
682
|
-
* object recursively.
|
|
683
|
-
* @param recursionEndValue - Indicates which value to use for recursion
|
|
684
|
-
* ends. Usually a reference to corresponding source value will be used.
|
|
685
|
-
* @param destination - Target to copy source to.
|
|
686
|
-
* @param cyclic - Indicates whether known sub structures should be copied
|
|
687
|
-
* or referenced (if "true" endless loops can occur if source has cyclic
|
|
688
|
-
* structures).
|
|
689
|
-
* @param knownReferences - Used to avoid traversing loops and not to copy
|
|
690
|
-
* references e.g. to objects not to copy (e.g. symbol polyfills).
|
|
691
|
-
* @param recursionLevel - Internally used to track current recursion
|
|
692
|
-
* level in given source data structure.
|
|
693
|
-
*
|
|
694
|
-
* @returns Value "true" if both objects are equal and "false" otherwise.
|
|
695
|
-
*/
|
|
696
|
-
static copy<Type = unknown>(this: void, source: Type, recursionLimit?: number, recursionEndValue?: unknown, destination?: null | Type, cyclic?: boolean, knownReferences?: Array<unknown>, recursionLevel?: number): Type;
|
|
697
|
-
/**
|
|
698
|
-
* Determine the internal JavaScript [[Class]] of an object.
|
|
699
|
-
* @param value - Value to analyze.
|
|
700
|
-
*
|
|
701
|
-
* @returns Name of determined type.
|
|
702
|
-
*/
|
|
703
|
-
static determineType(this: void, value?: unknown): string;
|
|
704
|
-
/**
|
|
705
|
-
* Returns true if given items are equal for given property list. If
|
|
706
|
-
* property list isn't set all properties will be checked. All keys which
|
|
707
|
-
* starts with one of the exception prefixes will be omitted.
|
|
708
|
-
* @param firstValue - First object to compare.
|
|
709
|
-
* @param secondValue - Second object to compare.
|
|
710
|
-
*
|
|
711
|
-
* @param givenOptions - Options to define how to compare.
|
|
712
|
-
* @param givenOptions.properties - Property names to check. Check all if
|
|
713
|
-
* "null" is selected (default).
|
|
714
|
-
* @param givenOptions.deep - Recursion depth negative values means
|
|
715
|
-
* infinitely deep (default).
|
|
716
|
-
* @param givenOptions.exceptionPrefixes - Property prefixes which
|
|
717
|
-
* indicates properties to ignore.
|
|
718
|
-
* @param givenOptions.ignoreFunctions - Indicates whether functions have
|
|
719
|
-
* to be identical to interpret is as equal. If set to "true" two functions
|
|
720
|
-
* will be assumed to be equal (default).
|
|
721
|
-
* @param givenOptions.compareBlobs - Indicates whether binary data should
|
|
722
|
-
* be converted to a base64 string to compare their content. Makes this
|
|
723
|
-
* function asynchronous in browsers and potentially takes a lot of
|
|
724
|
-
* resources.
|
|
725
|
-
*
|
|
726
|
-
* @returns Value "true" if both objects are equal and "false" otherwise.
|
|
727
|
-
* If "compareBlobs" is activated and we're running in a browser like
|
|
728
|
-
* environment and binary data is given, then a promise wrapping the
|
|
729
|
-
* determined boolean values is returned.
|
|
730
|
-
*/
|
|
731
|
-
static equals(this: void, firstValue: unknown, secondValue: unknown, givenOptions?: Partial<CompareOptions>): boolean | Promise<boolean | string> | string;
|
|
732
|
-
/**
|
|
733
|
-
* Searches for nested mappings with given indicator key and resolves
|
|
734
|
-
* marked values. Additionally all objects are wrapped with a proxy to
|
|
735
|
-
* dynamically resolve nested properties.
|
|
736
|
-
* @param object - Given mapping to resolve.
|
|
737
|
-
* @param scope - Scope to to use evaluate again.
|
|
738
|
-
* @param selfReferenceName - Name to use for reference to given object.
|
|
739
|
-
* @param expressionIndicatorKey - Indicator property name to mark a value
|
|
740
|
-
* to evaluate.
|
|
741
|
-
* @param executionIndicatorKey - Indicator property name to mark a value
|
|
742
|
-
* to evaluate.
|
|
743
|
-
*
|
|
744
|
-
* @returns Evaluated given mapping.
|
|
745
|
-
*/
|
|
746
|
-
static evaluateDynamicData<Type = unknown>(this: void, object: null | RecursiveEvaluateable<Type>, scope?: Mapping<unknown>, selfReferenceName?: string, expressionIndicatorKey?: string, executionIndicatorKey?: string): Type;
|
|
747
|
-
/**
|
|
748
|
-
* Removes properties in objects where a dynamic indicator lives.
|
|
749
|
-
* @param data - Object to traverse recursively.
|
|
750
|
-
* @param expressionIndicators - Property key to remove.
|
|
751
|
-
*
|
|
752
|
-
* @returns Given object with removed properties.
|
|
753
|
-
*/
|
|
754
|
-
static removeKeysInEvaluation<T extends Mapping<unknown> = Mapping<unknown>>(this: void, data: T, expressionIndicators?: Array<string>): T;
|
|
755
|
-
/**
|
|
756
|
-
* Extends given target object with given sources object. As target and
|
|
757
|
-
* sources many expandable types are allowed but target and sources have to
|
|
758
|
-
* to come from the same type.
|
|
759
|
-
* @param targetOrDeepIndicator - Maybe the target or deep indicator.
|
|
760
|
-
* @param targetOrSource - Target or source object; depending on first
|
|
761
|
-
* argument.
|
|
762
|
-
* @param additionalSources - Source objects to extend into target.
|
|
763
|
-
*
|
|
764
|
-
* @returns Returns given target extended with all given sources.
|
|
765
|
-
*/
|
|
766
|
-
static extend<T = Mapping<unknown>>(this: void, targetOrDeepIndicator: (boolean | typeof IgnoreNullAndUndefinedSymbol | RecursivePartial<T>), targetOrSource?: RecursivePartial<T>, ...additionalSources: Array<RecursivePartial<T>>): T;
|
|
767
|
-
/**
|
|
768
|
-
* Retrieves substructure in given object referenced by given selector
|
|
769
|
-
* path.
|
|
770
|
-
* @param target - Object to search in.
|
|
771
|
-
* @param selector - Selector path.
|
|
772
|
-
* @param skipMissingLevel - Indicates to skip missing level in given path.
|
|
773
|
-
* @param delimiter - Delimiter to delimit given selector components.
|
|
774
|
-
*
|
|
775
|
-
* @returns Determined sub structure of given data or "undefined".
|
|
776
|
-
*/
|
|
777
|
-
static getSubstructure<T = unknown, E = unknown>(this: void, target: T, selector: Selector<T, E>, skipMissingLevel?: boolean, delimiter?: string): E;
|
|
778
|
-
/**
|
|
779
|
-
* Generates a proxy handler which forwards all operations to given object
|
|
780
|
-
* as there wouldn't be a proxy.
|
|
781
|
-
* @param target - Object to proxy.
|
|
782
|
-
* @param methodNames - Mapping of operand name to object specific method
|
|
783
|
-
* name.
|
|
784
|
-
*
|
|
785
|
-
* @returns Determined proxy handler.
|
|
786
|
-
*/
|
|
787
|
-
static getProxyHandler<T = unknown>(this: void, target: T, methodNames?: Mapping): ProxyHandler<T>;
|
|
788
|
-
/**
|
|
789
|
-
* Slices all properties from given object which does not match provided
|
|
790
|
-
* object mask. Items can be explicitly white listed via "include" mask
|
|
791
|
-
* configuration or black listed via "exclude" mask configuration.
|
|
792
|
-
* @param object - Object to slice.
|
|
793
|
-
* @param mask - Mask configuration.
|
|
794
|
-
*
|
|
795
|
-
* @returns Given but sliced object. If (nested) object will be modified a
|
|
796
|
-
* flat copy of that object will be returned.
|
|
797
|
-
*/
|
|
798
|
-
static mask<Type extends Mapping<unknown> = Mapping<unknown>>(this: void, object: Type, mask: ObjectMaskConfiguration): RecursivePartial<Type>;
|
|
799
|
-
/**
|
|
800
|
-
* Modifies given target corresponding to given source and removes source
|
|
801
|
-
* modification infos.
|
|
802
|
-
* @param target - Object to modify.
|
|
803
|
-
* @param source - Source object to load modifications from.
|
|
804
|
-
* @param removeIndicatorKey - Indicator property name or value to mark a
|
|
805
|
-
* value to remove from object or list.
|
|
806
|
-
* @param prependIndicatorKey - Indicator property name to mark a value to
|
|
807
|
-
* prepend to target list.
|
|
808
|
-
* @param appendIndicatorKey - Indicator property name to mark a value to
|
|
809
|
-
* append to target list.
|
|
810
|
-
* @param positionPrefix - Indicates a prefix to use a value on given
|
|
811
|
-
* position to add or remove.
|
|
812
|
-
* @param positionSuffix - Indicates a suffix to use a value on given
|
|
813
|
-
* position to add or remove.
|
|
814
|
-
* @param parentSource - Source context to remove modification info from
|
|
815
|
-
* (usually only needed internally).
|
|
816
|
-
* @param parentKey - Source key in given source context to remove
|
|
817
|
-
* modification info from (usually only needed internally).
|
|
818
|
-
*
|
|
819
|
-
* @returns Given target modified with given source.
|
|
820
|
-
*/
|
|
821
|
-
static modifyObject<T = unknown>(this: void, target: T, source: unknown, removeIndicatorKey?: string, prependIndicatorKey?: string, appendIndicatorKey?: string, positionPrefix?: string, positionSuffix?: string, parentSource?: unknown, parentKey?: unknown): T | null;
|
|
822
|
-
/**
|
|
823
|
-
* Interprets a date object from given artefact.
|
|
824
|
-
* @param value - To interpret.
|
|
825
|
-
* @param interpretAsUTC - Identifies if given date should be interpret as
|
|
826
|
-
* utc. If not set given strings will be interpret as it is depending on
|
|
827
|
-
* given format and numbers as utc.
|
|
828
|
-
*
|
|
829
|
-
* @returns Interpreted date object or "null" if given value couldn't be
|
|
830
|
-
* interpret.
|
|
831
|
-
*/
|
|
832
|
-
static normalizeDateTime(this: void, value?: string | null | number | Date, interpretAsUTC?: null | boolean): Date | null;
|
|
833
|
-
/**
|
|
834
|
-
* Removes given key from given object recursively.
|
|
835
|
-
* @param object - Object to process.
|
|
836
|
-
* @param keys - List of keys to remove.
|
|
837
|
-
*
|
|
838
|
-
* @returns Processed given object.
|
|
839
|
-
*/
|
|
840
|
-
static removeKeyPrefixes<T>(this: void, object: T, keys?: Array<string> | string): T;
|
|
841
|
-
/**
|
|
842
|
-
* Represents given object as formatted string.
|
|
843
|
-
* @param object - Object to represent.
|
|
844
|
-
* @param indention - String (usually whitespaces) to use as indention.
|
|
845
|
-
* @param initialIndention - String (usually whitespaces) to use as
|
|
846
|
-
* additional indention for the first object traversing level.
|
|
847
|
-
* @param maximumNumberOfLevelsReachedIdentifier - Replacement for objects
|
|
848
|
-
* which are out of specified bounds to traverse.
|
|
849
|
-
* @param numberOfLevels - Specifies number of levels to traverse given
|
|
850
|
-
* data structure.
|
|
851
|
-
*
|
|
852
|
-
* @returns Representation string.
|
|
853
|
-
*/
|
|
854
|
-
static represent(this: void, object: unknown, indention?: string, initialIndention?: string, maximumNumberOfLevelsReachedIdentifier?: number | string, numberOfLevels?: number): string;
|
|
855
|
-
/**
|
|
856
|
-
* Sort given objects keys.
|
|
857
|
-
* @param object - Object which keys should be sorted.
|
|
858
|
-
*
|
|
859
|
-
* @returns Sorted list of given keys.
|
|
860
|
-
*/
|
|
861
|
-
static sort(this: void, object: unknown): Array<unknown>;
|
|
862
|
-
/**
|
|
863
|
-
* Removes a proxy from given data structure recursively.
|
|
864
|
-
* @param object - Object to proxy.
|
|
865
|
-
* @param seenObjects - Tracks all already processed objects to avoid
|
|
866
|
-
* endless loops (usually only needed for internal purpose).
|
|
867
|
-
*
|
|
868
|
-
* @returns Returns given object unwrapped from a dynamic proxy.
|
|
869
|
-
*/
|
|
870
|
-
static unwrapProxy<T = unknown>(this: void, object: ProxyType<T> | T, seenObjects?: Set<unknown>): T;
|
|
871
|
-
/**
|
|
872
|
-
* Summarizes given property of given item list.
|
|
873
|
-
* @param data - Array of objects with given property name.
|
|
874
|
-
* @param propertyName - Property name to summarize.
|
|
875
|
-
* @param defaultValue - Value to return if property values doesn't match.
|
|
876
|
-
*
|
|
877
|
-
* @returns Aggregated value.
|
|
878
|
-
*/
|
|
879
|
-
static arrayAggregatePropertyIfEqual<T = unknown>(this: void, data: Array<Mapping<unknown>>, propertyName: string, defaultValue?: T): T;
|
|
880
|
-
/**
|
|
881
|
-
* Deletes every item witch has only empty attributes for given property
|
|
882
|
-
* names. If given property names are empty each attribute will be
|
|
883
|
-
* considered. The empty string, "null" and "undefined" will be interpreted
|
|
884
|
-
* as empty.
|
|
885
|
-
* @param data - Data to filter.
|
|
886
|
-
* @param propertyNames - Properties to consider.
|
|
887
|
-
*
|
|
888
|
-
* @returns Given data without empty items.
|
|
889
|
-
*/
|
|
890
|
-
static arrayDeleteEmptyItems<T extends Mapping<unknown> = Mapping<unknown>>(this: void, data: Array<T>, propertyNames?: Array<string | symbol>): Array<T>;
|
|
891
|
-
/**
|
|
892
|
-
* Extracts all properties from all items wich occur in given property
|
|
893
|
-
* names.
|
|
894
|
-
* @param data - Data where each item should be sliced.
|
|
895
|
-
* @param propertyNames - Property names to extract.
|
|
896
|
-
*
|
|
897
|
-
* @returns Data with sliced items.
|
|
898
|
-
*/
|
|
899
|
-
static arrayExtract<T = Mapping<unknown>>(this: void, data: unknown, propertyNames: Array<string>): Array<T>;
|
|
900
|
-
/**
|
|
901
|
-
* Extracts all values which matches given regular expression.
|
|
902
|
-
* @param data - Data to filter.
|
|
903
|
-
* @param regularExpression - Pattern to match for.
|
|
904
|
-
*
|
|
905
|
-
* @returns Filtered data.
|
|
906
|
-
*/
|
|
907
|
-
static arrayExtractIfMatches(this: void, data: unknown, regularExpression: string | RegExp): Array<string>;
|
|
908
|
-
/**
|
|
909
|
-
* Filters given data if given property is set or not.
|
|
910
|
-
* @param data - Data to filter.
|
|
911
|
-
* @param propertyName - Property name to check for existence.
|
|
912
|
-
*
|
|
913
|
-
* @returns Given data without the items which doesn't have specified
|
|
914
|
-
* property.
|
|
915
|
-
*/
|
|
916
|
-
static arrayExtractIfPropertyExists<T extends Mapping<unknown> = Mapping<unknown>>(this: void, data: unknown, propertyName: string): Array<T>;
|
|
917
|
-
/**
|
|
918
|
-
* Extract given data where specified property value matches given
|
|
919
|
-
* patterns.
|
|
920
|
-
* @param data - Data to filter.
|
|
921
|
-
* @param propertyPattern - Mapping of property names to pattern.
|
|
922
|
-
*
|
|
923
|
-
* @returns Filtered data.
|
|
924
|
-
*/
|
|
925
|
-
static arrayExtractIfPropertyMatches<T = unknown>(this: void, data: unknown, propertyPattern: Mapping<RegExp | string>): Array<T>;
|
|
926
|
-
/**
|
|
927
|
-
* Determines all objects which exists in "first" and in "second".
|
|
928
|
-
* Object key which will be compared are given by "keys". If an empty array
|
|
929
|
-
* is given each key will be compared. If an object is given corresponding
|
|
930
|
-
* initial data key will be mapped to referenced new data key.
|
|
931
|
-
* @param first - Referenced data to check for.
|
|
932
|
-
* @param second - Data to check for existence.
|
|
933
|
-
* @param keys - Keys to define equality.
|
|
934
|
-
* @param strict - The strict parameter indicates whether "null" and
|
|
935
|
-
* "undefined" should be interpreted as equal (takes only effect if given
|
|
936
|
-
* keys aren't empty).
|
|
937
|
-
*
|
|
938
|
-
* @returns Data which does exit in given initial data.
|
|
939
|
-
*/
|
|
940
|
-
static arrayIntersect<T = unknown>(this: void, first: unknown, second: unknown, keys?: Array<string> | Mapping<number | string>, strict?: boolean): Array<T>;
|
|
941
|
-
/**
|
|
942
|
-
* Converts given object into an array.
|
|
943
|
-
* @param object - Target to convert.
|
|
944
|
-
*
|
|
945
|
-
* @returns Generated array.
|
|
946
|
-
*/
|
|
947
|
-
static arrayMake<T = unknown>(this: void, object: unknown): Array<T>;
|
|
948
|
-
/**
|
|
949
|
-
* Creates a list of items within given range.
|
|
950
|
-
* @param range - Array of lower and upper bounds. If only one value is
|
|
951
|
-
* given lower bound will be assumed to be zero. Both integers have to be
|
|
952
|
-
* positive and will be contained in the resulting array. If more than two
|
|
953
|
-
* numbers are provided given range will be returned.
|
|
954
|
-
* @param step - Space between two consecutive values.
|
|
955
|
-
* @param ignoreLastStep - Removes last step.
|
|
956
|
-
*
|
|
957
|
-
* @returns Produced array of integers.
|
|
958
|
-
*/
|
|
959
|
-
static arrayMakeRange(this: void, range: number | [number] | [number, number] | Array<number>, step?: number, ignoreLastStep?: boolean): Array<number>;
|
|
960
|
-
/**
|
|
961
|
-
* Merge the contents of two arrays together into the first array.
|
|
962
|
-
* @param target - Target array.
|
|
963
|
-
* @param source - Source array.
|
|
964
|
-
*
|
|
965
|
-
* @returns Target array with merged given source one.
|
|
966
|
-
*/
|
|
967
|
-
static arrayMerge<T = unknown>(this: void, target: Array<T>, source: Array<T>): Array<T>;
|
|
968
|
-
/**
|
|
969
|
-
* Generates a list if pagination symbols to render a pagination from.
|
|
970
|
-
* @param options - Configure bounds and current page of pagination to
|
|
971
|
-
* determine.
|
|
972
|
-
* @param options.boundaryCount - Indicates where to start pagination
|
|
973
|
-
* within given total range.
|
|
974
|
-
* @param options.disabled - Indicates whether to disable all items.
|
|
975
|
-
* @param options.hideNextButton - Indicates whether to show a jump to next
|
|
976
|
-
* item.
|
|
977
|
-
* @param options.hidePrevButton - Indicates whether to show a jump to
|
|
978
|
-
* previous item.
|
|
979
|
-
* @param options.page - Indicates current visible page.
|
|
980
|
-
* @param options.pageSize - Number of items per page.
|
|
981
|
-
* @param options.showFirstButton - Indicates whether to show a jump to
|
|
982
|
-
* first item.
|
|
983
|
-
* @param options.showLastButton - Indicates whether to show a jump to last
|
|
984
|
-
* item.
|
|
985
|
-
* @param options.siblingCount - Number of sibling page symbols next to
|
|
986
|
-
* current page symbol.
|
|
987
|
-
* @param options.total - Number of all items to paginate.
|
|
988
|
-
*
|
|
989
|
-
* @returns A list of pagination symbols.
|
|
990
|
-
*/
|
|
991
|
-
static arrayPaginate(this: void, options?: Partial<PaginateOptions>): Array<Page>;
|
|
992
|
-
/**
|
|
993
|
-
* Generates all permutations of given iterable.
|
|
994
|
-
* @param data - Array like object.
|
|
995
|
-
*
|
|
996
|
-
* @returns Array of permuted arrays.
|
|
997
|
-
*/
|
|
998
|
-
static arrayPermutate<T = unknown>(this: void, data: Array<T>): Array<Array<T>>;
|
|
999
|
-
/**
|
|
1000
|
-
* Generates all lengths permutations of given iterable.
|
|
1001
|
-
* @param data - Array like object.
|
|
1002
|
-
* @param minimalSubsetLength - Defines how long the minimal subset length
|
|
1003
|
-
* should be.
|
|
1004
|
-
*
|
|
1005
|
-
* @returns Array of permuted arrays.
|
|
1006
|
-
*/
|
|
1007
|
-
static arrayPermutateLength<T = unknown>(this: void, data: Array<T>, minimalSubsetLength?: number): Array<Array<T>>;
|
|
1008
|
-
/**
|
|
1009
|
-
* Sums up given property of given item list.
|
|
1010
|
-
* @param data - The objects with specified property to sum up.
|
|
1011
|
-
* @param propertyName - Property name to sum up its value.
|
|
1012
|
-
*
|
|
1013
|
-
* @returns The aggregated value.
|
|
1014
|
-
*/
|
|
1015
|
-
static arraySumUpProperty(this: void, data: unknown, propertyName: string): number;
|
|
1016
|
-
/**
|
|
1017
|
-
* Adds an item to another item as array connection (many to one).
|
|
1018
|
-
* @param item - Item where the item should be appended to.
|
|
1019
|
-
* @param target - Target to add to given item.
|
|
1020
|
-
* @param name - Name of the target connection.
|
|
1021
|
-
* @param checkIfExists - Indicates if duplicates are allowed in resulting
|
|
1022
|
-
* list (will result in linear runtime instead of constant one).
|
|
1023
|
-
*
|
|
1024
|
-
* @returns Item with the appended target.
|
|
1025
|
-
*/
|
|
1026
|
-
static arrayAppendAdd<T = unknown>(this: void, item: Mapping<T>, target: unknown, name: string, checkIfExists?: boolean): Mapping<T>;
|
|
1027
|
-
/**
|
|
1028
|
-
* Removes given target on given list.
|
|
1029
|
-
* @param list - Array to splice.
|
|
1030
|
-
* @param target - Target to remove from given list.
|
|
1031
|
-
* @param strict - Indicates whether to fire an exception if given target
|
|
1032
|
-
* doesn't exists given list.
|
|
1033
|
-
*
|
|
1034
|
-
* @returns Item with the appended target.
|
|
1035
|
-
*/
|
|
1036
|
-
static arrayRemove<T = unknown>(this: void, list: Array<T>, target: T, strict?: boolean): Array<T>;
|
|
1037
|
-
/**
|
|
1038
|
-
* Sorts given object of dependencies in a topological order.
|
|
1039
|
-
* @param items - Items to sort.
|
|
1040
|
-
*
|
|
1041
|
-
* @returns Sorted array of given items respecting their dependencies.
|
|
1042
|
-
*/
|
|
1043
|
-
static arraySortTopological(this: void, items: Mapping<Array<string> | string>): Array<string>;
|
|
1044
|
-
/**
|
|
1045
|
-
* Makes all values in given iterable unique by removing duplicates (The
|
|
1046
|
-
* first occurrences will be left).
|
|
1047
|
-
* @param data - Array like object.
|
|
1048
|
-
*
|
|
1049
|
-
* @returns Sliced version of given object.
|
|
1050
|
-
*/
|
|
1051
|
-
static arrayUnique<T = unknown>(this: void, data: Array<T>): Array<T>;
|
|
1052
|
-
/**
|
|
1053
|
-
* Translates given string into the regular expression validated
|
|
1054
|
-
* representation.
|
|
1055
|
-
* @param value - String to convert.
|
|
1056
|
-
* @param excludeSymbols - Symbols not to escape.
|
|
1057
|
-
*
|
|
1058
|
-
* @returns Converted string.
|
|
1059
|
-
*/
|
|
1060
|
-
static stringEscapeRegularExpressions(this: void, value: string, excludeSymbols?: Array<string>): string;
|
|
1061
|
-
/**
|
|
1062
|
-
* Translates given name into a valid javaScript one.
|
|
1063
|
-
* @param name - Name to convert.
|
|
1064
|
-
* @param allowedSymbols - String of symbols which should be allowed within
|
|
1065
|
-
* a variable name (not the first character).
|
|
1066
|
-
*
|
|
1067
|
-
* @returns Converted name is returned.
|
|
1068
|
-
*/
|
|
1069
|
-
static stringConvertToValidVariableName(this: void, name: string, allowedSymbols?: string): string;
|
|
1070
|
-
/**
|
|
1071
|
-
* This method is intended for encoding *key* or *value* parts of query
|
|
1072
|
-
* component. We need a custom method because "encodeURIComponent()" is too
|
|
1073
|
-
* aggressive and encodes stuff that doesn't have to be encoded per
|
|
1074
|
-
* "http://tools.ietf.org/html/rfc3986:".
|
|
1075
|
-
* @param url - URL to encode.
|
|
1076
|
-
* @param encodeSpaces - Indicates whether given url should encode
|
|
1077
|
-
* whitespaces as "+" or "%20".
|
|
1078
|
-
*
|
|
1079
|
-
* @returns Encoded given url.
|
|
1080
|
-
*/
|
|
1081
|
-
static stringEncodeURIComponent(this: void, url: string, encodeSpaces?: boolean): string;
|
|
1082
|
-
/**
|
|
1083
|
-
* Appends a path selector to the given path if there isn't one yet.
|
|
1084
|
-
* @param path - The path for appending a selector.
|
|
1085
|
-
* @param pathSeparator - The selector for appending to path.
|
|
1086
|
-
*
|
|
1087
|
-
* @returns The appended path.
|
|
1088
|
-
*/
|
|
1089
|
-
static stringAddSeparatorToPath(this: void, path: string, pathSeparator?: string): string;
|
|
1090
|
-
/**
|
|
1091
|
-
* Checks if given path has given path prefix.
|
|
1092
|
-
* @param prefix - Path prefix to search for.
|
|
1093
|
-
* @param path - Path to search in.
|
|
1094
|
-
* @param separator - Delimiter to use in path (default is the posix
|
|
1095
|
-
* conform slash).
|
|
1096
|
-
*
|
|
1097
|
-
* @returns Value "true" if given prefix occur and "false" otherwise.
|
|
1098
|
-
*/
|
|
1099
|
-
static stringHasPathPrefix(this: void, prefix?: unknown, path?: string, separator?: string): boolean;
|
|
1100
|
-
/**
|
|
1101
|
-
* Extracts domain name from given url. If no explicit domain name given
|
|
1102
|
-
* current domain name will be assumed. If no parameter given current
|
|
1103
|
-
* domain name will be determined.
|
|
1104
|
-
* @param url - The url to extract domain from.
|
|
1105
|
-
* @param fallback - The fallback host name if no one exits in given url
|
|
1106
|
-
* (default is current hostname).
|
|
1107
|
-
*
|
|
1108
|
-
* @returns Extracted domain.
|
|
1109
|
-
*/
|
|
1110
|
-
static stringGetDomainName(this: void, url?: string, fallback?: string): string;
|
|
1111
|
-
/**
|
|
1112
|
-
* Extracts port number from given url. If no explicit port number given
|
|
1113
|
-
* and no fallback is defined current port number will be assumed for local
|
|
1114
|
-
* links. For external links 80 will be assumed for http protocols and 443
|
|
1115
|
-
* for https protocols.
|
|
1116
|
-
* @param url - The url to extract port from.
|
|
1117
|
-
* @param fallback - Fallback port number if no explicit one was found.
|
|
1118
|
-
* Default is derived from current protocol name.
|
|
1119
|
-
*
|
|
1120
|
-
* @returns Extracted port number.
|
|
1121
|
-
*/
|
|
1122
|
-
static stringGetPortNumber(this: void, url?: string, fallback?: null | number): null | number;
|
|
1123
|
-
/**
|
|
1124
|
-
* Extracts protocol name from given url. If no explicit url is given,
|
|
1125
|
-
* current protocol will be assumed. If no parameter given current protocol
|
|
1126
|
-
* number will be determined.
|
|
1127
|
-
* @param url - The url to extract protocol from.
|
|
1128
|
-
* @param fallback - Fallback port to use if no protocol exists in given
|
|
1129
|
-
* url (default is current protocol).
|
|
1130
|
-
*
|
|
1131
|
-
* @returns Extracted protocol.
|
|
1132
|
-
*/
|
|
1133
|
-
static stringGetProtocolName(this: void, url?: string, fallback?: string): string;
|
|
1134
|
-
/**
|
|
1135
|
-
* Read a page's GET URL variables and return them as an associative array
|
|
1136
|
-
* and preserves ordering.
|
|
1137
|
-
* @param keyToGet - If provided the corresponding value for given key is
|
|
1138
|
-
* returned or full object otherwise.
|
|
1139
|
-
* @param allowDuplicates - Indicates whether to return arrays of values or
|
|
1140
|
-
* single values. If set to "false" (default) last values will overwrite
|
|
1141
|
-
* preceding values.
|
|
1142
|
-
* @param givenInput - An alternative input to the url search parameter. If
|
|
1143
|
-
* "#" is given the complete current hash tag will be interpreted as url
|
|
1144
|
-
* and search parameter will be extracted from there. If "&" is given
|
|
1145
|
-
* classical search parameter and hash parameter will be taken in account.
|
|
1146
|
-
* If a search string is given this will be analyzed. The default is to
|
|
1147
|
-
* take given search part into account.
|
|
1148
|
-
* @param subDelimiter - Defines which sequence indicates the start of
|
|
1149
|
-
* parameter in a hash part of the url.
|
|
1150
|
-
* @param hashedPathIndicator - If defined and given hash starts with this
|
|
1151
|
-
* indicator given hash will be interpreted as path containing search and
|
|
1152
|
-
* hash parts.
|
|
1153
|
-
* @param givenSearch - Search part to take into account defaults to
|
|
1154
|
-
* current url search part.
|
|
1155
|
-
* @param givenHash - Hash part to take into account defaults to current
|
|
1156
|
-
* url hash part.
|
|
1157
|
-
*
|
|
1158
|
-
* @returns Returns the current get array or requested value. If requested
|
|
1159
|
-
* key doesn't exist "undefined" is returned.
|
|
1160
|
-
*/
|
|
1161
|
-
static stringGetURLParameter(this: void, keyToGet?: null | string, allowDuplicates?: boolean, givenInput?: null | string, subDelimiter?: string, hashedPathIndicator?: string, givenSearch?: null | string, givenHash?: string): Array<string> | null | QueryParameters | string;
|
|
1162
|
-
/**
|
|
1163
|
-
* Checks if given url points to another "service" than second given url.
|
|
1164
|
-
* If no second given url provided current url will be assumed.
|
|
1165
|
-
* @param url - URL to check against second url.
|
|
1166
|
-
* @param referenceURL - URL to check against first url.
|
|
1167
|
-
*
|
|
1168
|
-
* @returns Returns "true" if given first url has same domain as given
|
|
1169
|
-
* second (or current).
|
|
1170
|
-
*/
|
|
1171
|
-
static stringServiceURLEquals(this: void, url: string, referenceURL?: string): boolean;
|
|
1172
|
-
/**
|
|
1173
|
-
* Normalized given website url.
|
|
1174
|
-
* @param url - Uniform resource locator to normalize.
|
|
1175
|
-
*
|
|
1176
|
-
* @returns Normalized result.
|
|
1177
|
-
*/
|
|
1178
|
-
static stringNormalizeURL(this: void, url: string): string;
|
|
1179
|
-
/**
|
|
1180
|
-
* Represents given website url.
|
|
1181
|
-
* @param url - Uniform resource locator to represent.
|
|
1182
|
-
*
|
|
1183
|
-
* @returns Represented result.
|
|
1184
|
-
*/
|
|
1185
|
-
static stringRepresentURL(this: void, url: unknown): string;
|
|
1186
|
-
/**
|
|
1187
|
-
* Converts a camel cased string to its delimited string version.
|
|
1188
|
-
* @param value - The string to format.
|
|
1189
|
-
* @param delimiter - Delimiter string
|
|
1190
|
-
* @param abbreviations - Collection of shortcut words to represent upper
|
|
1191
|
-
* cased.
|
|
1192
|
-
*
|
|
1193
|
-
* @returns The formatted string.
|
|
1194
|
-
*/
|
|
1195
|
-
static stringCamelCaseToDelimited(this: void, value: string, delimiter?: string, abbreviations?: Array<string> | null): string;
|
|
1196
|
-
/**
|
|
1197
|
-
* Converts a string to its capitalize representation.
|
|
1198
|
-
* @param string - The string to format.
|
|
1199
|
-
*
|
|
1200
|
-
* @returns The formatted string.
|
|
1201
|
-
*/
|
|
1202
|
-
static stringCapitalize(this: void, string: string): string;
|
|
1203
|
-
/**
|
|
1204
|
-
* Compresses given style attribute value.
|
|
1205
|
-
* @param styleValue - Style value to compress.
|
|
1206
|
-
*
|
|
1207
|
-
* @returns The compressed value.
|
|
1208
|
-
*/
|
|
1209
|
-
static stringCompressStyleValue(this: void, styleValue: string): string;
|
|
1210
|
-
/**
|
|
1211
|
-
* Decodes all html symbols in text nodes in given html string.
|
|
1212
|
-
* @param htmlString - HTML string to decode.
|
|
1213
|
-
*
|
|
1214
|
-
* @returns Decoded html string.
|
|
1215
|
-
*/
|
|
1216
|
-
static stringDecodeHTMLEntities(this: void, htmlString: string): null | string;
|
|
1217
|
-
/**
|
|
1218
|
-
* Converts a delimited string to its camel case representation.
|
|
1219
|
-
* @param value - The string to format.
|
|
1220
|
-
* @param delimiter - Delimiter string to use.
|
|
1221
|
-
* @param abbreviations - Collection of shortcut words to represent upper
|
|
1222
|
-
* cased.
|
|
1223
|
-
* @param preserveWrongFormattedAbbreviations - If set to "True" wrong
|
|
1224
|
-
* formatted camel case abbreviations will be ignored.
|
|
1225
|
-
* @param removeMultipleDelimiter - Indicates whether a series of delimiter
|
|
1226
|
-
* should be consolidated.
|
|
1227
|
-
*
|
|
1228
|
-
* @returns The formatted string.
|
|
1229
|
-
*/
|
|
1230
|
-
static stringDelimitedToCamelCase(this: void, value: string, delimiter?: string, abbreviations?: Array<string> | null, preserveWrongFormattedAbbreviations?: boolean, removeMultipleDelimiter?: boolean): string;
|
|
1231
|
-
/**
|
|
1232
|
-
* Compiles a given string as expression with given scope names.
|
|
1233
|
-
* @param expression - The string to interpret.
|
|
1234
|
-
* @param scope - Scope to extract names from.
|
|
1235
|
-
* @param execute - Indicates whether to execute or evaluate.
|
|
1236
|
-
* @param removeGlobalScope - Indicates whether to shadow global variables
|
|
1237
|
-
* via "undefined".
|
|
1238
|
-
*
|
|
1239
|
-
* @returns Object of prepared scope name mappings and compiled function or
|
|
1240
|
-
* error string message if given expression couldn't be compiled.
|
|
1241
|
-
*/
|
|
1242
|
-
static stringCompile<T = string, N extends Array<string> = Array<string>>(this: void, expression: string, scope?: N | Mapping<unknown, N[number]> | N[number], execute?: boolean, removeGlobalScope?: boolean): CompilationResult<T, N>;
|
|
1243
|
-
/**
|
|
1244
|
-
* Evaluates a given string as expression against given scope.
|
|
1245
|
-
* @param expression - The string to interpret.
|
|
1246
|
-
* @param scope - Scope to render against.
|
|
1247
|
-
* @param execute - Indicates whether to execute or evaluate.
|
|
1248
|
-
* @param removeGlobalScope - Indicates whether to shadow global variables
|
|
1249
|
-
* via "undefined".
|
|
1250
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
1251
|
-
*
|
|
1252
|
-
* @returns Object with error message during parsing / running or result.
|
|
1253
|
-
*/
|
|
1254
|
-
static stringEvaluate<T = string, S extends object = object>(this: void, expression: string, scope?: S, execute?: boolean, removeGlobalScope?: boolean, binding?: unknown): EvaluationResult<T>;
|
|
1255
|
-
/**
|
|
1256
|
-
* Finds the string match of given query in given target text by applying
|
|
1257
|
-
* given normalisation function to target and query.
|
|
1258
|
-
* @param target - Target to search in.
|
|
1259
|
-
* @param query - Search string to search for.
|
|
1260
|
-
* @param normalizer - Function to use as normalisation for queries and
|
|
1261
|
-
* search targets.
|
|
1262
|
-
* @param skipTagDelimitedParts - Indicates whether to for example ignore
|
|
1263
|
-
* html tags via "['<', '>']" (the default).
|
|
1264
|
-
*
|
|
1265
|
-
* @returns Start and end index of matching range.
|
|
1266
|
-
*/
|
|
1267
|
-
static stringFindNormalizedMatchRange(this: void, target: unknown, query: unknown, normalizer?: (value: unknown) => string, skipTagDelimitedParts?: null | [string, string]): Array<number> | null;
|
|
1268
|
-
/**
|
|
1269
|
-
* Fixes known encoding problems in given data.
|
|
1270
|
-
* @param data - To process.
|
|
1271
|
-
*
|
|
1272
|
-
* @returns Processed data.
|
|
1273
|
-
*/
|
|
1274
|
-
static stringFixKnownEncodingErrors(this: void, data: string): string;
|
|
1275
|
-
/**
|
|
1276
|
-
* Performs a string formation. Replaces every placeholder "{i}" with the
|
|
1277
|
-
* i'th argument.
|
|
1278
|
-
* @param string - The string to format.
|
|
1279
|
-
* @param additionalArguments - Additional arguments are interpreted as
|
|
1280
|
-
* replacements for string formatting.
|
|
1281
|
-
*
|
|
1282
|
-
* @returns The formatted string.
|
|
1283
|
-
*/
|
|
1284
|
-
static stringFormat(this: void, string: string, ...additionalArguments: Array<unknown>): string;
|
|
1285
|
-
/**
|
|
1286
|
-
* Calculates the edit (levenstein) distance between two given strings.
|
|
1287
|
-
* @param first - First string to compare.
|
|
1288
|
-
* @param second - Second string to compare.
|
|
1289
|
-
*
|
|
1290
|
-
* @returns The distance as number.
|
|
1291
|
-
*/
|
|
1292
|
-
static stringGetEditDistance(this: void, first: string, second: string): number;
|
|
1293
|
-
/**
|
|
1294
|
-
* Validates the current string for using in a regular expression pattern.
|
|
1295
|
-
* Special regular expression chars will be escaped.
|
|
1296
|
-
* @param value - The string to format.
|
|
1297
|
-
*
|
|
1298
|
-
* @returns The formatted string.
|
|
1299
|
-
*/
|
|
1300
|
-
static stringMaskForRegularExpression(this: void, value: string): string;
|
|
1301
|
-
/**
|
|
1302
|
-
* Interprets given content string as date time.
|
|
1303
|
-
* @param value - Date time string to interpret.
|
|
1304
|
-
* @param interpretAsUTC - Identifies if given date should be interpret as
|
|
1305
|
-
* utc. If not set given strings will be interpret as it is depending on
|
|
1306
|
-
* given format and number like string as utc.
|
|
1307
|
-
*
|
|
1308
|
-
* @returns Interpret date time object.
|
|
1309
|
-
*/
|
|
1310
|
-
static stringInterpretDateTime(this: void, value: string, interpretAsUTC?: null | boolean): Date | null;
|
|
1311
|
-
/**
|
|
1312
|
-
* Converts a string to its lower case representation.
|
|
1313
|
-
* @param string - The string to format.
|
|
1314
|
-
*
|
|
1315
|
-
* @returns The formatted string.
|
|
1316
|
-
*/
|
|
1317
|
-
static stringLowerCase(this: void, string: string): string;
|
|
1318
|
-
/**
|
|
1319
|
-
* Wraps given mark strings in given target with given marker.
|
|
1320
|
-
* @param target - String to search for marker.
|
|
1321
|
-
* @param givenWords - String or array of strings to search in target for.
|
|
1322
|
-
* @param options - Defines highlighting behavior.
|
|
1323
|
-
* @param options.marker - HTML template string to mark.
|
|
1324
|
-
* @param options.normalizer - Pure normalisation function to use before
|
|
1325
|
-
* searching for matches.
|
|
1326
|
-
* @param options.skipTagDelimitedParts - Indicates whether to for example
|
|
1327
|
-
* ignore html tags via "['<', '>']" (the default).
|
|
1328
|
-
*
|
|
1329
|
-
* @returns Processed result.
|
|
1330
|
-
*/
|
|
1331
|
-
static stringMark(this: void, target: unknown, givenWords?: Array<string> | string, options?: Partial<StringMarkOptions>): unknown;
|
|
1332
|
-
/**
|
|
1333
|
-
* Normalizes given phone number for automatic dialing or comparison.
|
|
1334
|
-
* @param value - Number to normalize.
|
|
1335
|
-
* @param dialable - Indicates whether the result should be dialed or
|
|
1336
|
-
* represented as lossless data.
|
|
1337
|
-
*
|
|
1338
|
-
* @returns Normalized number.
|
|
1339
|
-
*/
|
|
1340
|
-
static stringNormalizePhoneNumber(this: void, value: unknown, dialable?: boolean): string;
|
|
1341
|
-
/**
|
|
1342
|
-
* Normalizes given zip code for automatic address processing.
|
|
1343
|
-
* @param value - Number to normalize.
|
|
1344
|
-
*
|
|
1345
|
-
* @returns Normalized number.
|
|
1346
|
-
*/
|
|
1347
|
-
static stringNormalizeZipCode(this: void, value: unknown): string;
|
|
1348
|
-
/**
|
|
1349
|
-
* Converts given serialized, base64 encoded or file path given object into
|
|
1350
|
-
* a native javaScript one if possible.
|
|
1351
|
-
* @param serializedObject - Object as string.
|
|
1352
|
-
* @param scope - An optional scope which will be used to evaluate given
|
|
1353
|
-
* object in.
|
|
1354
|
-
* @param name - The name under given scope will be available.
|
|
1355
|
-
*
|
|
1356
|
-
* @returns The parsed object if possible and null otherwise.
|
|
1357
|
-
*/
|
|
1358
|
-
static stringParseEncodedObject<T = PlainObject>(this: void, serializedObject: string, scope?: Mapping<unknown>, name?: string): null | T;
|
|
1359
|
-
/**
|
|
1360
|
-
* Represents given phone number. NOTE: Currently only support german phone
|
|
1361
|
-
* numbers.
|
|
1362
|
-
* @param value - Number to format.
|
|
1363
|
-
*
|
|
1364
|
-
* @returns Formatted number.
|
|
1365
|
-
*/
|
|
1366
|
-
static stringRepresentPhoneNumber(this: void, value: unknown): string;
|
|
1367
|
-
/**
|
|
1368
|
-
* Slices all none numbers but preserves last separator.
|
|
1369
|
-
* @param value - String to process.
|
|
1370
|
-
*
|
|
1371
|
-
* @returns - Sliced given value.
|
|
1372
|
-
*/
|
|
1373
|
-
static stringSliceAllExceptNumberAndLastSeperator(this: void, value: string): string;
|
|
1374
|
-
/**
|
|
1375
|
-
* Slice weekday from given date representation.
|
|
1376
|
-
* @param value - String to process.
|
|
1377
|
-
*
|
|
1378
|
-
* @returns Sliced given string.
|
|
1379
|
-
*/
|
|
1380
|
-
static stringSliceWeekday(this: void, value: string): string;
|
|
1381
|
-
/**
|
|
1382
|
-
* Converts a dom selector to a prefixed dom selector string.
|
|
1383
|
-
* @param selector - A dom node selector.
|
|
1384
|
-
*
|
|
1385
|
-
* @returns Returns given selector prefixed.
|
|
1386
|
-
*/
|
|
1387
|
-
stringNormalizeDomNodeSelector: (selector: string) => string;
|
|
1388
|
-
/**
|
|
1389
|
-
* Determines corresponding utc timestamp for given date object.
|
|
1390
|
-
* @param value - Date to convert.
|
|
1391
|
-
* @param inMilliseconds - Indicates whether given number should be in
|
|
1392
|
-
* seconds (default) or milliseconds.
|
|
1393
|
-
*
|
|
1394
|
-
* @returns Determined numerous value.
|
|
1395
|
-
*/
|
|
1396
|
-
static numberGetUTCTimestamp(this: void, value?: Date | null | number | string, inMilliseconds?: boolean): number;
|
|
1397
|
-
/**
|
|
1398
|
-
* Checks if given object is java scripts native "Number.NaN" object.
|
|
1399
|
-
* @param value - Value to check.
|
|
1400
|
-
*
|
|
1401
|
-
* @returns Returns whether given value is not a number or not.
|
|
1402
|
-
*/
|
|
1403
|
-
static numberIsNotANumber(this: void, value: unknown): boolean;
|
|
1404
|
-
/**
|
|
1405
|
-
* Rounds a given number accurate to given number of digits.
|
|
1406
|
-
* @param number - The number to round.
|
|
1407
|
-
* @param digits - The number of digits after comma.
|
|
1408
|
-
*
|
|
1409
|
-
* @returns Returns the rounded number.
|
|
1410
|
-
*/
|
|
1411
|
-
static numberRound(this: void, number: number, digits?: number): number;
|
|
1412
|
-
/**
|
|
1413
|
-
* Rounds a given number up accurate to given number of digits.
|
|
1414
|
-
* @param number - The number to round.
|
|
1415
|
-
* @param digits - The number of digits after comma.
|
|
1416
|
-
*
|
|
1417
|
-
* @returns Returns the rounded number.
|
|
1418
|
-
*/
|
|
1419
|
-
static numberCeil(this: void, number: number, digits?: number): number;
|
|
1420
|
-
/**
|
|
1421
|
-
* Rounds a given number down accurate to given number of digits.
|
|
1422
|
-
* @param number - The number to round.
|
|
1423
|
-
* @param digits - The number of digits after comma.
|
|
1424
|
-
*
|
|
1425
|
-
* @returns Returns the rounded number.
|
|
1426
|
-
*/
|
|
1427
|
-
static numberFloor(this: void, number: number, digits?: number): number;
|
|
1428
|
-
/**
|
|
1429
|
-
* Checks if given url response with given status code.
|
|
1430
|
-
* @param url - Url to check reachability.
|
|
1431
|
-
*
|
|
1432
|
-
* @param givenOptions - Options to configure.
|
|
1433
|
-
* @param givenOptions.wait - Boolean indicating if we should retry until a
|
|
1434
|
-
* status code will be given.
|
|
1435
|
-
* @param givenOptions.statusCodes - Status codes to check for.
|
|
1436
|
-
* @param givenOptions.timeoutInSeconds - Delay after assuming given
|
|
1437
|
-
* resource isn't available if no response is coming.
|
|
1438
|
-
* @param givenOptions.pollIntervallInSeconds - Seconds between two tries
|
|
1439
|
-
* to reach given url.
|
|
1440
|
-
* @param givenOptions.options - Fetch options to use.
|
|
1441
|
-
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected
|
|
1442
|
-
* but unwanted response codes. If detecting them waiting will continue
|
|
1443
|
-
* until an expected (positiv) code occurs or timeout is reached.
|
|
1444
|
-
*
|
|
1445
|
-
* @returns A promise which will be resolved if a request to given url has
|
|
1446
|
-
* finished and resulting status code matches given expected status code.
|
|
1447
|
-
* Otherwise returned promise will be rejected.
|
|
1448
|
-
*/
|
|
1449
|
-
static checkReachability(this: void, url: string, givenOptions?: RecursivePartial<CheckReachabilityOptions>): ReturnType<typeof fetch>;
|
|
1450
|
-
/**
|
|
1451
|
-
* Checks if given url isn't reachable.
|
|
1452
|
-
* @param url - Url to check reachability.
|
|
1453
|
-
*
|
|
1454
|
-
* @param givenOptions - Options to configure.
|
|
1455
|
-
* @param givenOptions.wait - Boolean indicating if we should retry until a
|
|
1456
|
-
* status code will be given.
|
|
1457
|
-
* @param givenOptions.timeoutInSeconds - Delay after assuming given
|
|
1458
|
-
* resource will stay available.
|
|
1459
|
-
* @param givenOptions.pollIntervallInSeconds - Seconds between two tries
|
|
1460
|
-
* to reach given url.
|
|
1461
|
-
* @param givenOptions.statusCodes - Status codes to check for.
|
|
1462
|
-
* @param givenOptions.options - Fetch options to use.
|
|
1463
|
-
*
|
|
1464
|
-
* @returns A promise which will be resolved if a request to given url
|
|
1465
|
-
* couldn't finished. Otherwise returned promise will be rejected. If
|
|
1466
|
-
* "wait" is set to "true" we will resolve to another promise still
|
|
1467
|
-
* resolving when final timeout is reached or the endpoint is unreachable
|
|
1468
|
-
* (after some tries).
|
|
1469
|
-
*/
|
|
1470
|
-
static checkUnreachability(this: void, url: string, givenOptions?: RecursivePartial<CheckReachabilityOptions>): Promise<Error | null | Promise<Error | null>>;
|
|
1471
|
-
/**
|
|
1472
|
-
* Send given data to a given iframe.
|
|
1473
|
-
* @param target - Name of the target iframe or the target iframe itself.
|
|
1474
|
-
* @param url - URL to send to data to.
|
|
1475
|
-
* @param data - Data holding object to send data to.
|
|
1476
|
-
* @param requestType - The forms action attribute value. If nothing is
|
|
1477
|
-
* provided "post" will be used as default.
|
|
1478
|
-
* @param removeAfterLoad - Indicates if created iframe should be removed
|
|
1479
|
-
* right after load event. Only works if an iframe object is given instead
|
|
1480
|
-
* of a simple target name.
|
|
1481
|
-
*
|
|
1482
|
-
* @returns Returns the given target as extended dom node.
|
|
1483
|
-
*/
|
|
1484
|
-
static sendToIFrame(this: void, target: $T<HTMLIFrameElement> | HTMLIFrameElement | string, url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean): $T<HTMLIFrameElement>;
|
|
1485
|
-
/**
|
|
1486
|
-
* Send given data to a temporary created iframe.
|
|
1487
|
-
* @param url - URL to send to data to.
|
|
1488
|
-
* @param data - Data holding object to send data to.
|
|
1489
|
-
* @param requestType - The forms action attribute value. If nothing is
|
|
1490
|
-
* provided "post" will be used as default.
|
|
1491
|
-
* @param removeAfterLoad - Indicates if created iframe should be removed
|
|
1492
|
-
* right after load event.
|
|
1493
|
-
*
|
|
1494
|
-
* @returns Returns the dynamically created iframe.
|
|
1495
|
-
*/
|
|
1496
|
-
sendToExternalURL: (url: string, data: Mapping<unknown>, requestType?: string, removeAfterLoad?: boolean) => $T<HTMLIFrameElement>;
|
|
1497
|
-
/**
|
|
1498
|
-
* Copies given source directory via path to given target directory
|
|
1499
|
-
* location with same target name as source file has or copy to given
|
|
1500
|
-
* complete target directory path.
|
|
1501
|
-
* @param sourcePath - Path to directory to copy.
|
|
1502
|
-
* @param targetPath - Target directory or complete directory location to
|
|
1503
|
-
* copy in.
|
|
1504
|
-
* @param callback - Function to invoke for each traversed file.
|
|
1505
|
-
* @param readOptions - Options to use for reading source file.
|
|
1506
|
-
* @param writeOptions - Options to use for writing to target file.
|
|
1507
|
-
*
|
|
1508
|
-
* @returns Promise holding the determined target directory path.
|
|
1509
|
-
*/
|
|
1510
|
-
static copyDirectoryRecursive(this: void, sourcePath: string, targetPath: string, callback?: AnyFunction, readOptions?: {
|
|
1511
|
-
encoding: null;
|
|
1512
|
-
flag: string;
|
|
1513
|
-
}, writeOptions?: {
|
|
1514
|
-
encoding: Encoding;
|
|
1515
|
-
flag: string;
|
|
1516
|
-
mode: number;
|
|
1517
|
-
}): Promise<string>;
|
|
1518
|
-
/**
|
|
1519
|
-
* Copies given source directory via path to given target directory
|
|
1520
|
-
* location with same target name as source file has or copy to given
|
|
1521
|
-
* complete target directory path.
|
|
1522
|
-
* @param sourcePath - Path to directory to copy.
|
|
1523
|
-
* @param targetPath - Target directory or complete directory location to
|
|
1524
|
-
* copy in.
|
|
1525
|
-
* @param callback - Function to invoke for each traversed file.
|
|
1526
|
-
* @param readOptions - Options to use for reading source file.
|
|
1527
|
-
* @param writeOptions - Options to use for writing to target file.
|
|
1528
|
-
*
|
|
1529
|
-
* @returns Determined target directory path.
|
|
1530
|
-
*/
|
|
1531
|
-
static copyDirectoryRecursiveSync(this: void, sourcePath: string, targetPath: string, callback?: AnyFunction, readOptions?: {
|
|
1532
|
-
encoding: null;
|
|
1533
|
-
flag: string;
|
|
1534
|
-
}, writeOptions?: {
|
|
1535
|
-
encoding: Encoding;
|
|
1536
|
-
flag: string;
|
|
1537
|
-
mode: number;
|
|
1538
|
-
}): string;
|
|
1539
|
-
/**
|
|
1540
|
-
* Copies given source file via path to given target directory location
|
|
1541
|
-
* with same target name as source file has or copy to given complete
|
|
1542
|
-
* target file path.
|
|
1543
|
-
* @param sourcePath - Path to file to copy.
|
|
1544
|
-
* @param targetPath - Target directory or complete file location to copy
|
|
1545
|
-
* to.
|
|
1546
|
-
* @param readOptions - Options to use for reading source file.
|
|
1547
|
-
* @param writeOptions - Options to use for writing to target file.
|
|
1548
|
-
*
|
|
1549
|
-
* @returns Determined target file path.
|
|
1550
|
-
*/
|
|
1551
|
-
static copyFile(this: void, sourcePath: string, targetPath: string, readOptions?: {
|
|
1552
|
-
encoding: null;
|
|
1553
|
-
flag: string;
|
|
1554
|
-
}, writeOptions?: {
|
|
1555
|
-
encoding: Encoding;
|
|
1556
|
-
flag: string;
|
|
1557
|
-
mode: number;
|
|
1558
|
-
}): Promise<string>;
|
|
1559
|
-
/**
|
|
1560
|
-
* Copies given source file via path to given target directory location
|
|
1561
|
-
* with same target name as source file has or copy to given complete
|
|
1562
|
-
* target file path.
|
|
1563
|
-
* @param sourcePath - Path to file to copy.
|
|
1564
|
-
* @param targetPath - Target directory or complete file location to copy
|
|
1565
|
-
* to.
|
|
1566
|
-
* @param readOptions - Options to use for reading source file.
|
|
1567
|
-
* @param writeOptions - Options to use for writing to target file.
|
|
1568
|
-
*
|
|
1569
|
-
* @returns Determined target file path.
|
|
1570
|
-
*/
|
|
1571
|
-
static copyFileSync(this: void, sourcePath: string, targetPath: string, readOptions?: {
|
|
1572
|
-
encoding: null;
|
|
1573
|
-
flag: string;
|
|
1574
|
-
}, writeOptions?: {
|
|
1575
|
-
encoding: Encoding;
|
|
1576
|
-
flag: string;
|
|
1577
|
-
mode: number;
|
|
1578
|
-
}): string;
|
|
1579
|
-
/**
|
|
1580
|
-
* Checks if given path points to a valid directory.
|
|
1581
|
-
* @param filePath - Path to directory.
|
|
1582
|
-
*
|
|
1583
|
-
* @returns A promise holding a boolean which indicates directory
|
|
1584
|
-
* existence.
|
|
1585
|
-
*/
|
|
1586
|
-
static isDirectory(this: void, filePath: string): Promise<boolean>;
|
|
1587
|
-
/**
|
|
1588
|
-
* Checks if given path points to a valid directory.
|
|
1589
|
-
* @param filePath - Path to directory.
|
|
1590
|
-
*
|
|
1591
|
-
* @returns A boolean which indicates directory existents.
|
|
1592
|
-
*/
|
|
1593
|
-
static isDirectorySync(this: void, filePath: string): boolean;
|
|
1594
|
-
/**
|
|
1595
|
-
* Checks if given path points to a valid file.
|
|
1596
|
-
* @param filePath - Path to directory.
|
|
1597
|
-
*
|
|
1598
|
-
* @returns A promise holding a boolean which indicates directory
|
|
1599
|
-
* existence.
|
|
1600
|
-
*/
|
|
1601
|
-
static isFile(this: void, filePath: string): Promise<boolean>;
|
|
1602
|
-
/**
|
|
1603
|
-
* Checks if given path points to a valid file.
|
|
1604
|
-
* @param filePath - Path to file.
|
|
1605
|
-
*
|
|
1606
|
-
* @returns A boolean which indicates file existence.
|
|
1607
|
-
*/
|
|
1608
|
-
static isFileSync(this: void, filePath: string): boolean;
|
|
1609
|
-
/**
|
|
1610
|
-
* Iterates through given directory structure recursively and calls given
|
|
1611
|
-
* callback for each found file. Callback gets file path and corresponding
|
|
1612
|
-
* stat object as argument.
|
|
1613
|
-
* @param directoryPath - Path to directory structure to traverse.
|
|
1614
|
-
* @param callback - Function to invoke for each traversed file and
|
|
1615
|
-
* potentially manipulate further traversing in alphabetical sorted order.
|
|
1616
|
-
* If it returns "null" or a promise resolving to "null", no further files
|
|
1617
|
-
* will be traversed afterwards.
|
|
1618
|
-
* If it handles a directory and returns "false" or a promise resolving to
|
|
1619
|
-
* "false" no traversing into that directory will occur.
|
|
1620
|
-
* @param options - Options to use for nested "readdir" calls.
|
|
1621
|
-
*
|
|
1622
|
-
* @returns A promise holding the determined files.
|
|
1623
|
-
*/
|
|
1624
|
-
static walkDirectoryRecursively(this: void, directoryPath: string, callback?: null | ((_file: File) => FileTraversionResult), options?: (Encoding | SecondParameter<typeof import('fs').readdir>)): Promise<Array<File>>;
|
|
1625
|
-
/**
|
|
1626
|
-
* Iterates through given directory structure recursively and calls given
|
|
1627
|
-
* callback for each found file. Callback gets file path and corresponding
|
|
1628
|
-
* stats object as argument.
|
|
1629
|
-
* @param directoryPath - Path to directory structure to traverse.
|
|
1630
|
-
* @param callback - Function to invoke for each traversed file.
|
|
1631
|
-
* @param options - Options to use for nested "readdir" calls.
|
|
1632
|
-
*
|
|
1633
|
-
* @returns Determined list if all files.
|
|
1634
|
-
*/
|
|
1635
|
-
static walkDirectoryRecursivelySync(this: void, directoryPath: string, callback?: AnyFunction | null, options?: (Encoding | SecondParameter<typeof import('fs').readdirSync>)): Array<File>;
|
|
1636
|
-
/**
|
|
1637
|
-
* Generates a one shot close handler which triggers given promise methods.
|
|
1638
|
-
* If a reason is provided it will be given as resolve target. An Error
|
|
1639
|
-
* will be generated if return code is not zero. The generated Error has
|
|
1640
|
-
* a property "returnCode" which provides corresponding process return
|
|
1641
|
-
* code.
|
|
1642
|
-
* @param resolve - Promise's resolve function.
|
|
1643
|
-
* @param reject - Promise's reject function.
|
|
1644
|
-
* @param reason - Promise target if process has a zero return code.
|
|
1645
|
-
* @param callback - Optional function to call of process has successfully
|
|
1646
|
-
* finished.
|
|
1647
|
-
*
|
|
1648
|
-
* @returns Process close handler function.
|
|
1649
|
-
*/
|
|
1650
|
-
static getProcessCloseHandler(this: void, resolve: ProcessCloseCallback, reject: ProcessErrorCallback, reason?: unknown, callback?: AnyFunction): ProcessHandler;
|
|
1651
|
-
/**
|
|
1652
|
-
* Forwards given child process communication channels to corresponding
|
|
1653
|
-
* current process communication channels.
|
|
1654
|
-
* @param childProcess - Child process meta data.
|
|
1655
|
-
*
|
|
1656
|
-
* @returns Given child process meta data.
|
|
1657
|
-
*/
|
|
1658
|
-
static handleChildProcess(this: void, childProcess: ChildProcess): ChildProcess;
|
|
1659
|
-
/**
|
|
1660
|
-
* Helper method for attach/remove event handler methods.
|
|
1661
|
-
* @param parameters - Arguments object given to methods like "on()" or
|
|
1662
|
-
* "off()".
|
|
1663
|
-
* @param removeEvent - Indicates if handler should be attached or removed.
|
|
1664
|
-
* @param eventFunctionName - Name of function to wrap.
|
|
1665
|
-
*
|
|
1666
|
-
* @returns Returns $'s wrapped dom node.
|
|
1667
|
-
*/
|
|
1668
|
-
_bindEventHelper: <TElement_1 = HTMLElement>(parameters: Array<unknown>, removeEvent?: boolean, eventFunctionName?: string) => $T<TElement_1>;
|
|
1669
|
-
}
|
|
1670
|
-
/**
|
|
1671
|
-
* Dom bound version of Tools class.
|
|
1672
|
-
*/
|
|
1673
|
-
export declare class BoundTools<TElement = HTMLElement> extends Tools<TElement> {
|
|
1674
|
-
$domNode: $T<TElement>;
|
|
1675
|
-
readonly self: typeof BoundTools;
|
|
1676
|
-
/**
|
|
1677
|
-
* This method should be overwritten normally. It is triggered if current
|
|
1678
|
-
* object is created via the "new" keyword. The dom node selector prefix
|
|
1679
|
-
* enforces to not globally select any dom nodes which aren't in the
|
|
1680
|
-
* expected scope of this plugin. "{1}" will be automatically replaced with
|
|
1681
|
-
* this plugin name suffix ("tools"). You don't have to use "{1}" but it
|
|
1682
|
-
* can help you to write code which is more reconcilable with the dry
|
|
1683
|
-
* concept.
|
|
1684
|
-
* @param $domNode - $-extended dom node to use as reference in various
|
|
1685
|
-
* methods.
|
|
1686
|
-
* @param additionalParameters - Additional parameters to call super method
|
|
1687
|
-
* with.
|
|
1688
|
-
*
|
|
1689
|
-
* @returns Nothing.
|
|
1690
|
-
*/
|
|
1691
|
-
constructor($domNode: $T<TElement>, ...additionalParameters: ParametersExceptFirst<Tools['constructor']>);
|
|
1692
|
-
}
|
|
1693
|
-
export default Tools;
|
|
1694
|
-
export declare const augment$: (value: $TStatic) => void;
|