clientnode 3.0.982 → 3.0.984
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
- package/testHelper.js +1 -1
- package/type.d.ts +60 -60
package/type.d.ts
CHANGED
|
@@ -6,51 +6,51 @@ import { Matchers } from 'expect';
|
|
|
6
6
|
import { Dirent as DirectoryEntry, Stats as FileStats } from 'fs';
|
|
7
7
|
import Tools, { BoundTools } from './index';
|
|
8
8
|
import { DefinedSymbol, ThrowSymbol, UndefinedSymbol } from './testHelper';
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
9
|
+
export type AnyFunction = (...parameters: Array<any>) => any;
|
|
10
|
+
export type Unpacked<T> = T extends (infer U)[] ? U : T extends (...parameters: Array<unknown>) => infer U ? U : T extends Promise<infer U> ? U : T;
|
|
11
|
+
export type FirstParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[0];
|
|
12
|
+
export type SecondParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[1];
|
|
13
|
+
export type ThirdParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[2];
|
|
14
|
+
export type ParametersExceptFirst<FunctionType> = FunctionType extends (parameter: any, ...additionalParameters: infer AdditionalParameters) => any ? AdditionalParameters : [
|
|
15
15
|
];
|
|
16
|
-
export
|
|
16
|
+
export type FunctionTestTuple<FunctionType extends AnyFunction> = [
|
|
17
17
|
ReturnType<FunctionType>,
|
|
18
18
|
...Parameters<FunctionType>
|
|
19
19
|
];
|
|
20
|
-
export
|
|
20
|
+
export type FunctionTestPromiseTuple<FunctionType extends AnyFunction> = [
|
|
21
21
|
ThenParameter<ReturnType<FunctionType>>,
|
|
22
22
|
...Parameters<FunctionType>
|
|
23
23
|
];
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
24
|
+
export type FunctionTestPromiseRejectionTuple<FunctionType extends AnyFunction> = [Error, ...Parameters<FunctionType>];
|
|
25
|
+
export type BaseSelector<T = unknown, E = unknown> = number | string | ((target: T) => E);
|
|
26
|
+
export type Selector<T = unknown, E = unknown> = Array<BaseSelector<T, E>> | BaseSelector<T, E>;
|
|
27
|
+
export type TestSymbol = typeof DefinedSymbol | typeof ThrowSymbol | typeof UndefinedSymbol;
|
|
28
|
+
export type ThenParameter<Type> = Type extends PromiseLike<infer U> ? U : Type;
|
|
29
|
+
export type ThenParameterRecursive<Type> = Type extends PromiseLike<infer U> ? ThenParameterRecursive<U> : Type;
|
|
30
|
+
export type ValueOf<Type> = Type[keyof Type];
|
|
31
|
+
export type RecursiveNonNullable<Type> = {
|
|
32
32
|
[Property in keyof Type]: Type[Property] extends (infer OtherType)[] ? RecursiveNonNullable<OtherType>[] : Type[Property] extends AnyFunction ? NonNullable<Type[Property]> : Type[Property] extends Mapping<unknown> ? RecursiveNonNullable<Type[Property]> : NonNullable<Type[Property]>;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type RecursivePartial<Type> = Partial<Type> | {
|
|
35
35
|
[Property in keyof Type]?: Type[Property] extends (infer OtherType)[] ? RecursivePartial<OtherType>[] : Type[Property] extends AnyFunction ? Partial<Type[Property]> : Type[Property] extends Mapping<unknown> ? RecursivePartial<Type[Property]> : Partial<Type[Property]>;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
38
|
-
export
|
|
37
|
+
export type FileTraversionResult = false | null | Promise<false | null | void> | void;
|
|
38
|
+
export type TestMatchers<T extends void> = Matchers<T> & {
|
|
39
39
|
not: Matchers<T>;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
41
|
+
export type ImportFunction = (id: string) => Promise<ReturnType<typeof require>>;
|
|
42
|
+
export type HTMLItem = Comment | Document | HTMLElement | Text;
|
|
43
|
+
export type Primitive = boolean | null | number | string | undefined;
|
|
44
|
+
export type PlainObject<Type = Primitive> = {
|
|
45
45
|
[key: string]: Array<PlainObject<Type> | Type> | PlainObject<Type> | Type;
|
|
46
46
|
};
|
|
47
47
|
export interface ProxyHandler<T = unknown> {
|
|
48
|
-
deleteProperty: (
|
|
49
|
-
get: (
|
|
50
|
-
has: (
|
|
51
|
-
set: (
|
|
48
|
+
deleteProperty: (target: T, key: string | symbol) => boolean;
|
|
49
|
+
get: (target: T, key: string | symbol) => unknown;
|
|
50
|
+
has: (target: T, key: string | symbol) => boolean;
|
|
51
|
+
set: (target: T, key: string | symbol, value: unknown) => boolean;
|
|
52
52
|
}
|
|
53
|
-
export
|
|
53
|
+
export type ProxyType<T = unknown> = T & {
|
|
54
54
|
__revoke__?: () => void;
|
|
55
55
|
__target__: T;
|
|
56
56
|
};
|
|
@@ -63,13 +63,13 @@ export interface CookieOptions {
|
|
|
63
63
|
sameSite: 'Lax' | 'None' | 'Strict' | '';
|
|
64
64
|
secure: boolean;
|
|
65
65
|
}
|
|
66
|
-
export
|
|
67
|
-
export
|
|
68
|
-
export
|
|
69
|
-
export
|
|
70
|
-
export
|
|
71
|
-
export
|
|
72
|
-
export
|
|
66
|
+
export type UnknownFunction = (...parameters: Array<unknown>) => unknown;
|
|
67
|
+
export type ArrayTransformer<T = unknown, R = unknown, P = unknown> = (data: Array<T>, ...additionalParameter: Array<P>) => Array<R>;
|
|
68
|
+
export type SynchronousProcedureFunction = (...parameters: Array<unknown>) => void;
|
|
69
|
+
export type AsynchronousProcedureFunction = (...parameters: Array<unknown>) => Promise<void>;
|
|
70
|
+
export type ProcedureFunction = AsynchronousProcedureFunction | SynchronousProcedureFunction;
|
|
71
|
+
export type GetterFunction = (keyOrValue: unknown, key: string | symbol, target: unknown) => unknown;
|
|
72
|
+
export type SetterFunction = (key: string | symbol, value: unknown, target: unknown) => unknown;
|
|
73
73
|
export interface CheckReachabilityOptions {
|
|
74
74
|
expectedIntermediateStatusCodes: Array<number> | number;
|
|
75
75
|
options: RequestInit;
|
|
@@ -86,7 +86,7 @@ export interface CompareOptions {
|
|
|
86
86
|
properties: Array<string> | null;
|
|
87
87
|
returnReasonIfNotEqual: boolean;
|
|
88
88
|
}
|
|
89
|
-
export
|
|
89
|
+
export type Encoding = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'ucs2' | 'ucs-2' | 'utf8' | 'utf16le' | 'utf-8';
|
|
90
90
|
export interface File {
|
|
91
91
|
directoryPath: string;
|
|
92
92
|
directoryEntry: DirectoryEntry | null;
|
|
@@ -99,27 +99,27 @@ export interface ProcessError extends Error {
|
|
|
99
99
|
parameters: Array<unknown>;
|
|
100
100
|
returnCode: number;
|
|
101
101
|
}
|
|
102
|
-
export
|
|
102
|
+
export type QueryParameters = Array<Array<string> | string> & Mapping<Array<string> | string>;
|
|
103
103
|
export interface TimeoutPromise extends Promise<boolean> {
|
|
104
104
|
clear: () => void;
|
|
105
105
|
timeoutID: NodeJS.Timeout;
|
|
106
106
|
}
|
|
107
|
-
export
|
|
107
|
+
export type Mapping<T = string> = {
|
|
108
108
|
[key: string]: T;
|
|
109
109
|
};
|
|
110
|
-
export
|
|
110
|
+
export type ObjectMask = boolean | {
|
|
111
111
|
[key: string]: boolean | ObjectMask;
|
|
112
112
|
};
|
|
113
113
|
export interface ObjectMaskConfiguration {
|
|
114
114
|
exclude?: ObjectMask;
|
|
115
115
|
include?: ObjectMask;
|
|
116
116
|
}
|
|
117
|
-
export
|
|
117
|
+
export type Evaluateable = {
|
|
118
118
|
__evaluate__: string;
|
|
119
119
|
} | {
|
|
120
120
|
__execute__: string;
|
|
121
121
|
};
|
|
122
|
-
export
|
|
122
|
+
export type RecursiveEvaluateable<Type> = Evaluateable | {
|
|
123
123
|
[Property in keyof Type]: (Evaluateable | (Type[Property] extends (infer OtherType)[] ? RecursiveEvaluateable<OtherType>[] : Type[Property] extends Mapping<unknown> ? RecursiveEvaluateable<Type[Property]> : Evaluateable | Type[Property]));
|
|
124
124
|
};
|
|
125
125
|
export interface PaginateOptions {
|
|
@@ -140,7 +140,7 @@ export interface Page {
|
|
|
140
140
|
selected: boolean;
|
|
141
141
|
type: PageType;
|
|
142
142
|
}
|
|
143
|
-
export
|
|
143
|
+
export type PageType = 'end-ellipsis' | 'first' | 'last' | 'next' | 'page' | 'previous' | 'start-ellipsis';
|
|
144
144
|
export interface Offset {
|
|
145
145
|
left: number;
|
|
146
146
|
top: number;
|
|
@@ -149,15 +149,15 @@ export interface Position extends Offset {
|
|
|
149
149
|
bottom: number;
|
|
150
150
|
right: number;
|
|
151
151
|
}
|
|
152
|
-
export
|
|
152
|
+
export type ProcessHandler = (returnCode: unknown, ...parameters: Array<unknown>) => void;
|
|
153
153
|
export interface ProcessCloseReason {
|
|
154
154
|
parameters: Array<unknown>;
|
|
155
155
|
reason: unknown;
|
|
156
156
|
}
|
|
157
|
-
export
|
|
158
|
-
export
|
|
159
|
-
export
|
|
160
|
-
export
|
|
157
|
+
export type ProcessCloseCallback = (reason: ProcessCloseReason) => void;
|
|
158
|
+
export type ProcessErrorCallback = (reason: ProcessError) => void;
|
|
159
|
+
export type RelativePosition = 'above' | 'below' | 'in' | 'left' | 'right';
|
|
160
|
+
export type TemplateFunction<Type = string> = (...parameters: Array<unknown>) => Type;
|
|
161
161
|
export interface CompilationResult<Type = string> {
|
|
162
162
|
error: null | string;
|
|
163
163
|
originalScopeNames: Array<string>;
|
|
@@ -171,14 +171,14 @@ export interface EvaluationResult<Type = string> {
|
|
|
171
171
|
result: Type;
|
|
172
172
|
runtimeError: null | string;
|
|
173
173
|
}
|
|
174
|
-
export
|
|
175
|
-
export
|
|
174
|
+
export type LockCallbackFunction<Type = string> = (description: string) => Promise<Type> | Type;
|
|
175
|
+
export type DomNodes<Type = string> = Mapping<Type> & {
|
|
176
176
|
hideJavaScriptEnabled: Type;
|
|
177
177
|
parent?: Type;
|
|
178
178
|
showJavaScriptEnabled: Type;
|
|
179
179
|
window?: Type;
|
|
180
180
|
};
|
|
181
|
-
export
|
|
181
|
+
export type $DomNodes<TElement = HTMLElement> = DomNodes<$T<TElement>>;
|
|
182
182
|
export interface Options<Type = string> {
|
|
183
183
|
domNodes: DomNodes<Type>;
|
|
184
184
|
domNodeSelectorInfix: null | string;
|
|
@@ -186,11 +186,11 @@ export interface Options<Type = string> {
|
|
|
186
186
|
logging: boolean;
|
|
187
187
|
name: string;
|
|
188
188
|
}
|
|
189
|
-
export
|
|
190
|
-
export
|
|
189
|
+
export type $TStatic = JQueryStatic;
|
|
190
|
+
export type $T<TElement = HTMLElement> = JQuery<TElement>;
|
|
191
191
|
export interface $Global extends Window {
|
|
192
192
|
Babel?: {
|
|
193
|
-
transform: (
|
|
193
|
+
transform: (code: string, configuration: PlainObject) => {
|
|
194
194
|
code: string;
|
|
195
195
|
};
|
|
196
196
|
};
|
|
@@ -200,15 +200,15 @@ export interface $Global extends Window {
|
|
|
200
200
|
}
|
|
201
201
|
export interface ToolsFunction<TElement = HTMLElement> {
|
|
202
202
|
class: typeof Tools;
|
|
203
|
-
(...
|
|
203
|
+
(...parameters: Array<unknown>): Tools<TElement>;
|
|
204
204
|
}
|
|
205
205
|
export interface BoundToolsFunction<TElement = HTMLElement> {
|
|
206
|
-
(
|
|
207
|
-
(
|
|
208
|
-
(
|
|
209
|
-
(
|
|
210
|
-
(
|
|
211
|
-
(...
|
|
206
|
+
(methodName: 'normalizedClassNames'): BoundTools<TElement>;
|
|
207
|
+
(methodName: 'normalizedStyles'): BoundTools<TElement>;
|
|
208
|
+
(methodName: 'removeDirective', directiveName: string): $T<TElement>;
|
|
209
|
+
(methodName: 'style'): Mapping<number | string>;
|
|
210
|
+
(methodName: 'text'): string;
|
|
211
|
+
(...parameters: Array<unknown>): BoundTools<TElement>;
|
|
212
212
|
}
|
|
213
213
|
declare global {
|
|
214
214
|
interface JQuery<TElement = HTMLElement> {
|