clientnode 3.0.834 → 3.0.838

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/type.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  /// <reference types="node" />
2
- import { Stats } from 'fs';
2
+ import { Dirent as DirectoryEntry, Stats as FileStats } from 'fs';
3
3
  import Tools from './index';
4
4
  import { DefinedSymbol, ThrowSymbol, UndefinedSymbol } from './testHelper';
5
- export declare type AnyFunction = (...parameters: Array<any>) => any;
5
+ export declare type AnyFunction = (..._parameters: Array<any>) => any;
6
6
  export declare type FirstParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[0];
7
7
  export declare type SecondParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[1];
8
- export declare type ParametersExceptFirst<FunctionType> = FunctionType extends (parameter: any, ...additionalParameters: infer AdditionalParameters) => any ? AdditionalParameters : [
8
+ export declare type ThirdParameter<FunctionType extends AnyFunction> = Parameters<FunctionType>[2];
9
+ export declare type ParametersExceptFirst<FunctionType> = FunctionType extends (_parameter: any, ..._additionalParameters: infer AdditionalParameters) => any ? AdditionalParameters : [
9
10
  ];
10
11
  export declare type FunctionTestTuple<FunctionType extends AnyFunction> = [
11
12
  ReturnType<FunctionType>,
@@ -15,43 +16,41 @@ export declare type FunctionTestPromiseTuple<FunctionType extends AnyFunction> =
15
16
  ThenParameter<ReturnType<FunctionType>>,
16
17
  ...Parameters<FunctionType>
17
18
  ];
18
- export declare type FunctionTestPromiseRejectionTuple<FunctionType extends AnyFunction> = [
19
- Error,
20
- ...Parameters<FunctionType>
21
- ];
22
- export declare type BaseSelector<T = unknown, E = unknown> = number | string | ((target: T) => E);
19
+ export declare type FunctionTestPromiseRejectionTuple<FunctionType extends AnyFunction> = [Error, ...Parameters<FunctionType>];
20
+ export declare type BaseSelector<T = unknown, E = unknown> = number | string | ((_target: T) => E);
23
21
  export declare type Selector<T = unknown, E = unknown> = Array<BaseSelector<T, E>> | BaseSelector<T, E>;
24
22
  export declare type TestSymbol = typeof DefinedSymbol | typeof ThrowSymbol | typeof UndefinedSymbol;
25
23
  export declare type ThenParameter<Type> = Type extends PromiseLike<infer U> ? U : Type;
26
24
  export declare type ThenParameterRecursive<Type> = Type extends PromiseLike<infer U> ? ThenParameterRecursive<U> : Type;
27
25
  export declare type ValueOf<Type> = Type[keyof Type];
28
26
  export declare type RecursiveNonNullable<Type> = {
29
- [Property in keyof Type]: Type[Property] extends (infer OtherType)[] ? RecursiveNonNullable<OtherType>[] : Type[Property] extends Function ? NonNullable<Type[Property]> : Type[Property] extends object ? RecursiveNonNullable<Type[Property]> : NonNullable<Type[Property]>;
27
+ [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]>;
30
28
  };
31
29
  export declare type RecursivePartial<Type> = Partial<Type> | {
32
- [Property in keyof Type]?: Type[Property] extends (infer OtherType)[] ? RecursivePartial<OtherType>[] : Type[Property] extends Function ? Partial<Type[Property]> : Type[Property] extends object ? RecursivePartial<Type[Property]> : Partial<Type[Property]>;
30
+ [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]>;
33
31
  };
32
+ export declare type ImportFunction = (_id: string) => Promise<ReturnType<typeof require>>;
34
33
  export declare type HTMLItem = Comment | Document | HTMLElement | Text;
35
34
  export declare type Primitive = boolean | null | number | string | undefined;
36
35
  export declare type PlainObject<Type = Primitive> = {
37
36
  [key: string]: Array<PlainObject<Type> | Type> | PlainObject<Type> | Type;
38
37
  };
39
38
  export interface ProxyHandler<T = unknown> {
40
- deleteProperty: (target: T, key: any) => boolean;
41
- get: (target: T, key: string) => unknown;
42
- has: (target: T, key: string) => boolean;
43
- set: (target: T, key: string, value: unknown) => boolean;
39
+ deleteProperty: (_target: T, _key: string | symbol) => boolean;
40
+ get: (_target: T, _key: string | symbol) => unknown;
41
+ has: (_target: T, _key: string | symbol) => boolean;
42
+ set: (_target: T, _key: string | symbol, _value: unknown) => boolean;
44
43
  }
45
44
  export declare type ProxyType<T = unknown> = T & {
46
45
  __revoke__?: AnyFunction;
47
46
  __target__: T;
48
47
  };
49
- export declare type GenericFunction = (...parameter: Array<unknown>) => unknown;
50
- export declare type SynchronousProcedureFunction = (...parameter: Array<unknown>) => void;
51
- export declare type AsynchronousProcedureFunction = (...parameter: Array<unknown>) => Promise<void>;
48
+ export declare type GenericFunction = (..._parameters: Array<unknown>) => unknown;
49
+ export declare type SynchronousProcedureFunction = (..._parameters: Array<unknown>) => void;
50
+ export declare type AsynchronousProcedureFunction = (..._parameters: Array<unknown>) => Promise<void>;
52
51
  export declare type ProcedureFunction = AsynchronousProcedureFunction | SynchronousProcedureFunction;
53
- export declare type GetterFunction = (keyOrValue: any, key: any, target: any) => any;
54
- export declare type SetterFunction = (key: any, value: any, target: any) => any;
52
+ export declare type GetterFunction = (_keyOrValue: unknown, _key: string | symbol, _target: unknown) => unknown;
53
+ export declare type SetterFunction = (_key: string | symbol, _value: unknown, _target: unknown) => unknown;
55
54
  export interface CheckReachabilityOptions {
56
55
  expectedIntermediateStatusCodes: Array<number> | number;
57
56
  options: RequestInit;
@@ -65,25 +64,23 @@ export interface CompareOptions {
65
64
  deep: number;
66
65
  exceptionPrefixes: Array<string>;
67
66
  ignoreFunctions: boolean;
68
- properties: Array<any> | null;
67
+ properties: Array<string> | null;
69
68
  returnReasonIfNotEqual: boolean;
70
69
  }
71
70
  export declare type Encoding = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'ucs2' | 'ucs-2' | 'utf8' | 'utf16le' | 'utf-8';
72
71
  export interface File {
73
72
  directoryPath: string;
73
+ directoryEntry: DirectoryEntry | null;
74
74
  error: Error | null;
75
75
  name: string;
76
76
  path: string;
77
- stats: Stats | null;
77
+ stats: FileStats | null;
78
78
  }
79
79
  export interface ProcessError extends Error {
80
80
  parameters: Array<unknown>;
81
81
  returnCode: number;
82
82
  }
83
83
  export declare type QueryParameters = Array<Array<string> | string> & Mapping<Array<string> | string>;
84
- export interface Scope<TElement = HTMLElement> extends Iterable<TElement> {
85
- Tools: ToolsFunction<TElement>;
86
- }
87
84
  export interface TimeoutPromise extends Promise<boolean> {
88
85
  clear: () => void;
89
86
  timeoutID: NodeJS.Timeout;
@@ -104,7 +101,7 @@ export declare type Evaluateable = {
104
101
  __execute__: string;
105
102
  };
106
103
  export declare type RecursiveEvaluateable<Type> = Evaluateable | {
107
- [Property in keyof Type]: Evaluateable | (Type[Property] extends (infer OtherType)[] ? RecursiveEvaluateable<OtherType>[] : Type[Property] extends object ? RecursiveEvaluateable<Type[Property]> : Evaluateable | Type[Property]);
104
+ [Property in keyof Type]: (Evaluateable | (Type[Property] extends (infer OtherType)[] ? RecursiveEvaluateable<OtherType>[] : Type[Property] extends Mapping<unknown> ? RecursiveEvaluateable<Type[Property]> : Evaluateable | Type[Property]));
108
105
  };
109
106
  export interface PaginateOptions {
110
107
  boundaryCount: number;
@@ -133,36 +130,36 @@ export interface Position extends Offset {
133
130
  bottom: number;
134
131
  right: number;
135
132
  }
136
- export declare type ProcessHandler = (returnCode: any, ...parameter: Array<any>) => void;
133
+ export declare type ProcessHandler = (_returnCode: unknown, ..._parameters: Array<unknown>) => void;
137
134
  export interface ProcessCloseReason {
138
135
  parameters: Array<unknown>;
139
136
  reason: unknown;
140
137
  }
141
- export declare type ProcessCloseCallback = (reason: ProcessCloseReason) => void;
142
- export declare type ProcessErrorCallback = (reason: ProcessError) => void;
138
+ export declare type ProcessCloseCallback = (_reason: ProcessCloseReason) => void;
139
+ export declare type ProcessErrorCallback = (_reason: ProcessError) => void;
143
140
  export declare type RelativePosition = 'above' | 'below' | 'in' | 'left' | 'right';
144
- export declare type TemplateFunction = (...parameter: Array<any>) => any;
145
- export interface CompilationResult {
141
+ export declare type TemplateFunction<Type = string> = (..._parameters: Array<unknown>) => Type;
142
+ export interface CompilationResult<Type = string> {
146
143
  error: null | string;
147
144
  originalScopeNames: Array<string>;
148
145
  scopeNameMapping: Mapping<string>;
149
146
  scopeNames: Array<string>;
150
- templateFunction: TemplateFunction;
147
+ templateFunction: TemplateFunction<Type>;
151
148
  }
152
- export interface EvaluationResult {
149
+ export interface EvaluationResult<Type = string> {
153
150
  compileError: null | string;
154
151
  error: null | string;
155
- result: any;
152
+ result: Type;
156
153
  runtimeError: null | string;
157
154
  }
158
- export declare type LockCallbackFunction<Type = string> = (description: string) => Promise<Type> | Type;
155
+ export declare type LockCallbackFunction<Type = string> = (_description: string) => Promise<Type> | Type;
159
156
  export declare type DomNodes<Type = string> = Mapping<Type> & {
160
157
  hideJavaScriptEnabled: Type;
161
158
  parent?: Type;
162
159
  showJavaScriptEnabled: Type;
163
160
  window?: Type;
164
161
  };
165
- export declare type $DomNode<TElement = HTMLElement> = JQuery<TElement>;
162
+ export declare type $DomNode<TElement = HTMLElement> = $T<TElement>;
166
163
  export declare type $DomNodes = DomNodes<$DomNode>;
167
164
  export interface Options<Type = string> {
168
165
  domNodes: DomNodes<Type>;
@@ -170,31 +167,36 @@ export interface Options<Type = string> {
170
167
  logging: boolean;
171
168
  name: string;
172
169
  }
173
- export declare type $Function = JQueryStatic & StaticScope;
170
+ export declare type $TStatic = JQueryStatic;
171
+ export declare type $T<TElement = HTMLElement> = JQuery<TElement>;
174
172
  export interface $Global extends Window {
175
173
  Babel?: {
176
- transform: (code: string, configuration: PlainObject) => {
174
+ transform: (_code: string, _configuration: PlainObject) => {
177
175
  code: string;
178
176
  };
179
177
  };
180
178
  console: Console;
181
179
  dataLayer: Array<PlainObject>;
182
- $: $Function;
180
+ $: $TStatic;
183
181
  }
184
182
  export interface ToolsFunction<TElement = HTMLElement, LockType = string> {
185
- (...parameter: Array<any>): any | Tools<TElement, LockType>;
183
+ (..._parameters: Array<unknown>): any | Tools<TElement, LockType>;
186
184
  class: typeof Tools;
187
185
  }
188
186
  export interface StaticScope {
189
- (parameter: any, ...additionalArguments: Array<any>): any;
190
187
  document?: Document;
191
188
  global: $Global;
192
189
  location?: Location;
193
190
  Tools: ToolsFunction;
194
191
  }
195
192
  declare global {
196
- interface JQuery<TElement = HTMLElement> extends Scope<TElement> {
193
+ interface JQuery<TElement = HTMLElement> {
194
+ Tools: ToolsFunction<TElement>;
197
195
  }
198
- interface JQueryStatic extends StaticScope {
196
+ interface JQueryStatic {
197
+ document?: Document;
198
+ global: $Global;
199
+ location?: Location;
200
+ Tools: ToolsFunction;
199
201
  }
200
202
  }