@e-mc/types 0.10.2 → 0.10.4
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/README.md +6 -6
- package/constant.d.ts +8 -37
- package/index.d.ts +15 -28
- package/lib/asset.d.ts +2 -2
- package/lib/cloud.d.ts +1 -1
- package/lib/compat-v4.d.ts +6 -11
- package/lib/compress.d.ts +8 -9
- package/lib/core.d.ts +7 -7
- package/lib/db.d.ts +14 -16
- package/lib/document.d.ts +4 -6
- package/lib/filemanager.d.ts +9 -10
- package/lib/http.d.ts +1 -2
- package/lib/index.d.ts +57 -58
- package/lib/logger.d.ts +0 -3
- package/lib/module.d.ts +46 -23
- package/lib/node.d.ts +2 -2
- package/lib/object.d.ts +2 -0
- package/lib/request.d.ts +15 -13
- package/lib/settings.d.ts +70 -93
- package/lib/squared.d.ts +45 -9
- package/lib/type.d.ts +6 -11
- package/package.json +2 -2
- package/lib/dom.d.ts +0 -9
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
|
|
8
|
+
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign } from './logger';
|
|
9
9
|
import type { ExecAction, IncludeAction } from './module';
|
|
10
10
|
|
|
11
11
|
import type { SpawnOptions } from 'child_process';
|
|
@@ -13,7 +13,6 @@ 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';
|
|
17
16
|
// @ts-ignore
|
|
18
17
|
import type { Unit } from 'bytes';
|
|
19
18
|
// @ts-ignore
|
|
@@ -60,13 +59,13 @@ export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
60
59
|
private?: boolean;
|
|
61
60
|
};
|
|
62
61
|
queue?: {
|
|
63
|
-
limit?:
|
|
64
|
-
expires?:
|
|
65
|
-
priority: { bypass?:
|
|
62
|
+
limit?: NumString;
|
|
63
|
+
expires?: NumString;
|
|
64
|
+
priority: { bypass?: NumString } & MinMax<NumString>;
|
|
66
65
|
};
|
|
67
|
-
limit?:
|
|
68
|
-
sub_limit?:
|
|
69
|
-
expires?:
|
|
66
|
+
limit?: NumString;
|
|
67
|
+
sub_limit?: NumString;
|
|
68
|
+
expires?: NumString;
|
|
70
69
|
};
|
|
71
70
|
cipher?: CipherConfig;
|
|
72
71
|
password?: string;
|
|
@@ -78,7 +77,6 @@ export interface ProcessEnvConfig {
|
|
|
78
77
|
|
|
79
78
|
export interface TempModule<T = PlainObject> extends HandlerSettings<T> {
|
|
80
79
|
dir?: string;
|
|
81
|
-
env?: string;
|
|
82
80
|
write?: boolean;
|
|
83
81
|
}
|
|
84
82
|
|
|
@@ -94,20 +92,19 @@ export interface PermissionSettings extends PlainObject {
|
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
export interface DownloadModule<T = PlainObject> extends HandlerSettings<T> {
|
|
97
|
-
expires?:
|
|
95
|
+
expires?: NumString;
|
|
98
96
|
aria2?: {
|
|
99
97
|
bin?: string | false;
|
|
100
98
|
exec?: ExecAction;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
bt_tracker_timeout?: number | string;
|
|
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;
|
|
108
105
|
min_split_size?: string;
|
|
109
|
-
disk_cache?:
|
|
110
|
-
lowest_speed_limit?:
|
|
106
|
+
disk_cache?: NumString;
|
|
107
|
+
lowest_speed_limit?: NumString;
|
|
111
108
|
always_resume?: boolean;
|
|
112
109
|
file_allocation?: "none" | "prealloc" | "trunc" | "falloc";
|
|
113
110
|
conf_path?: string;
|
|
@@ -147,13 +144,13 @@ export interface DocumentComponentOption<T = unknown> {
|
|
|
147
144
|
cache?: T;
|
|
148
145
|
coerce?: boolean;
|
|
149
146
|
abort?: boolean;
|
|
150
|
-
local_file?:
|
|
147
|
+
local_file?: NumString;
|
|
151
148
|
}
|
|
152
149
|
|
|
153
|
-
export interface DocumentSettings
|
|
150
|
+
export interface DocumentSettings extends DocumentGroup, PurgeAction, ClientSettings<DocumentUserSettings>, PlainObject {
|
|
151
|
+
imports_strict?: boolean;
|
|
154
152
|
directory?: DocumentDirectory;
|
|
155
153
|
options?: DocumentComponentOptions;
|
|
156
|
-
imports_strict?: boolean;
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
export interface DocumentDirectory extends StringMap {
|
|
@@ -175,7 +172,7 @@ export interface MemorySettings extends PlainObject {
|
|
|
175
172
|
cache_disk?: MemoryCacheDiskSettings;
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
export interface MemoryCacheDiskSettings<T =
|
|
175
|
+
export interface MemoryCacheDiskSettings<T = NumString> extends IncludeAction<Null<string[]>> {
|
|
179
176
|
enabled?: boolean;
|
|
180
177
|
min_size?: T;
|
|
181
178
|
max_size?: T;
|
|
@@ -192,12 +189,12 @@ export interface DbUserSettings extends DbSourceDataType<{ commands?: ObjectMap<
|
|
|
192
189
|
|
|
193
190
|
export interface DbCacheSettings extends TimeoutAction {
|
|
194
191
|
dir?: string;
|
|
195
|
-
purge?:
|
|
192
|
+
purge?: NumString;
|
|
196
193
|
when_empty?: boolean;
|
|
197
194
|
}
|
|
198
195
|
|
|
199
196
|
export interface DbSourceOptions {
|
|
200
|
-
pool?: PoolConfig<
|
|
197
|
+
pool?: PoolConfig<NumString>;
|
|
201
198
|
cache?: DbCacheValue;
|
|
202
199
|
coerce?: DbCoerceValue;
|
|
203
200
|
}
|
|
@@ -207,20 +204,20 @@ export interface DbCoerceSettings<T = boolean> {
|
|
|
207
204
|
options?: T;
|
|
208
205
|
}
|
|
209
206
|
|
|
210
|
-
export interface PurgeBase<T =
|
|
207
|
+
export interface PurgeBase<T = NumString> extends MinMax {
|
|
211
208
|
enabled?: boolean;
|
|
212
209
|
percent?: T;
|
|
213
210
|
limit?: number;
|
|
214
211
|
}
|
|
215
212
|
|
|
216
213
|
export interface PurgeComponent extends PurgeBase {
|
|
217
|
-
interval?:
|
|
214
|
+
interval?: NumString;
|
|
218
215
|
all?: boolean | number;
|
|
219
216
|
log?: boolean;
|
|
220
217
|
prefix?: string;
|
|
221
218
|
}
|
|
222
219
|
|
|
223
|
-
export type DbCacheValue =
|
|
220
|
+
export type DbCacheValue = NumString | DbCacheSettings;
|
|
224
221
|
export type DbCoerceValue = boolean | DbCoerceSettings;
|
|
225
222
|
export type DbSourceDataType<T = unknown> = {
|
|
226
223
|
[K in DbSource]?: T;
|
|
@@ -237,42 +234,35 @@ export interface ImageSettings extends PlainObject {
|
|
|
237
234
|
};
|
|
238
235
|
}
|
|
239
236
|
|
|
240
|
-
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T
|
|
241
|
-
timeout?:
|
|
242
|
-
read_timeout?:
|
|
237
|
+
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T> {
|
|
238
|
+
timeout?: NumString;
|
|
239
|
+
read_timeout?: NumString;
|
|
243
240
|
agent?: {
|
|
244
241
|
keep_alive?: boolean;
|
|
245
|
-
timeout?:
|
|
242
|
+
timeout?: NumString;
|
|
246
243
|
};
|
|
247
244
|
disk?: HttpDiskSettings;
|
|
248
245
|
buffer?: HttpMemorySettings;
|
|
249
246
|
connect?: HttpConnectSettings;
|
|
250
247
|
dns?: DnsLookupSettings;
|
|
251
248
|
use?: {
|
|
252
|
-
http_version?:
|
|
249
|
+
http_version?: NumString;
|
|
253
250
|
accept_encoding?: boolean;
|
|
254
251
|
};
|
|
255
|
-
proxy?:
|
|
252
|
+
proxy?: AuthValue & IncludeAction & {
|
|
253
|
+
address?: string;
|
|
254
|
+
port?: NumString;
|
|
255
|
+
keep_alive?: boolean;
|
|
256
|
+
};
|
|
256
257
|
headers?: HttpOutgoingHeaders;
|
|
257
258
|
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
258
|
-
post_limit?: number | string;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export interface HttpProxySettings extends AuthValue, IncludeAction {
|
|
262
|
-
address?: string;
|
|
263
|
-
port?: number | string;
|
|
264
|
-
origin?: string;
|
|
265
|
-
keep_alive?: boolean;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface HttpHostSettings {
|
|
269
259
|
localhost?: string[];
|
|
270
260
|
protocol?: {
|
|
271
261
|
"http/1.1"?: string[];
|
|
272
262
|
h2c?: string[];
|
|
273
263
|
h2?: string[];
|
|
274
264
|
};
|
|
275
|
-
|
|
265
|
+
post_limit?: NumString;
|
|
276
266
|
}
|
|
277
267
|
|
|
278
268
|
export interface RequestSettings extends PurgeAction, PlainObject {
|
|
@@ -280,7 +270,7 @@ export interface RequestSettings extends PurgeAction, PlainObject {
|
|
|
280
270
|
}
|
|
281
271
|
|
|
282
272
|
export interface WatchModule<T = WatchSettings> extends HandlerModule<T>, ServerInfo {
|
|
283
|
-
interval?:
|
|
273
|
+
interval?: NumString;
|
|
284
274
|
}
|
|
285
275
|
|
|
286
276
|
export interface WatchSettings<T = WatchUserSettings> extends ClientSettings<ObjectMap<T>>, PlainObject {}
|
|
@@ -289,15 +279,19 @@ export interface CompressModule<U = CompressSettings> extends HandlerSettings<U>
|
|
|
289
279
|
gzip?: ZlibOptions;
|
|
290
280
|
brotli?: BrotliOptions;
|
|
291
281
|
zopfli?: ZopfliOptions;
|
|
282
|
+
tinify?: {
|
|
283
|
+
api_key?: string;
|
|
284
|
+
proxy?: string;
|
|
285
|
+
};
|
|
292
286
|
}
|
|
293
287
|
|
|
294
288
|
export interface CompressSettings extends PlainObject {
|
|
295
289
|
cache?: boolean;
|
|
296
|
-
cache_expires?:
|
|
297
|
-
gzip_level?:
|
|
298
|
-
brotli_quality?:
|
|
299
|
-
zopfli_iterations?:
|
|
300
|
-
chunk_size?:
|
|
290
|
+
cache_expires?: NumString;
|
|
291
|
+
gzip_level?: NumString;
|
|
292
|
+
brotli_quality?: NumString;
|
|
293
|
+
zopfli_iterations?: NumString;
|
|
294
|
+
chunk_size?: NumString;
|
|
301
295
|
}
|
|
302
296
|
|
|
303
297
|
export interface TaskModule<T = PlainObject> extends ClientModule<T>, PlainObject {}
|
|
@@ -325,24 +319,14 @@ export interface ErrorModule extends HandlerModule {
|
|
|
325
319
|
out?: string | ErrorOutMethod;
|
|
326
320
|
abort?: string[];
|
|
327
321
|
fatal?: boolean;
|
|
328
|
-
recursion_limit?:
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export interface LoggerProgress extends LoggerFormatColor {
|
|
332
|
-
scroll_buffer?: number | string;
|
|
333
|
-
max_width?: number | string;
|
|
334
|
-
use_color?: boolean;
|
|
335
|
-
text_wrap?: TextWrapStyle;
|
|
336
|
-
box_char?: string;
|
|
337
|
-
raw_mode?: boolean;
|
|
322
|
+
recursion_limit?: NumString;
|
|
338
323
|
}
|
|
339
324
|
|
|
340
|
-
export interface LoggerModule<T =
|
|
325
|
+
export interface LoggerModule<T = NumString, U = boolean | T, V = LoggerFormat<T>> {
|
|
341
326
|
enabled?: boolean;
|
|
342
|
-
level?:
|
|
327
|
+
level?: NumString;
|
|
343
328
|
production?: string[];
|
|
344
329
|
format?: LoggerFormatSettings<V>;
|
|
345
|
-
progress?: LoggerProgress;
|
|
346
330
|
meter?: LoggerMeterSettings<T>;
|
|
347
331
|
broadcast?: BroadcastServer & { color?: boolean };
|
|
348
332
|
status?: boolean | LoggerStatus;
|
|
@@ -375,10 +359,9 @@ export interface LoggerFormatSettings<T = PlainObject> {
|
|
|
375
359
|
session_id?: T;
|
|
376
360
|
message?: T;
|
|
377
361
|
meter?: T;
|
|
378
|
-
error?: T;
|
|
379
362
|
}
|
|
380
363
|
|
|
381
|
-
export interface LoggerMeterSettings<T =
|
|
364
|
+
export interface LoggerMeterSettings<T = NumString> {
|
|
382
365
|
http?: T;
|
|
383
366
|
image?: T;
|
|
384
367
|
compress?: T;
|
|
@@ -388,58 +371,52 @@ export interface LoggerMeterSettings<T = number | string> {
|
|
|
388
371
|
export interface LoggerProcessSettings extends LoggerColor {
|
|
389
372
|
cpu?: boolean;
|
|
390
373
|
cpu_bar?: boolean | ArrayOf<number>;
|
|
391
|
-
cpu_bar_color?: [typeof IBackgroundColor, typeof IBackgroundColor, typeof IBackgroundColor];
|
|
392
374
|
cpu_single_core?: boolean;
|
|
393
375
|
mem?: boolean;
|
|
394
376
|
mem_format?: "%" | Unit;
|
|
395
377
|
}
|
|
396
378
|
|
|
397
|
-
export interface
|
|
379
|
+
export interface LoggerFormat<T = NumString> {
|
|
380
|
+
width?: T;
|
|
398
381
|
color?: ForegroundColor;
|
|
399
382
|
bg_color?: BackgroundColor;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
export interface LoggerFormat<T = number | string> extends LoggerFormatColor {
|
|
403
|
-
width?: T;
|
|
404
|
-
alt_color?: ForegroundColor;
|
|
405
383
|
bg_alt_color?: BackgroundColor;
|
|
406
384
|
bold?: boolean;
|
|
407
385
|
justify?: TextAlign;
|
|
408
386
|
unit?: string;
|
|
409
387
|
as?: StringMap;
|
|
410
|
-
braces?: string | TupleOf<string>;
|
|
411
388
|
}
|
|
412
389
|
|
|
413
390
|
export interface HttpSettings {
|
|
414
|
-
version?:
|
|
415
|
-
timeout?:
|
|
391
|
+
version?: NumString;
|
|
392
|
+
timeout?: NumString;
|
|
416
393
|
headers?: HttpOutgoingHeaders;
|
|
417
394
|
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
418
395
|
}
|
|
419
396
|
|
|
420
397
|
export interface HttpDiskSettings extends IncludeAction {
|
|
421
398
|
enabled?: boolean;
|
|
422
|
-
limit?:
|
|
423
|
-
expires?:
|
|
399
|
+
limit?: NumString;
|
|
400
|
+
expires?: NumString;
|
|
424
401
|
}
|
|
425
402
|
|
|
426
403
|
export interface HttpMemorySettings extends HttpDiskSettings {
|
|
427
|
-
limit_all?:
|
|
428
|
-
to_disk?:
|
|
429
|
-
purge_amount?:
|
|
404
|
+
limit_all?: NumString;
|
|
405
|
+
to_disk?: NumString | [NumString, NumString?];
|
|
406
|
+
purge_amount?: NumString;
|
|
430
407
|
}
|
|
431
408
|
|
|
432
409
|
export interface HttpConnectSettings {
|
|
433
|
-
timeout?:
|
|
434
|
-
retry_wait?:
|
|
435
|
-
retry_after?:
|
|
436
|
-
retry_limit?:
|
|
437
|
-
redirect_limit?:
|
|
410
|
+
timeout?: NumString;
|
|
411
|
+
retry_wait?: NumString;
|
|
412
|
+
retry_after?: NumString;
|
|
413
|
+
retry_limit?: NumString;
|
|
414
|
+
redirect_limit?: NumString;
|
|
438
415
|
}
|
|
439
416
|
|
|
440
417
|
export interface DnsLookupSettings {
|
|
441
|
-
family?:
|
|
442
|
-
expires?:
|
|
418
|
+
family?: NumString;
|
|
419
|
+
expires?: NumString;
|
|
443
420
|
resolve?: ObjectMap<Partial<LookupAddress>>;
|
|
444
421
|
}
|
|
445
422
|
|
|
@@ -447,12 +424,12 @@ export interface HashConfig extends IncludeAction<ObjectMap<string[] | "*">> {
|
|
|
447
424
|
enabled?: boolean;
|
|
448
425
|
algorithm?: HashAlgorithm;
|
|
449
426
|
etag?: boolean;
|
|
450
|
-
expires?:
|
|
427
|
+
expires?: NumString;
|
|
451
428
|
renew?: boolean;
|
|
452
|
-
limit?:
|
|
429
|
+
limit?: NumString;
|
|
453
430
|
}
|
|
454
431
|
|
|
455
|
-
export interface BroadcastServer extends ServerInfo<ArrayOf<
|
|
432
|
+
export interface BroadcastServer extends ServerInfo<ArrayOf<NumString>> {
|
|
456
433
|
out?: string | BroadcastOutMethod;
|
|
457
434
|
}
|
|
458
435
|
|
|
@@ -480,7 +457,7 @@ export interface CipherConfig {
|
|
|
480
457
|
iv?: BinaryLike;
|
|
481
458
|
}
|
|
482
459
|
|
|
483
|
-
export interface ServerInfo<T =
|
|
460
|
+
export interface ServerInfo<T = NumString> extends ServerPort<T> {
|
|
484
461
|
enabled?: boolean;
|
|
485
462
|
secure?: SecureConfig & ServerPort<T>;
|
|
486
463
|
}
|
package/lib/squared.d.ts
CHANGED
|
@@ -23,6 +23,18 @@ 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
|
+
|
|
26
38
|
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
|
|
27
39
|
format?: ArrayOf<string>;
|
|
28
40
|
dataView?: NodeJS.ArrayBufferView;
|
|
@@ -41,7 +53,7 @@ export interface DataSource<T = unknown> extends DocumentAction {
|
|
|
41
53
|
preRender?: string | FunctionType;
|
|
42
54
|
whenEmpty?: string | FunctionType;
|
|
43
55
|
removeEmpty?: boolean;
|
|
44
|
-
ignoreCache?:
|
|
56
|
+
ignoreCache?: boolean | 0 | 1 | [number, number?, number?];
|
|
45
57
|
transactionState?: number;
|
|
46
58
|
transactionFail?: boolean;
|
|
47
59
|
}
|
|
@@ -54,7 +66,6 @@ export interface DbDataSource<T = unknown, U = unknown, V = unknown, W = unknown
|
|
|
54
66
|
update?: V;
|
|
55
67
|
withCommand?: string | TupleOf<string>;
|
|
56
68
|
parallel?: boolean;
|
|
57
|
-
flat?: number;
|
|
58
69
|
willAbort?: boolean;
|
|
59
70
|
streamRow?: Null<boolean | string | ((row: unknown) => Void<Error | false>)>;
|
|
60
71
|
usePool?: boolean | X;
|
|
@@ -80,7 +91,7 @@ export interface WatchAction {
|
|
|
80
91
|
}
|
|
81
92
|
|
|
82
93
|
export interface BundleAction<T = unknown> {
|
|
83
|
-
bundleId?:
|
|
94
|
+
bundleId?: NumString;
|
|
84
95
|
bundleIndex?: number;
|
|
85
96
|
bundleReplace?: T;
|
|
86
97
|
bundleQueue?: Promise<unknown>[];
|
|
@@ -214,7 +225,7 @@ export interface CompressFormat extends CompressLevel {
|
|
|
214
225
|
condition?: string;
|
|
215
226
|
plugin?: string;
|
|
216
227
|
timeout?: number;
|
|
217
|
-
options?: PlainObject;
|
|
228
|
+
options?: PlainObject & { apiKey?: string };
|
|
218
229
|
}
|
|
219
230
|
|
|
220
231
|
export interface WatchInterval<T = FileAsset> extends TaskBase {
|
|
@@ -257,7 +268,7 @@ export interface BroadcastResponse extends WebSocketResponse {
|
|
|
257
268
|
|
|
258
269
|
export interface FileInfo {
|
|
259
270
|
name: string;
|
|
260
|
-
size:
|
|
271
|
+
size: NumString;
|
|
261
272
|
}
|
|
262
273
|
|
|
263
274
|
export interface RequestBase<T = PlainObject> {
|
|
@@ -311,7 +322,32 @@ export interface ResponseError {
|
|
|
311
322
|
|
|
312
323
|
export interface RequestObserve extends WebSocketClient {
|
|
313
324
|
action?: string;
|
|
314
|
-
expires?:
|
|
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;
|
|
315
351
|
}
|
|
316
352
|
|
|
317
353
|
export interface ChecksumBase<T = BinaryToTextEncoding> {
|
|
@@ -327,9 +363,9 @@ export interface ChecksumOutput<T = BinaryToTextEncoding> extends ChecksumBase<T
|
|
|
327
363
|
}
|
|
328
364
|
|
|
329
365
|
export interface TaskBase {
|
|
330
|
-
interval?:
|
|
331
|
-
start?:
|
|
332
|
-
expires?:
|
|
366
|
+
interval?: NumString;
|
|
367
|
+
start?: NumString;
|
|
368
|
+
expires?: NumString;
|
|
333
369
|
}
|
|
334
370
|
|
|
335
371
|
export type WebSocketEvent = "close" | "error";
|
package/lib/type.d.ts
CHANGED
|
@@ -1,36 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint @typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-redeclare: "off" */
|
|
2
|
+
|
|
2
3
|
type Undef<T> = T | undefined;
|
|
3
|
-
/** @deprecated */
|
|
4
4
|
type Null<T> = T | null;
|
|
5
5
|
type Void<T> = T | void;
|
|
6
6
|
type Optional<T> = T | null | undefined;
|
|
7
7
|
type Nullable<T> = { [P in keyof T]: T[P] | null; };
|
|
8
|
-
type
|
|
8
|
+
type Writeable<T> = { -readonly [P in keyof T]: T[P] };
|
|
9
9
|
type KeyOfType<T, U = any, V = any> = { [K in keyof T]: K extends U ? T[K] extends V ? K : never : never }[keyof T];
|
|
10
10
|
type MapOfType<T, U = any, V = any> = { [K in KeyOfType<T, U, V>]: K extends U ? T[K] extends V ? T[K] : never : never };
|
|
11
11
|
|
|
12
12
|
type Constructor<out T> = new(...args: any[]) => T;
|
|
13
|
-
type ConstructorDerived<T> = Pick<T, { [K in keyof T]: T[K] extends new() => any ? never : K }[keyof T]>;
|
|
14
13
|
|
|
15
14
|
type FunctionType<T = unknown, U = unknown> = (...args: U[]) => T;
|
|
16
15
|
type FunctionArgs<T extends unknown[], U = unknown> = (...args: T) => U;
|
|
17
16
|
|
|
18
|
-
/** @deprecated */
|
|
19
17
|
type NumString = number | string;
|
|
20
|
-
type IntBool = boolean | 0 | 1;
|
|
21
18
|
type ArrayOf<T> = T | T[];
|
|
22
|
-
/** @deprecated */
|
|
23
19
|
type TupleOf<T> = [T, T];
|
|
24
|
-
type FirstOf<T, U = boolean> = T
|
|
20
|
+
type FirstOf<T, U = boolean> = T[] | [U, ...T[]];
|
|
25
21
|
type Bufferable = string | Buffer;
|
|
26
22
|
|
|
27
23
|
type AnyObject = Record<string, unknown>;
|
|
28
24
|
type PlainObject = Record<string | number | symbol, unknown>;
|
|
29
25
|
|
|
30
26
|
type StandardMap = Record<string, any>;
|
|
31
|
-
type StringMap = Record<string, string
|
|
32
|
-
type ObjectMap<T> = Record<string, T
|
|
33
|
-
type IterableMap<T> = Record<string, T>;
|
|
27
|
+
type StringMap = Record<string, Undef<string>>;
|
|
28
|
+
type ObjectMap<T> = Record<string, Undef<T>>;
|
|
34
29
|
|
|
35
30
|
type PropertyAction<T, U extends string, V extends boolean = false> = {
|
|
36
31
|
[K in keyof T as `${U}${V extends true ? string & K : Capitalize<string & K>}`]: T[K];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/types",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Type definitions for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"squared-functions"
|
|
18
18
|
],
|
|
19
19
|
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "BSD
|
|
20
|
+
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"bytes": "^3.1.2"
|