@e-mc/types 0.9.7 → 0.10.0

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/lib/logger.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" |
12
12
  sessionId?: string;
13
13
  abortable?: boolean;
14
14
  titleJustify?: TextAlign;
15
+ rawOutput?: boolean;
15
16
  broadcastId?: BroadcastValue;
16
17
  newline?: boolean | number;
17
18
  }
@@ -52,6 +53,7 @@ export interface LogMessageOptions extends LogBaseOptions {
52
53
  messageUnit?: string;
53
54
  messageUnitMinWidth?: number;
54
55
  messageUnitIndent?: number | [number, string];
56
+ messageTextWrap?: boolean | TextWrapStyle;
55
57
  progressBar?: boolean;
56
58
  alwaysVisible?: boolean;
57
59
  titleIndent?: boolean | number;
@@ -106,6 +108,7 @@ export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value"
106
108
  export type BackgroundColor = typeof IBackgroundColor | HexColor;
107
109
  export type ForegroundColor = typeof IForegroundColor | HexColor;
108
110
  export type TextAlign = "left" | "center" | "right";
111
+ export type TextWrapStyle = "ellipsis" | "nowrap" | "ellipsis-end" | "nowrap-end" | "none";
109
112
  export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
110
113
  export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
111
114
  export type BroadcastValue = ArrayOf<string> | { value: ArrayOf<string>; stripAnsi?: boolean };
package/lib/module.d.ts CHANGED
@@ -3,8 +3,9 @@ import type { ChecksumBase } from './squared';
3
3
  import type { StreamAction } from './asset';
4
4
 
5
5
  import type { HashOptions } from 'crypto';
6
+ import type { Readable } from 'stream';
6
7
 
7
- declare enum NORMALIZE_FLAGS {
8
+ export const enum NORMALIZE_FLAGS {
8
9
  NONE = 0,
9
10
  RESOLVE = 1,
10
11
  ENSURE_DIR = 2,
@@ -15,16 +16,29 @@ export interface RequireAction {
15
16
  requireExt?: ArrayOf<string> | boolean;
16
17
  }
17
18
 
19
+ export interface ThrowsAction {
20
+ throwsPermission?: boolean;
21
+ throwsDoesNotExist?: boolean;
22
+ }
23
+
24
+ export interface ExecAction {
25
+ uid?: number | string;
26
+ gid?: number | string;
27
+ }
28
+
29
+ export interface IncludeAction<T = string[]> {
30
+ include?: T;
31
+ exclude?: T;
32
+ }
33
+
18
34
  export interface PermissionOptions {
19
35
  ownPermissionOnly?: boolean;
20
36
  hostPermissionOnly?: boolean;
21
37
  }
22
38
 
23
- export interface FileSystemOptions extends PermissionOptions {
39
+ export interface FileSystemOptions extends PermissionOptions, ThrowsAction {
24
40
  absolutePath?: boolean;
25
41
  ignorePermission?: boolean;
26
- throwsPermission?: boolean;
27
- throwsDoesNotExist?: boolean;
28
42
  }
29
43
 
30
44
  export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction {
@@ -55,10 +69,6 @@ export interface RemoveDirOptions extends FileSystemOptions {
55
69
  export type MoveFileOptions = CopyFileOptions;
56
70
  export type CreateDirOptions = FileSystemOptions;
57
71
 
58
- export interface GetFunctionsOptions extends ParseFunctionOptions {
59
- outFailed?: string[];
60
- }
61
-
62
72
  export interface ParseFunctionOptions extends RequireAction {
63
73
  absolute?: boolean;
64
74
  sync?: boolean;
@@ -66,19 +76,6 @@ export interface ParseFunctionOptions extends RequireAction {
66
76
  context?: unknown;
67
77
  }
68
78
 
69
- export interface CloneObjectOptions<T = unknown> {
70
- target?: T;
71
- deep?: boolean;
72
- deepIgnore?: WeakSet<object>;
73
- typedArray?: boolean;
74
- mergeArray?: MergeArrayMethod;
75
- mergeDepth?: number;
76
- symbol?: boolean;
77
- inherited?: boolean;
78
- nonenumerable?: boolean;
79
- preserve?: boolean;
80
- }
81
-
82
79
  export interface CheckSemVerOptions extends MinMax {
83
80
  startDir?: string;
84
81
  unstable: boolean;
@@ -114,12 +111,9 @@ export interface ReadBufferOptions extends StreamBase {
114
111
  cache?: boolean;
115
112
  }
116
113
 
117
- export interface AsHashOptions extends HashOptions, ChecksumBase {
118
- /** @deprecated */
119
- minLength?: number;
120
- }
114
+ export interface AsHashOptions extends HashOptions, ChecksumBase {}
121
115
 
122
- export interface GetTempDirOptions {
116
+ export interface TempDirOptions {
123
117
  pathname?: string;
124
118
  filename?: string;
125
119
  moduleDir?: boolean;
@@ -128,18 +122,7 @@ export interface GetTempDirOptions {
128
122
  increment?: number;
129
123
  }
130
124
 
131
- export interface ExecAction {
132
- uid?: NumString;
133
- gid?: NumString;
134
- }
135
-
136
- export interface IncludeAction<T = string[]> {
137
- include?: T;
138
- exclude?: T;
139
- }
140
-
141
- export type NormalizeFlags = typeof NORMALIZE_FLAGS[keyof typeof NORMALIZE_FLAGS];
142
125
  export type ReadTextOptions = ReadBufferOptions;
143
126
  export type ReadFileCallback<T extends Bufferable = Bufferable> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
144
127
  export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc" | "file";
145
- export type MergeArrayMethod = "concat" | "concat-pre" | "includes" | "unshift" | "push" | "flat" | "join" | "slice" | "reverse" | ["flat", number] | ["join", string] | ["slice", number, number?];
128
+ export type FileTypeFormat = Bufferable | Uint8Array | ArrayBuffer | Readable;
package/lib/node.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { RequestData as IRequestData } from './squared';
2
2
 
3
3
  import type { ExternalAsset } from './asset';
4
- import type { HostInitConfig } from './core';
4
+ import type { HostInitConfig, HostInitLog } from './core';
5
5
  import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
6
6
 
7
- export interface RequestData<T extends ExternalAsset = ExternalAsset> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig> {
7
+ export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig<U>> {
8
8
  readonly assets?: T[];
9
9
  }
10
10
 
package/lib/object.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint @typescript-eslint/no-redeclare: "off" */
2
-
3
1
  interface Point {
4
2
  x: number;
5
3
  y: number;
package/lib/request.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { BinaryAction } from './asset';
2
2
  import type { HttpProtocolVersion, InternetProtocolVersion } from './http';
3
+ import type { HttpHostSettings } from './settings';
3
4
 
4
5
  import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
5
6
  import type { Readable, Writable } from 'stream';
@@ -39,14 +40,16 @@ export interface IHttpHost {
39
40
  get hostname(): string;
40
41
  get port(): string;
41
42
  get origin(): string;
43
+ get streamSize(): number;
42
44
  }
43
45
 
44
46
  export interface HttpHostConstructor {
45
47
  normalizeOrigin(value: string): string;
46
48
  formatBasicAuth(url: URL): string;
47
49
  getBasicAuth(url: URL): Undef<OutgoingHttpHeaders>;
48
- defineLocalHost(value: string[]): void;
49
- defineProtocolNegotiation(value: ObjectMap<string[]>): void;
50
+ defineLocalHost(values: string[]): void;
51
+ defineProtocolNegotiation(data: ObjectMap<string[]>): void;
52
+ defineHostConfig(settings: HttpHostSettings): void;
50
53
  readonly prototype: IHttpHost;
51
54
  new(url: URL, httpVersion?: HttpProtocolVersion): IHttpHost;
52
55
  }
@@ -54,13 +57,14 @@ export interface HttpHostConstructor {
54
57
  export interface OpenOptions extends KeepAliveAction, SilentAction {
55
58
  host?: IHttpHost;
56
59
  url?: URL;
60
+ base?: boolean;
57
61
  socketPath?: string;
58
62
  httpVersion?: HttpProtocolVersion;
59
63
  method?: "GET" | "POST" | "HEAD";
60
64
  search?: StringMap;
61
65
  follow_redirect?: boolean;
62
66
  encoding?: BufferEncoding;
63
- maxBufferSize?: NumString;
67
+ maxBufferSize?: number | string;
64
68
  format?: BufferFormat | { out?: BufferFormat; parser?: PlainObject };
65
69
  headers?: OutgoingHttpHeaders;
66
70
  timeout?: number;
@@ -68,7 +72,7 @@ export interface OpenOptions extends KeepAliveAction, SilentAction {
68
72
  postData?: unknown;
69
73
  connected?: (headers: IncomingHttpHeaders) => Void<boolean>;
70
74
  statusMessage?: string;
71
- progressId?: NumString;
75
+ progressId?: number | string;
72
76
  outFormat?: { out: BufferFormat; parser?: PlainObject };
73
77
  outFilename?: Null<string>;
74
78
  outHeaders?: Null<IncomingHttpHeaders>;
package/lib/settings.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { CloudSource } from './cloud';
5
5
  import type { PermissionAction, PermissionReadWrite, PermittedDirectories } from './core';
6
6
  import type { DbSource, TimeoutAction } from './db';
7
7
  import type { HttpOutgoingHeaders, SecureConfig, ServerPort } from './http';
8
- import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign } from './logger';
8
+ import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign, TextWrapStyle } from './logger';
9
9
  import type { ExecAction, IncludeAction } from './module';
10
10
 
11
11
  import type { SpawnOptions } from 'child_process';
@@ -13,6 +13,7 @@ import type { BinaryLike, CipherGCMTypes } from 'crypto';
13
13
  import type { LookupAddress } from 'dns';
14
14
  import type { BrotliOptions, ZlibOptions } from 'zlib';
15
15
 
16
+ import type { BackgroundColor as IBackgroundColor } from 'chalk';
16
17
  // @ts-ignore
17
18
  import type { Unit } from 'bytes';
18
19
  // @ts-ignore
@@ -59,13 +60,13 @@ export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
59
60
  private?: boolean;
60
61
  };
61
62
  queue?: {
62
- limit?: NumString;
63
- expires?: NumString;
64
- priority: { bypass?: NumString } & MinMax<NumString>;
63
+ limit?: number | string;
64
+ expires?: number | string;
65
+ priority: { bypass?: number | string } & MinMax<number | string>;
65
66
  };
66
- limit?: NumString;
67
- sub_limit?: NumString;
68
- expires?: NumString;
67
+ limit?: number | string;
68
+ sub_limit?: number | string;
69
+ expires?: number | string;
69
70
  };
70
71
  cipher?: CipherConfig;
71
72
  password?: string;
@@ -77,6 +78,7 @@ export interface ProcessEnvConfig {
77
78
 
78
79
  export interface TempModule<T = PlainObject> extends HandlerSettings<T> {
79
80
  dir?: string;
81
+ env?: string;
80
82
  write?: boolean;
81
83
  }
82
84
 
@@ -92,19 +94,20 @@ export interface PermissionSettings extends PlainObject {
92
94
  }
93
95
 
94
96
  export interface DownloadModule<T = PlainObject> extends HandlerSettings<T> {
95
- expires?: NumString;
97
+ expires?: number | string;
96
98
  aria2?: {
97
99
  bin?: string | false;
98
100
  exec?: ExecAction;
99
- update_status?: NumString | { interval?: NumString; broadcast_only?: boolean };
100
- max_concurrent_downloads?: NumString;
101
- max_connection_per_server?: NumString;
102
- bt_stop_timeout?: NumString;
103
- bt_tracker_connect_timeout?: NumString;
104
- bt_tracker_timeout?: NumString;
101
+ check_integrity?: boolean;
102
+ update_status?: number | string | { interval?: number | string; broadcast_only?: boolean };
103
+ max_concurrent_downloads?: number | string;
104
+ max_connection_per_server?: number | string;
105
+ bt_stop_timeout?: number | string;
106
+ bt_tracker_connect_timeout?: number | string;
107
+ bt_tracker_timeout?: number | string;
105
108
  min_split_size?: string;
106
- disk_cache?: NumString;
107
- lowest_speed_limit?: NumString;
109
+ disk_cache?: number | string;
110
+ lowest_speed_limit?: number | string;
108
111
  always_resume?: boolean;
109
112
  file_allocation?: "none" | "prealloc" | "trunc" | "falloc";
110
113
  conf_path?: string;
@@ -144,13 +147,13 @@ export interface DocumentComponentOption<T = unknown> {
144
147
  cache?: T;
145
148
  coerce?: boolean;
146
149
  abort?: boolean;
147
- local_file?: NumString;
150
+ local_file?: number | string;
148
151
  }
149
152
 
150
- export interface DocumentSettings extends DocumentGroup, PurgeAction, ClientSettings<DocumentUserSettings>, PlainObject {
151
- imports_strict?: boolean;
153
+ export interface DocumentSettings<T extends DocumentUserSettings = DocumentUserSettings> extends DocumentGroup, PurgeAction, ClientSettings<T>, PlainObject {
152
154
  directory?: DocumentDirectory;
153
155
  options?: DocumentComponentOptions;
156
+ imports_strict?: boolean;
154
157
  }
155
158
 
156
159
  export interface DocumentDirectory extends StringMap {
@@ -172,7 +175,7 @@ export interface MemorySettings extends PlainObject {
172
175
  cache_disk?: MemoryCacheDiskSettings;
173
176
  }
174
177
 
175
- export interface MemoryCacheDiskSettings<T = NumString> extends IncludeAction<Null<string[]>> {
178
+ export interface MemoryCacheDiskSettings<T = number | string> extends IncludeAction<Null<string[]>> {
176
179
  enabled?: boolean;
177
180
  min_size?: T;
178
181
  max_size?: T;
@@ -189,12 +192,12 @@ export interface DbUserSettings extends DbSourceDataType<{ commands?: ObjectMap<
189
192
 
190
193
  export interface DbCacheSettings extends TimeoutAction {
191
194
  dir?: string;
192
- purge?: NumString;
195
+ purge?: number | string;
193
196
  when_empty?: boolean;
194
197
  }
195
198
 
196
199
  export interface DbSourceOptions {
197
- pool?: PoolConfig<NumString>;
200
+ pool?: PoolConfig<number | string>;
198
201
  cache?: DbCacheValue;
199
202
  coerce?: DbCoerceValue;
200
203
  }
@@ -204,20 +207,20 @@ export interface DbCoerceSettings<T = boolean> {
204
207
  options?: T;
205
208
  }
206
209
 
207
- export interface PurgeBase<T = NumString> extends MinMax {
210
+ export interface PurgeBase<T = number | string> extends MinMax {
208
211
  enabled?: boolean;
209
212
  percent?: T;
210
213
  limit?: number;
211
214
  }
212
215
 
213
216
  export interface PurgeComponent extends PurgeBase {
214
- interval?: NumString;
217
+ interval?: number | string;
215
218
  all?: boolean | number;
216
219
  log?: boolean;
217
220
  prefix?: string;
218
221
  }
219
222
 
220
- export type DbCacheValue = NumString | DbCacheSettings;
223
+ export type DbCacheValue = number | string | DbCacheSettings;
221
224
  export type DbCoerceValue = boolean | DbCoerceSettings;
222
225
  export type DbSourceDataType<T = unknown> = {
223
226
  [K in DbSource]?: T;
@@ -234,35 +237,39 @@ export interface ImageSettings extends PlainObject {
234
237
  };
235
238
  }
236
239
 
237
- export interface RequestModule<T = RequestSettings> extends HandlerSettings<T> {
238
- timeout?: NumString;
239
- read_timeout?: NumString;
240
+ export interface RequestModule<T = RequestSettings> extends HandlerSettings<T>, HttpHostSettings {
241
+ timeout?: number | string;
242
+ read_timeout?: number | string;
240
243
  agent?: {
241
244
  keep_alive?: boolean;
242
- timeout?: NumString;
245
+ timeout?: number | string;
243
246
  };
244
247
  disk?: HttpDiskSettings;
245
248
  buffer?: HttpMemorySettings;
246
249
  connect?: HttpConnectSettings;
247
250
  dns?: DnsLookupSettings;
248
251
  use?: {
249
- http_version?: NumString;
252
+ http_version?: number | string;
250
253
  accept_encoding?: boolean;
251
254
  };
252
255
  proxy?: AuthValue & IncludeAction & {
253
256
  address?: string;
254
- port?: NumString;
257
+ port?: number | string;
255
258
  keep_alive?: boolean;
256
259
  };
257
260
  headers?: HttpOutgoingHeaders;
258
261
  certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
262
+ post_limit?: number | string;
263
+ }
264
+
265
+ export interface HttpHostSettings {
259
266
  localhost?: string[];
260
267
  protocol?: {
261
268
  "http/1.1"?: string[];
262
269
  h2c?: string[];
263
270
  h2?: string[];
264
271
  };
265
- post_limit?: NumString;
272
+ write_stream?: ObjectMap<number | string>;
266
273
  }
267
274
 
268
275
  export interface RequestSettings extends PurgeAction, PlainObject {
@@ -270,7 +277,7 @@ export interface RequestSettings extends PurgeAction, PlainObject {
270
277
  }
271
278
 
272
279
  export interface WatchModule<T = WatchSettings> extends HandlerModule<T>, ServerInfo {
273
- interval?: NumString;
280
+ interval?: number | string;
274
281
  }
275
282
 
276
283
  export interface WatchSettings<T = WatchUserSettings> extends ClientSettings<ObjectMap<T>>, PlainObject {}
@@ -279,19 +286,15 @@ export interface CompressModule<U = CompressSettings> extends HandlerSettings<U>
279
286
  gzip?: ZlibOptions;
280
287
  brotli?: BrotliOptions;
281
288
  zopfli?: ZopfliOptions;
282
- tinify?: {
283
- api_key?: string;
284
- proxy?: string;
285
- };
286
289
  }
287
290
 
288
291
  export interface CompressSettings extends PlainObject {
289
292
  cache?: boolean;
290
- cache_expires?: NumString;
291
- gzip_level?: NumString;
292
- brotli_quality?: NumString;
293
- zopfli_iterations?: NumString;
294
- chunk_size?: NumString;
293
+ cache_expires?: number | string;
294
+ gzip_level?: number | string;
295
+ brotli_quality?: number | string;
296
+ zopfli_iterations?: number | string;
297
+ chunk_size?: number | string;
295
298
  }
296
299
 
297
300
  export interface TaskModule<T = PlainObject> extends ClientModule<T>, PlainObject {}
@@ -319,14 +322,24 @@ export interface ErrorModule extends HandlerModule {
319
322
  out?: string | ErrorOutMethod;
320
323
  abort?: string[];
321
324
  fatal?: boolean;
322
- recursion_limit?: NumString;
325
+ recursion_limit?: number | string;
323
326
  }
324
327
 
325
- export interface LoggerModule<T = NumString, U = boolean | T, V = LoggerFormat<T>> {
328
+ export interface LoggerProgress extends LoggerFormatColor {
329
+ scroll_buffer?: number | string;
330
+ max_width?: number | string;
331
+ use_color?: boolean;
332
+ text_wrap?: TextWrapStyle;
333
+ box_char?: string;
334
+ raw_mode?: boolean;
335
+ }
336
+
337
+ export interface LoggerModule<T = number | string, U = boolean | T, V = LoggerFormat<T>> {
326
338
  enabled?: boolean;
327
- level?: NumString;
339
+ level?: number | string;
328
340
  production?: string[];
329
341
  format?: LoggerFormatSettings<V>;
342
+ progress?: LoggerProgress;
330
343
  meter?: LoggerMeterSettings<T>;
331
344
  broadcast?: BroadcastServer & { color?: boolean };
332
345
  status?: boolean | LoggerStatus;
@@ -359,9 +372,10 @@ export interface LoggerFormatSettings<T = PlainObject> {
359
372
  session_id?: T;
360
373
  message?: T;
361
374
  meter?: T;
375
+ error?: T;
362
376
  }
363
377
 
364
- export interface LoggerMeterSettings<T = NumString> {
378
+ export interface LoggerMeterSettings<T = number | string> {
365
379
  http?: T;
366
380
  image?: T;
367
381
  compress?: T;
@@ -371,52 +385,58 @@ export interface LoggerMeterSettings<T = NumString> {
371
385
  export interface LoggerProcessSettings extends LoggerColor {
372
386
  cpu?: boolean;
373
387
  cpu_bar?: boolean | ArrayOf<number>;
388
+ cpu_bar_color?: [typeof IBackgroundColor, typeof IBackgroundColor, typeof IBackgroundColor];
374
389
  cpu_single_core?: boolean;
375
390
  mem?: boolean;
376
391
  mem_format?: "%" | Unit;
377
392
  }
378
393
 
379
- export interface LoggerFormat<T = NumString> {
380
- width?: T;
394
+ export interface LoggerFormatColor {
381
395
  color?: ForegroundColor;
382
396
  bg_color?: BackgroundColor;
397
+ }
398
+
399
+ export interface LoggerFormat<T = number | string> extends LoggerFormatColor {
400
+ width?: T;
401
+ alt_color?: ForegroundColor;
383
402
  bg_alt_color?: BackgroundColor;
384
403
  bold?: boolean;
385
404
  justify?: TextAlign;
386
405
  unit?: string;
387
406
  as?: StringMap;
407
+ braces?: string | TupleOf<string>;
388
408
  }
389
409
 
390
410
  export interface HttpSettings {
391
- version?: NumString;
392
- timeout?: NumString;
411
+ version?: number | string;
412
+ timeout?: number | string;
393
413
  headers?: HttpOutgoingHeaders;
394
414
  certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
395
415
  }
396
416
 
397
417
  export interface HttpDiskSettings extends IncludeAction {
398
418
  enabled?: boolean;
399
- limit?: NumString;
400
- expires?: NumString;
419
+ limit?: number | string;
420
+ expires?: number | string;
401
421
  }
402
422
 
403
423
  export interface HttpMemorySettings extends HttpDiskSettings {
404
- limit_all?: NumString;
405
- to_disk?: NumString | [NumString, NumString?];
406
- purge_amount?: NumString;
424
+ limit_all?: number | string;
425
+ to_disk?: number | string | [number | string, (number | string)?];
426
+ purge_amount?: number | string;
407
427
  }
408
428
 
409
429
  export interface HttpConnectSettings {
410
- timeout?: NumString;
411
- retry_wait?: NumString;
412
- retry_after?: NumString;
413
- retry_limit?: NumString;
414
- redirect_limit?: NumString;
430
+ timeout?: number | string;
431
+ retry_wait?: number | string;
432
+ retry_after?: number | string;
433
+ retry_limit?: number | string;
434
+ redirect_limit?: number | string;
415
435
  }
416
436
 
417
437
  export interface DnsLookupSettings {
418
- family?: NumString;
419
- expires?: NumString;
438
+ family?: number | string;
439
+ expires?: number | string;
420
440
  resolve?: ObjectMap<Partial<LookupAddress>>;
421
441
  }
422
442
 
@@ -424,12 +444,12 @@ export interface HashConfig extends IncludeAction<ObjectMap<string[] | "*">> {
424
444
  enabled?: boolean;
425
445
  algorithm?: HashAlgorithm;
426
446
  etag?: boolean;
427
- expires?: NumString;
447
+ expires?: number | string;
428
448
  renew?: boolean;
429
- limit?: NumString;
449
+ limit?: number | string;
430
450
  }
431
451
 
432
- export interface BroadcastServer extends ServerInfo<ArrayOf<NumString>> {
452
+ export interface BroadcastServer extends ServerInfo<ArrayOf<number | string>> {
433
453
  out?: string | BroadcastOutMethod;
434
454
  }
435
455
 
@@ -457,7 +477,7 @@ export interface CipherConfig {
457
477
  iv?: BinaryLike;
458
478
  }
459
479
 
460
- export interface ServerInfo<T = NumString> extends ServerPort<T> {
480
+ export interface ServerInfo<T = number | string> extends ServerPort<T> {
461
481
  enabled?: boolean;
462
482
  secure?: SecureConfig & ServerPort<T>;
463
483
  }
package/lib/squared.d.ts CHANGED
@@ -23,18 +23,6 @@ interface BlobValue extends KeyValue<string, unknown> {
23
23
  filename?: string;
24
24
  }
25
25
 
26
- interface BoxRect<T = number> {
27
- top: T;
28
- right: T;
29
- bottom: T;
30
- left: T;
31
- }
32
-
33
- interface BoxRectDimension extends BoxRect, Dimension {
34
- numberOfLines?: number;
35
- overflow?: boolean;
36
- }
37
-
38
26
  export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
39
27
  format?: ArrayOf<string>;
40
28
  dataView?: NodeJS.ArrayBufferView;
@@ -53,7 +41,7 @@ export interface DataSource<T = unknown> extends DocumentAction {
53
41
  preRender?: string | FunctionType;
54
42
  whenEmpty?: string | FunctionType;
55
43
  removeEmpty?: boolean;
56
- ignoreCache?: boolean | 0 | 1 | [number, number?, number?];
44
+ ignoreCache?: IntBool | FirstOf<number, number>;
57
45
  transactionState?: number;
58
46
  transactionFail?: boolean;
59
47
  }
@@ -91,7 +79,7 @@ export interface WatchAction {
91
79
  }
92
80
 
93
81
  export interface BundleAction<T = unknown> {
94
- bundleId?: NumString;
82
+ bundleId?: number | string;
95
83
  bundleIndex?: number;
96
84
  bundleReplace?: T;
97
85
  bundleQueue?: Promise<unknown>[];
@@ -225,7 +213,7 @@ export interface CompressFormat extends CompressLevel {
225
213
  condition?: string;
226
214
  plugin?: string;
227
215
  timeout?: number;
228
- options?: PlainObject & { apiKey?: string };
216
+ options?: PlainObject;
229
217
  }
230
218
 
231
219
  export interface WatchInterval<T = FileAsset> extends TaskBase {
@@ -268,7 +256,7 @@ export interface BroadcastResponse extends WebSocketResponse {
268
256
 
269
257
  export interface FileInfo {
270
258
  name: string;
271
- size: NumString;
259
+ size: number | string;
272
260
  }
273
261
 
274
262
  export interface RequestBase<T = PlainObject> {
@@ -322,32 +310,7 @@ export interface ResponseError {
322
310
 
323
311
  export interface RequestObserve extends WebSocketClient {
324
312
  action?: string;
325
- expires?: NumString;
326
- }
327
-
328
- export interface FinalizedElement {
329
- documentId: string;
330
- bounds: BoxRectDimension;
331
- css: PlainObject;
332
- outerWrapperIds?: string[];
333
- }
334
-
335
- export interface ConditionProperty {
336
- conditionText: string;
337
- }
338
-
339
- export interface CssConditionData extends ConditionProperty {
340
- name?: string;
341
- conditionText: string;
342
- }
343
-
344
- export interface ControllerSettingsDirectoryUI {
345
- layout: string;
346
- string: string;
347
- font: string;
348
- image: string;
349
- video: string;
350
- audio: string;
313
+ expires?: number | string;
351
314
  }
352
315
 
353
316
  export interface ChecksumBase<T = BinaryToTextEncoding> {
@@ -363,9 +326,9 @@ export interface ChecksumOutput<T = BinaryToTextEncoding> extends ChecksumBase<T
363
326
  }
364
327
 
365
328
  export interface TaskBase {
366
- interval?: NumString;
367
- start?: NumString;
368
- expires?: NumString;
329
+ interval?: number | string;
330
+ start?: number | string;
331
+ expires?: number | string;
369
332
  }
370
333
 
371
334
  export type WebSocketEvent = "close" | "error";