clientnode 4.0.1441 → 4.0.1442

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/Lock.d.ts +39 -0
  2. package/dist/Logger.d.ts +102 -0
  3. package/dist/Semaphore.d.ts +29 -0
  4. package/dist/array.d.ts +150 -0
  5. package/dist/cli.d.ts +31 -0
  6. package/dist/constants.d.ts +99 -0
  7. package/dist/context.d.ts +8 -0
  8. package/dist/cookie.d.ts +31 -0
  9. package/dist/data-transfer.d.ts +45 -0
  10. package/dist/datetime.d.ts +37 -0
  11. package/dist/domNode.d.ts +82 -0
  12. package/dist/expression/evaluators.d.ts +55 -0
  13. package/dist/expression/helper.d.ts +4 -0
  14. package/dist/expression/index.d.ts +7 -0
  15. package/dist/expression/indicator-functions.d.ts +14 -0
  16. package/dist/expression/type.d.ts +70 -0
  17. package/dist/filesystem.d.ts +143 -0
  18. package/dist/function.d.ts +20 -0
  19. package/dist/index.d.ts +23 -0
  20. package/dist/indicators.d.ts +68 -0
  21. package/dist/module.d.ts +8 -0
  22. package/dist/number.d.ts +35 -0
  23. package/dist/object.d.ts +231 -0
  24. package/dist/process.d.ts +22 -0
  25. package/dist/property-types.d.ts +460 -0
  26. package/dist/scope.d.ts +44 -0
  27. package/dist/string.d.ts +312 -0
  28. package/dist/test/Lock.d.ts +1 -0
  29. package/dist/test/Logger.d.ts +1 -0
  30. package/dist/test/Semaphore.d.ts +1 -0
  31. package/dist/test/array.d.ts +1 -0
  32. package/dist/test/cookie.d.ts +1 -0
  33. package/dist/test/data-transfer.d.ts +1 -0
  34. package/dist/test/datetime.d.ts +1 -0
  35. package/dist/test/domNode.d.ts +1 -0
  36. package/dist/test/expression/evaluators.d.ts +1 -0
  37. package/dist/test/expression/helper.d.ts +1 -0
  38. package/dist/test/expression/indicator-functions.d.ts +1 -0
  39. package/dist/test/filesystem.d.ts +1 -0
  40. package/dist/test/function.d.ts +1 -0
  41. package/dist/test/indicators.d.ts +1 -0
  42. package/dist/test/number.d.ts +1 -0
  43. package/dist/test/object.d.ts +1 -0
  44. package/dist/test/process.d.ts +1 -0
  45. package/dist/test/property-types.d.ts +1 -0
  46. package/dist/test/scope.d.ts +1 -0
  47. package/dist/test/string.d.ts +1 -0
  48. package/dist/test/utility.d.ts +1 -0
  49. package/dist/test-helper.d.ts +143 -0
  50. package/dist/type.d.ts +230 -0
  51. package/dist/utility.d.ts +44 -0
  52. package/package.json +2 -2
@@ -0,0 +1,231 @@
1
+ import type { CompareOptions, EvaluateDynamicDataOptions, GetterFunction, Mapping, ObjectMaskConfiguration, PlainObject, ProxyHandler, ProxyType, RecursiveAsyncEvaluateable, RecursiveEvaluateable, RecursivePartial, SetterFunction } from './type';
2
+ import { IGNORE_NULL_AND_UNDEFINED_SYMBOL } from './constants';
3
+ /**
4
+ * Adds dynamic getter and setter to any given data structure such as maps.
5
+ * @param object - Object to proxy.
6
+ * @param getterWrapper - Function to wrap each property get.
7
+ * @param setterWrapper - Function to wrap each property set.
8
+ * @param methodNames - Method names to perform actions on the given
9
+ * object.
10
+ * @param deep - Indicates to perform a deep wrapping of specified types.
11
+ * @param typesToExtend - Types which should be extended (Checks are
12
+ * performed via "value instanceof type".).
13
+ * @returns Returns given object wrapped with a dynamic getter proxy.
14
+ */
15
+ export declare const addDynamicGetterAndSetter: <T = unknown>(object: T, getterWrapper?: GetterFunction | null, setterWrapper?: null | SetterFunction, methodNames?: Mapping, deep?: boolean, typesToExtend?: Array<unknown>) => ProxyType<T> | T;
16
+ /**
17
+ * Converts given object into its serialized JSON representation by
18
+ * replacing circular references with a given provided value.
19
+ *
20
+ * This method traverses given object recursively and tracks of seen and
21
+ * already serialized structures to reuse generated strings or mark a
22
+ * circular reference.
23
+ * @param object - Object to serialize.
24
+ * @param determineCircularReferenceValue - Callback to create a fallback
25
+ * value depending on given redundant value.
26
+ * @param numberOfSpaces - Number of spaces to use for string formatting.
27
+ * @returns The formatted JSON string.
28
+ */
29
+ export declare const convertCircularObjectToJSON: (object: unknown, determineCircularReferenceValue?: ((serializedValue: unknown, key: null | string, value: unknown, seenObjects: Map<unknown, unknown>) => unknown), numberOfSpaces?: number) => ReturnType<typeof JSON.stringify> | undefined;
30
+ /**
31
+ * Converts given map and all nested found maps objects to corresponding
32
+ * object.
33
+ * @param object - Map to convert to.
34
+ * @param deep - Indicates whether to perform a recursive conversion.
35
+ * @returns Given map as object.
36
+ */
37
+ export declare const convertMapToPlainObject: (object: unknown, deep?: boolean) => unknown;
38
+ /**
39
+ * Converts given plain object and all nested found objects to
40
+ * corresponding map.
41
+ * @param object - Object to convert to.
42
+ * @param deep - Indicates whether to perform a recursive conversion.
43
+ * @returns Given object as map.
44
+ */
45
+ export declare const convertPlainObjectToMap: (object: unknown, deep?: boolean) => unknown;
46
+ /**
47
+ * Replaces given pattern in each value in given object recursively with
48
+ * given string replacement.
49
+ * @param object - Object to convert substrings in.
50
+ * @param pattern - Regular expression to replace.
51
+ * @param replacement - String to use as replacement for found patterns.
52
+ * @returns Converted object with replaced patterns.
53
+ */
54
+ export declare const convertSubstringInPlainObject: <Type extends Mapping<unknown> = PlainObject>(object: Type, pattern: RegExp | string, replacement: string) => Type;
55
+ /**
56
+ * Copies given object (of any type) into optionally given destination.
57
+ * @param source - Object to copy.
58
+ * @param copyBlobs - Determines whether to copy blobs as well.
59
+ * @param recursionLimit - Specifies how deep we should traverse into given
60
+ * object recursively.
61
+ * @param recursionEndValue - Indicates which value to use for recursion ends.
62
+ * Usually a reference to corresponding source value will be used.
63
+ * @param destination - Target to copy source to.
64
+ * @param cyclic - Indicates whether known sub structures should be copied or
65
+ * referenced (if "true" endless loops can occur if source has cyclic
66
+ * structures).
67
+ * @param knownReferences - Used to avoid traversing loops and not to copy
68
+ * references e.g. to objects not to copy (e.g. symbol polyfills).
69
+ * @param recursionLevel - Internally used to track current recursion level in
70
+ * given source data structure.
71
+ * @returns Value "true" if both objects are equal and "false" otherwise.
72
+ */
73
+ export declare const copy: <Type = unknown>(source: Type, copyBlobs?: boolean, recursionLimit?: number, recursionEndValue?: unknown, destination?: null | Type, cyclic?: boolean, knownReferences?: Array<unknown>, recursionLevel?: number) => Type;
74
+ /**
75
+ * Determine the internal JavaScript [[Class]] of an object.
76
+ * @param value - Value to analyze.
77
+ * @returns Name of determined type.
78
+ */
79
+ export declare const determineType: (value?: unknown) => string;
80
+ /**
81
+ * Returns true if given items are equal for given property list. If
82
+ * property list isn't set all properties will be checked. All keys which
83
+ * starts with one of the exception prefixes will be omitted.
84
+ * @param firstValue - First object to compare.
85
+ * @param secondValue - Second object to compare.
86
+ * @param givenOptions - Options to define how to compare.
87
+ * @param givenOptions.properties - Property names to check. Check all if
88
+ * "null" is selected (default).
89
+ * @param givenOptions.deep - Recursion depth negative values means
90
+ * infinitely deep (default).
91
+ * @param givenOptions.exceptionPrefixes - Property prefixes which
92
+ * indicates properties to ignore.
93
+ * @param givenOptions.ignoreFunctions - Indicates whether functions have
94
+ * to be identical to interpret is as equal. If set to "true" two functions
95
+ * will be assumed to be equal (default).
96
+ * @param givenOptions.compareBlobs - Indicates whether binary data should
97
+ * be converted to a base64 string to compare their content. Makes this
98
+ * function asynchronous in browsers and potentially takes a lot of
99
+ * resources.
100
+ * @returns Value "true" if both objects are equal and "false" otherwise.
101
+ * If "compareBlobs" is activated, and we're running in a browser like
102
+ * environment and binary data is given, then a promise wrapping the
103
+ * determined boolean values is returned.
104
+ */
105
+ export declare const equals: (firstValue: unknown, secondValue: unknown, givenOptions?: Partial<CompareOptions>) => boolean | Promise<boolean | string> | string;
106
+ /**
107
+ * Wraps given data structure into proxies recursively to evaluate and resolve
108
+ * each get request to data having an object with indicating keys and replaces
109
+ * that object with corresponding evaluated values. All nested objects are
110
+ * wrapped with a proxy to resolve chains of referencing expressions as well.
111
+ * @param object - Given mapping to resolve.
112
+ * @param givenOptions - Options to configure evaluation.
113
+ * @param givenOptions.scope - Scope to use evaluate again.
114
+ * @param givenOptions.selfReferenceName - Name to use for reference to given
115
+ * object.
116
+ * @param givenOptions.expressionIndicatorKey - Indicator property name to mark
117
+ * a value to evaluate.
118
+ * @param givenOptions.executionIndicatorKey - Indicator property name to mark
119
+ * a value to evaluate.
120
+ * @returns Evaluated given mapping.
121
+ */
122
+ export declare const evaluateDynamicData: <Type = unknown>(object: null | RecursiveEvaluateable<Type>, givenOptions?: Partial<EvaluateDynamicDataOptions>) => Type;
123
+ /**
124
+ * Searches for indicating keys and replaces that data with corresponding
125
+ * evaluated and promise resolved value.
126
+ * @param data - Given mapping to resolve.
127
+ * @param givenOptions - Options to configure evaluation.
128
+ * @param givenOptions.scope - Scope to use evaluate again.
129
+ * @param givenOptions.selfReferenceName - Name to use for reference to given
130
+ * object.
131
+ * @param givenOptions.expressionIndicatorKey - Indicator property name to mark
132
+ * a value to evaluate.
133
+ * @param givenOptions.executionIndicatorKey - Indicator property name to mark
134
+ * a value to evaluate.
135
+ * @returns Evaluated given mapping.
136
+ */
137
+ export declare const evaluateAsyncDynamicData: <Type = unknown>(data: null | RecursiveAsyncEvaluateable<Type>, givenOptions?: Partial<EvaluateDynamicDataOptions>) => Promise<Type>;
138
+ /**
139
+ * Removes properties in objects where a dynamic indicator lives.
140
+ * @param data - Object to traverse recursively.
141
+ * @param expressionIndicators - Property key to remove.
142
+ * @returns Given object with removed properties.
143
+ */
144
+ export declare const removeKeysInEvaluation: <T extends Mapping<unknown> = Mapping<unknown>>(data: T, expressionIndicators?: Array<string>) => T;
145
+ /**
146
+ * Extends given target object with given sources object. As target and
147
+ * sources many expandable types are allowed but target and sources have to
148
+ * come from the same type.
149
+ * @param targetOrDeepIndicator - Maybe the target or deep indicator.
150
+ * @param targetOrSource - Target or source object; depending on first
151
+ * argument.
152
+ * @param additionalSources - Source objects to extend into target.
153
+ * @returns Returns given target extended with all given sources.
154
+ */
155
+ export declare const extend: <T = Mapping<unknown>>(targetOrDeepIndicator: (boolean | typeof IGNORE_NULL_AND_UNDEFINED_SYMBOL | RecursivePartial<T>), targetOrSource?: null | RecursivePartial<T>, ...additionalSources: Array<RecursivePartial<T>>) => T;
156
+ /**
157
+ * Generates a proxy handler which forwards all operations to given object
158
+ * as there wouldn't be a proxy.
159
+ * @param target - Object to proxy.
160
+ * @param methodNames - Mapping of operand name to object specific method
161
+ * name.
162
+ * @returns Determined proxy handler.
163
+ */
164
+ export declare const getProxyHandler: <T = unknown>(target: T, methodNames?: Mapping) => ProxyHandler<T>;
165
+ /**
166
+ * Slices all properties from given object which does not match provided
167
+ * object mask. Items can be explicitly whitelisted via "include" mask
168
+ * configuration or black listed via "exclude" mask configuration.
169
+ * @param object - Object to slice.
170
+ * @param maskConfiguration - Mask configuration.
171
+ * @returns Given but sliced object. If (nested) object will be modified a
172
+ * flat copy of that object will be returned.
173
+ */
174
+ export declare const mask: <Type extends Mapping<unknown> = Mapping<unknown>>(object: Type, maskConfiguration: ObjectMaskConfiguration) => RecursivePartial<Type>;
175
+ /**
176
+ * Modifies given target corresponding to given source and removes source
177
+ * modification infos.
178
+ * @param target - Object to modify.
179
+ * @param source - Source object to load modifications from.
180
+ * @param removeIndicatorKey - Indicator property name or value to mark a
181
+ * value to remove from object or list.
182
+ * @param prependIndicatorKey - Indicator property name to mark a value to
183
+ * prepend to target list.
184
+ * @param appendIndicatorKey - Indicator property name to mark a value to
185
+ * append to target list.
186
+ * @param positionPrefix - Indicates a prefix to use a value on given
187
+ * position to add or remove.
188
+ * @param positionSuffix - Indicates a suffix to use a value on given
189
+ * position to add or remove.
190
+ * @param parentSource - Source context to remove modification info from
191
+ * (usually only needed internally).
192
+ * @param parentKey - Source key in given source context to remove
193
+ * modification info from (usually only needed internally).
194
+ * @returns Given target modified with given source.
195
+ */
196
+ export declare const modifyObject: <T = unknown>(target: T, source: unknown, removeIndicatorKey?: string, prependIndicatorKey?: string, appendIndicatorKey?: string, positionPrefix?: string, positionSuffix?: string, parentSource?: unknown, parentKey?: unknown) => T;
197
+ /**
198
+ * Removes given key from given object recursively.
199
+ * @param object - Object to process.
200
+ * @param keys - List of keys to remove.
201
+ * @returns Processed given object.
202
+ */
203
+ export declare const removeKeyPrefixes: <T>(object: T, keys?: Array<string> | string) => T;
204
+ /**
205
+ * Represents given object as formatted string.
206
+ * @param object - Object to represent.
207
+ * @param maximumLengthOfLists - Maximum number of array item to render.
208
+ * @param indention - String (usually whitespaces) to use as indention.
209
+ * @param initialIndention - String (usually whitespaces) to use as
210
+ * additional indention for the first object traversing level.
211
+ * @param maximumNumberOfLevelsReachedIdentifier - Replacement for objects
212
+ * which are out of specified bounds to traverse.
213
+ * @param numberOfLevels - Specifies number of levels to traverse given
214
+ * data structure.
215
+ * @returns Representation string.
216
+ */
217
+ export declare const represent: (object: unknown, maximumLengthOfLists?: number, indention?: string, initialIndention?: string, maximumNumberOfLevelsReachedIdentifier?: number | string, numberOfLevels?: number) => string;
218
+ /**
219
+ * Sort given objects keys.
220
+ * @param object - Object which keys should be sorted.
221
+ * @returns Sorted list of given keys.
222
+ */
223
+ export declare const sort: (object: unknown) => Array<unknown>;
224
+ /**
225
+ * Removes a proxy from given data structure recursively.
226
+ * @param object - Object to proxy.
227
+ * @param seenObjects - Tracks all already processed objects to avoid
228
+ * endless loops (usually only needed for internal purpose).
229
+ * @returns Returns given object unwrapped from a dynamic proxy.
230
+ */
231
+ export declare const unwrapProxy: <T = unknown>(object: ProxyType<T> | T, seenObjects?: Set<unknown>) => T;
@@ -0,0 +1,22 @@
1
+ import type { ChildProcess } from 'child_process';
2
+ import type { AnyFunction, ProcessCloseCallback, ProcessErrorCallback, ProcessHandler } from './type';
3
+ /**
4
+ * Generates a one shot close handler which triggers given promise methods.
5
+ * If a reason is provided it will be given as resolve target. An Error will be
6
+ * generated if return code is not zero. The generated Error has a property
7
+ * "returnCode" which provides corresponding process return code.
8
+ * @param resolve - Promise's resolve function.
9
+ * @param reject - Promise's reject function.
10
+ * @param reason - Promise target if process has a zero return code.
11
+ * @param callback - Optional function to call of process has successfully
12
+ * finished.
13
+ * @returns Process close handler function.
14
+ */
15
+ export declare const getProcessCloseHandler: (resolve: ProcessCloseCallback, reject: ProcessErrorCallback, reason?: unknown, callback?: AnyFunction) => ProcessHandler;
16
+ /**
17
+ * Forwards given child process communication channels to corresponding current
18
+ * process communication channels.
19
+ * @param childProcess - Child process meta data.
20
+ * @returns Given child process meta data.
21
+ */
22
+ export declare const handleChildProcess: (childProcess: ChildProcess) => ChildProcess;