@e-mc/types 0.8.7 → 0.9.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/LICENSE +10 -10
- package/README.md +28 -4
- package/constant.d.ts +23 -2
- package/index.d.ts +25 -0
- package/index.js +172 -101
- package/lib/asset.d.ts +4 -2
- package/lib/cloud.d.ts +31 -16
- package/lib/compat-v4.d.ts +7 -14
- package/lib/compress.d.ts +3 -3
- package/lib/core.d.ts +25 -19
- package/lib/db.d.ts +0 -9
- package/lib/filemanager.d.ts +3 -2
- package/lib/http.d.ts +20 -0
- package/lib/index.d.ts +151 -130
- package/lib/logger.d.ts +4 -14
- package/lib/module.d.ts +12 -2
- package/lib/node.d.ts +0 -2
- package/lib/object.d.ts +2 -0
- package/lib/request.d.ts +6 -4
- package/lib/settings.d.ts +72 -68
- package/lib/squared.d.ts +14 -13
- package/lib/type.d.ts +3 -4
- package/lib/watch.d.ts +3 -3
- package/package.json +3 -4
package/lib/logger.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogStatus } from './squared';
|
|
2
2
|
|
|
3
|
-
import type { LOG_TYPE, STATUS_TYPE } from '../index.d';
|
|
3
|
+
import type { LOG_STATE, LOG_TYPE, STATUS_TYPE } from '../index.d';
|
|
4
4
|
|
|
5
5
|
import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
|
|
6
6
|
|
|
@@ -31,17 +31,6 @@ export interface LoggerColor {
|
|
|
31
31
|
messageBold?: boolean;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export interface LoggerFormat<T = NumString> {
|
|
35
|
-
width?: T;
|
|
36
|
-
color?: ForegroundColor;
|
|
37
|
-
bg_color?: BackgroundColor;
|
|
38
|
-
bg_alt_color?: BackgroundColor;
|
|
39
|
-
bold?: boolean;
|
|
40
|
-
justify?: TextAlign;
|
|
41
|
-
unit?: string;
|
|
42
|
-
as?: StringMap;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
34
|
export interface LoggerStatus<T = boolean> {
|
|
46
35
|
fatal?: T;
|
|
47
36
|
error?: T;
|
|
@@ -105,9 +94,10 @@ export interface ExecCommand {
|
|
|
105
94
|
warn?: string[];
|
|
106
95
|
}
|
|
107
96
|
|
|
108
|
-
export type { LOG_TYPE, STATUS_TYPE };
|
|
97
|
+
export type { LOG_STATE, LOG_TYPE, STATUS_TYPE };
|
|
109
98
|
export type LogType = LOG_TYPE[keyof LOG_TYPE];
|
|
110
99
|
export type StatusType = STATUS_TYPE[keyof STATUS_TYPE];
|
|
100
|
+
export type LogState = LOG_STATE[keyof LOG_STATE];
|
|
111
101
|
export type StatusName = keyof typeof STATUS_TYPE;
|
|
112
102
|
export type LogDate = Date | number;
|
|
113
103
|
export type LogTime = LogDate | HighResolutionTime;
|
|
@@ -118,4 +108,4 @@ export type ForegroundColor = typeof IForegroundColor | HexColor;
|
|
|
118
108
|
export type TextAlign = "left" | "center" | "right";
|
|
119
109
|
export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
|
|
120
110
|
export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
|
|
121
|
-
export type BroadcastValue =
|
|
111
|
+
export type BroadcastValue = ArrayOf<string> | { value: ArrayOf<string>; stripAnsi?: boolean };
|
package/lib/module.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare enum NORMALIZE_FLAGS {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface RequireAction {
|
|
15
|
-
requireExt?:
|
|
15
|
+
requireExt?: ArrayOf<string> | boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface PermissionOptions {
|
|
@@ -125,7 +125,17 @@ export interface GetTempDirOptions {
|
|
|
125
125
|
increment?: number;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
export interface ExecAction {
|
|
129
|
+
uid?: NumString;
|
|
130
|
+
gid?: NumString;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface IncludeAction<T = string[]> {
|
|
134
|
+
include?: T;
|
|
135
|
+
exclude?: T;
|
|
136
|
+
}
|
|
137
|
+
|
|
128
138
|
export type NormalizeFlags = typeof NORMALIZE_FLAGS[keyof typeof NORMALIZE_FLAGS];
|
|
129
139
|
export type ReadTextOptions = ReadBufferOptions;
|
|
130
|
-
export type ReadFileCallback<T extends
|
|
140
|
+
export type ReadFileCallback<T extends Bufferable = Bufferable> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
|
|
131
141
|
export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc";
|
package/lib/node.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ import type { ExternalAsset } from './asset';
|
|
|
4
4
|
import type { HostInitConfig } from './core';
|
|
5
5
|
import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
|
|
6
6
|
|
|
7
|
-
type BoolString = boolean | string;
|
|
8
|
-
|
|
9
7
|
export interface RequestData<T extends ExternalAsset = ExternalAsset> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig> {
|
|
10
8
|
readonly assets?: T[];
|
|
11
9
|
}
|
package/lib/object.d.ts
CHANGED
package/lib/request.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BinaryAction } from './asset';
|
|
2
2
|
import type { HttpProtocolVersion, InternetProtocolVersion } from './http';
|
|
3
3
|
|
|
4
|
-
import type { Readable, Writable } from 'stream';
|
|
5
4
|
import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
|
|
5
|
+
import type { Readable, Writable } from 'stream';
|
|
6
6
|
|
|
7
7
|
interface KeepAliveAction {
|
|
8
8
|
keepAlive?: boolean;
|
|
@@ -57,7 +57,10 @@ export interface OpenOptions extends KeepAliveAction, SilentAction {
|
|
|
57
57
|
socketPath?: string;
|
|
58
58
|
httpVersion?: HttpProtocolVersion;
|
|
59
59
|
method?: "GET" | "POST" | "HEAD";
|
|
60
|
+
search?: StringMap;
|
|
61
|
+
follow_redirect?: boolean;
|
|
60
62
|
encoding?: BufferEncoding;
|
|
63
|
+
maxBufferSize?: NumString;
|
|
61
64
|
format?: BufferFormat | { out?: BufferFormat; parser?: PlainObject };
|
|
62
65
|
headers?: OutgoingHttpHeaders;
|
|
63
66
|
timeout?: number;
|
|
@@ -65,6 +68,7 @@ export interface OpenOptions extends KeepAliveAction, SilentAction {
|
|
|
65
68
|
postData?: unknown;
|
|
66
69
|
connected?: (headers: IncomingHttpHeaders) => Void<boolean>;
|
|
67
70
|
statusMessage?: string;
|
|
71
|
+
progressId?: NumString;
|
|
68
72
|
outFormat?: { out: BufferFormat; parser?: PlainObject };
|
|
69
73
|
outFilename?: Null<string>;
|
|
70
74
|
outHeaders?: Null<IncomingHttpHeaders>;
|
|
@@ -104,8 +108,6 @@ export interface ProxySettings extends KeepAliveAction {
|
|
|
104
108
|
|
|
105
109
|
export interface RequestInit extends ProtocolAction {
|
|
106
110
|
headers?: unknown;
|
|
107
|
-
/* @deprecated - readTimeout */
|
|
108
|
-
requestTimeout?: number;
|
|
109
111
|
readTimeout?: number;
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -127,7 +129,7 @@ export interface ApplyOptions extends ProtocolAction, PlainObject {
|
|
|
127
129
|
|
|
128
130
|
export type BufferFormat = "json" | "yaml" | "json5" | "xml" | "toml";
|
|
129
131
|
export type ReadExpectType = "always" | "string" | "none";
|
|
130
|
-
export type DataEncodedResult<T extends { encoding?: BufferEncoding }> = T extends { encoding: BufferEncoding } ? string : Null<
|
|
132
|
+
export type DataEncodedResult<T extends { encoding?: BufferEncoding }> = T extends { encoding: BufferEncoding } ? string : Null<Bufferable>;
|
|
131
133
|
export type DataObjectResult<T extends { format?: unknown; encoding?: BufferEncoding }> = T extends { format: string | PlainObject } ? Null<object> : DataEncodedResult<T>;
|
|
132
134
|
export type StatusOnCallback = (code: number, headers: IncomingHttpHeaders, url?: URL) => Void<boolean>;
|
|
133
135
|
export type HeadersOnCallback = (headers: IncomingHttpHeaders, url?: URL) => Void<boolean>;
|
package/lib/settings.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { WatchInterval } from './squared';
|
|
2
2
|
|
|
3
|
+
import type { HashAlgorithm } from './asset';
|
|
4
|
+
import type { CloudSource } from './cloud';
|
|
3
5
|
import type { PermissionAction, PermissionReadWrite, PermittedDirectories } from './core';
|
|
4
|
-
import type { DbSource,
|
|
5
|
-
import type { HttpOutgoingHeaders } from './http';
|
|
6
|
-
import type { BroadcastOutMethod, ErrorOutMethod,
|
|
6
|
+
import type { DbSource, TimeoutAction } from './db';
|
|
7
|
+
import type { HttpOutgoingHeaders, SecureConfig, ServerPort } from './http';
|
|
8
|
+
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign } from './logger';
|
|
9
|
+
import type { ExecAction, IncludeAction } from './module';
|
|
7
10
|
|
|
8
|
-
import type { LookupAddress } from 'dns';
|
|
9
|
-
import type { SecureVersion } from 'tls';
|
|
10
11
|
import type { SpawnOptions } from 'child_process';
|
|
11
|
-
import type { BrotliOptions, ZlibOptions } from 'zlib';
|
|
12
12
|
import type { BinaryLike, CipherGCMTypes } from 'crypto';
|
|
13
|
+
import type { LookupAddress } from 'dns';
|
|
14
|
+
import type { BrotliOptions, ZlibOptions } from 'zlib';
|
|
13
15
|
|
|
14
16
|
// @ts-ignore
|
|
15
|
-
import type {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import type { PicomatchOptions } from 'picomatch';
|
|
17
|
+
import type { Unit } from 'bytes';
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import type { MinimatchOptions } from 'minimatch';
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
import type {
|
|
21
|
+
import type { Options as ZopfliOptions } from 'node-zopfli';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import type { PicomatchOptions } from 'picomatch';
|
|
22
24
|
|
|
23
25
|
export interface HandlerModule<T = PlainObject> extends HandlerSettings<T> {
|
|
24
26
|
handler?: string;
|
|
@@ -26,7 +28,7 @@ export interface HandlerModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
export interface HandlerSettings<T = PlainObject> {
|
|
29
|
-
settings?: T & { broadcast_id?:
|
|
31
|
+
settings?: T & { broadcast_id?: ArrayOf<string> };
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export interface ClientModule<T = ClientSettings> extends HandlerModule<T>, PermissionAction {}
|
|
@@ -43,7 +45,7 @@ export interface NodeModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
43
45
|
inline?: boolean;
|
|
44
46
|
};
|
|
45
47
|
require?: {
|
|
46
|
-
ext?:
|
|
48
|
+
ext?: ArrayOf<string> | boolean;
|
|
47
49
|
npm?: boolean;
|
|
48
50
|
inline?: boolean;
|
|
49
51
|
};
|
|
@@ -56,13 +58,14 @@ export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
56
58
|
users?: string[];
|
|
57
59
|
private?: boolean;
|
|
58
60
|
};
|
|
59
|
-
limit?: NumString;
|
|
60
|
-
expires?: NumString;
|
|
61
61
|
queue?: {
|
|
62
62
|
limit?: NumString;
|
|
63
63
|
expires?: NumString;
|
|
64
64
|
priority: { bypass?: NumString } & MinMax<NumString>;
|
|
65
65
|
};
|
|
66
|
+
limit?: NumString;
|
|
67
|
+
sub_limit?: NumString;
|
|
68
|
+
expires?: NumString;
|
|
66
69
|
};
|
|
67
70
|
cipher?: CipherConfig;
|
|
68
71
|
password?: string;
|
|
@@ -121,7 +124,7 @@ export interface DocumentEval {
|
|
|
121
124
|
absolute?: boolean;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
export interface DocumentGroup<T = { imports?: StringMap } & AnyObject, U =
|
|
127
|
+
export interface DocumentGroup<T = { imports?: StringMap } & AnyObject, U = AnyObject> {
|
|
125
128
|
transform?: T;
|
|
126
129
|
view_engine?: U;
|
|
127
130
|
pages?: ObjectMap<AnyObject>;
|
|
@@ -176,7 +179,9 @@ export interface MemoryCacheDiskSettings<T = NumString> extends IncludeAction<Nu
|
|
|
176
179
|
expires?: T;
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
export interface DbModule<T = DbSettings> extends ClientModule<T>, DbSourceDataType<ObjectMap<
|
|
182
|
+
export interface DbModule<T = DbSettings> extends ClientModule<T>, DbSourceDataType<ObjectMap<AnyObject>>, PlainObject {
|
|
183
|
+
apiVersion?: string;
|
|
184
|
+
}
|
|
180
185
|
|
|
181
186
|
export interface DbSettings<T = DbUserSettings> extends ClientDbSettings<T>, DbSourceDataType<DbSourceOptions> {}
|
|
182
187
|
|
|
@@ -214,6 +219,9 @@ export interface PurgeComponent extends PurgeBase {
|
|
|
214
219
|
|
|
215
220
|
export type DbCacheValue = NumString | DbCacheSettings;
|
|
216
221
|
export type DbCoerceValue = boolean | DbCoerceSettings;
|
|
222
|
+
export type DbSourceDataType<T = unknown> = {
|
|
223
|
+
[K in DbSource]?: T;
|
|
224
|
+
};
|
|
217
225
|
|
|
218
226
|
export type ImageModule<T = ImageSettings> = ClientModule<T>;
|
|
219
227
|
|
|
@@ -247,18 +255,17 @@ export interface RequestModule<T = RequestSettings> extends HandlerSettings<T> {
|
|
|
247
255
|
keep_alive?: boolean;
|
|
248
256
|
};
|
|
249
257
|
headers?: HttpOutgoingHeaders;
|
|
250
|
-
certs?: ObjectMap<SecureConfig<
|
|
258
|
+
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
251
259
|
localhost?: string[];
|
|
252
260
|
protocol?: {
|
|
253
|
-
"http/1.1"
|
|
254
|
-
h2c
|
|
255
|
-
h2
|
|
261
|
+
"http/1.1"?: string[];
|
|
262
|
+
h2c?: string[];
|
|
263
|
+
h2?: string[];
|
|
256
264
|
};
|
|
257
265
|
post_limit?: NumString;
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
export interface RequestSettings extends PurgeAction, PlainObject {
|
|
261
|
-
cache?: boolean | string[];
|
|
262
269
|
time_format?: "readable" | "relative" | "none";
|
|
263
270
|
}
|
|
264
271
|
|
|
@@ -295,20 +302,18 @@ export interface CloudModule<T = CloudSettings> extends ClientModule<T>, CloudSe
|
|
|
295
302
|
|
|
296
303
|
export interface CloudSettings extends ClientDbSettings, CloudServiceDataType<CloudServiceOptions> {}
|
|
297
304
|
|
|
298
|
-
export
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
gcp?: T;
|
|
305
|
-
gcloud?: T;
|
|
306
|
-
ibm?: T;
|
|
307
|
-
oci?: T;
|
|
308
|
-
minio?: T;
|
|
305
|
+
export type CloudServiceDataType<T = unknown> = {
|
|
306
|
+
[K in CloudSource]?: T;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export interface CloudServiceOptions extends DbSourceOptions {
|
|
310
|
+
auth?: CloudAuthSettings;
|
|
309
311
|
}
|
|
310
312
|
|
|
311
|
-
export
|
|
313
|
+
export interface CloudAuthSettings {
|
|
314
|
+
storage?: boolean;
|
|
315
|
+
database?: boolean;
|
|
316
|
+
}
|
|
312
317
|
|
|
313
318
|
export interface ErrorModule extends HandlerModule {
|
|
314
319
|
out?: string | ErrorOutMethod;
|
|
@@ -334,7 +339,7 @@ export interface LoggerModule<T = NumString, U = boolean | T, V = LoggerFormat<T
|
|
|
334
339
|
unknown?: boolean | LoggerColor;
|
|
335
340
|
system?: boolean | LoggerColor;
|
|
336
341
|
node?: boolean | LoggerColor;
|
|
337
|
-
process?: boolean |
|
|
342
|
+
process?: boolean | LoggerProcessSettings;
|
|
338
343
|
image?: boolean | LoggerColor;
|
|
339
344
|
compress?: boolean | LoggerColor;
|
|
340
345
|
watch?: boolean | LoggerColor;
|
|
@@ -363,11 +368,30 @@ export interface LoggerMeterSettings<T = NumString> {
|
|
|
363
368
|
process?: T;
|
|
364
369
|
}
|
|
365
370
|
|
|
371
|
+
export interface LoggerProcessSettings extends LoggerColor {
|
|
372
|
+
cpu?: boolean;
|
|
373
|
+
cpu_bar?: boolean | ArrayOf<number>;
|
|
374
|
+
cpu_single_core?: boolean;
|
|
375
|
+
mem?: boolean;
|
|
376
|
+
mem_format?: "%" | Unit;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface LoggerFormat<T = NumString> {
|
|
380
|
+
width?: T;
|
|
381
|
+
color?: ForegroundColor;
|
|
382
|
+
bg_color?: BackgroundColor;
|
|
383
|
+
bg_alt_color?: BackgroundColor;
|
|
384
|
+
bold?: boolean;
|
|
385
|
+
justify?: TextAlign;
|
|
386
|
+
unit?: string;
|
|
387
|
+
as?: StringMap;
|
|
388
|
+
}
|
|
389
|
+
|
|
366
390
|
export interface HttpSettings {
|
|
367
391
|
version?: NumString;
|
|
368
392
|
timeout?: NumString;
|
|
369
393
|
headers?: HttpOutgoingHeaders;
|
|
370
|
-
certs?: ObjectMap<SecureConfig<
|
|
394
|
+
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
371
395
|
}
|
|
372
396
|
|
|
373
397
|
export interface HttpDiskSettings extends IncludeAction {
|
|
@@ -405,46 +429,26 @@ export interface HashConfig extends IncludeAction<ObjectMap<string[] | "*">> {
|
|
|
405
429
|
limit?: NumString;
|
|
406
430
|
}
|
|
407
431
|
|
|
408
|
-
export interface SecureConfig<T = string, U = T> {
|
|
409
|
-
ca?: T;
|
|
410
|
-
key?: U;
|
|
411
|
-
cert?: T;
|
|
412
|
-
passphrase?: U;
|
|
413
|
-
version?: SecureVersion;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
export interface ServerPort<T = NumString> {
|
|
417
|
-
port?: T;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
export interface ServerInfo<T = NumString> extends ServerPort<T> {
|
|
421
|
-
enabled?: boolean;
|
|
422
|
-
secure?: SecureConfig & ServerPort<T>;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
export interface ServerSecure extends SecureConfig, ServerPort {}
|
|
426
|
-
|
|
427
432
|
export interface BroadcastServer extends ServerInfo<ArrayOf<NumString>> {
|
|
428
433
|
out?: string | BroadcastOutMethod;
|
|
429
434
|
}
|
|
430
435
|
|
|
431
436
|
export interface ExecOptions extends SpawnOptions {
|
|
432
437
|
command?: string;
|
|
433
|
-
warn?:
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export interface ExecAction {
|
|
437
|
-
uid?: NumString;
|
|
438
|
-
gid?: NumString;
|
|
438
|
+
warn?: ArrayOf<string>;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
export interface PurgeAction {
|
|
442
442
|
purge?: PurgeComponent;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
export interface
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
export interface PoolConfig<T = number> extends MinMax {
|
|
446
|
+
idle?: T;
|
|
447
|
+
queue_max?: number;
|
|
448
|
+
queue_idle?: T;
|
|
449
|
+
purge?: T;
|
|
450
|
+
timeout?: number;
|
|
451
|
+
socket_timeout?: number;
|
|
448
452
|
}
|
|
449
453
|
|
|
450
454
|
export interface CipherConfig {
|
|
@@ -453,12 +457,12 @@ export interface CipherConfig {
|
|
|
453
457
|
iv?: BinaryLike;
|
|
454
458
|
}
|
|
455
459
|
|
|
456
|
-
export
|
|
457
|
-
|
|
458
|
-
|
|
460
|
+
export interface ServerInfo<T = NumString> extends ServerPort<T> {
|
|
461
|
+
enabled?: boolean;
|
|
462
|
+
secure?: SecureConfig & ServerPort<T>;
|
|
463
|
+
}
|
|
459
464
|
|
|
460
465
|
export type WatchUserSettings = ObjectMap<WatchInterval>;
|
|
461
466
|
export type DocumentTransform = Null<boolean | "etag" | HashAlgorithm | HashConfig>;
|
|
462
|
-
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha224" | "sha384" | "sha512";
|
|
463
467
|
|
|
464
|
-
export type { PermissionReadWrite };
|
|
468
|
+
export type { ExecAction, PermissionReadWrite, SecureConfig };
|
package/lib/squared.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ interface BoxRectDimension extends BoxRect, Dimension {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
|
|
39
|
-
format?:
|
|
39
|
+
format?: ArrayOf<string>;
|
|
40
40
|
dataView?: NodeJS.ArrayBufferView;
|
|
41
41
|
base64?: string;
|
|
42
42
|
imported?: boolean | string[];
|
|
@@ -61,13 +61,13 @@ export interface DataSource<T = unknown> extends DocumentAction {
|
|
|
61
61
|
export interface DbDataSource<T = unknown, U = unknown, V = unknown, W = unknown, X = unknown> extends DataSource<T> {
|
|
62
62
|
name?: string;
|
|
63
63
|
table?: string;
|
|
64
|
-
credential?: W;
|
|
64
|
+
credential?: string | W;
|
|
65
65
|
options?: U;
|
|
66
66
|
update?: V;
|
|
67
|
-
withCommand?: string |
|
|
67
|
+
withCommand?: string | TupleOf<string>;
|
|
68
68
|
parallel?: boolean;
|
|
69
69
|
willAbort?: boolean;
|
|
70
|
-
streamRow?: Null<boolean | string | ((row: unknown) =>
|
|
70
|
+
streamRow?: Null<boolean | string | ((row: unknown) => Void<Error | false>)>;
|
|
71
71
|
usePool?: boolean | X;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -95,7 +95,7 @@ export interface BundleAction<T = unknown> {
|
|
|
95
95
|
bundleIndex?: number;
|
|
96
96
|
bundleReplace?: T;
|
|
97
97
|
bundleQueue?: Promise<unknown>[];
|
|
98
|
-
trailingContent?:
|
|
98
|
+
trailingContent?: ArrayOf<string>;
|
|
99
99
|
exported?: boolean;
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -105,7 +105,7 @@ export interface ChecksumAction {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export interface DocumentAction {
|
|
108
|
-
document?:
|
|
108
|
+
document?: ArrayOf<string>;
|
|
109
109
|
encoding?: BufferEncoding;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -242,7 +242,7 @@ export interface WatchReload extends WebSocketClient {
|
|
|
242
242
|
|
|
243
243
|
export interface WebSocketResponse {
|
|
244
244
|
event?: string;
|
|
245
|
-
socketId?:
|
|
245
|
+
socketId?: ArrayOf<string>;
|
|
246
246
|
type?: string;
|
|
247
247
|
encoding?: BufferEncoding;
|
|
248
248
|
value?: unknown;
|
|
@@ -274,10 +274,11 @@ export interface FileInfo {
|
|
|
274
274
|
export interface RequestBase<T = PlainObject> {
|
|
275
275
|
baseUrl?: string;
|
|
276
276
|
priority?: number;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
277
|
+
threads?: number;
|
|
278
|
+
broadcastId?: ArrayOf<string>;
|
|
279
|
+
log?: boolean | ArrayOf<string> | T;
|
|
280
|
+
error?: { abort?: boolean | ArrayOf<string>; fatal?: boolean };
|
|
281
|
+
ignoreExtensions?: boolean | ArrayOf<string>;
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
export interface RequestData extends RequestBase, ImportAction<StringMap>, IncrementalAction {
|
|
@@ -356,8 +357,8 @@ export interface ChecksumBase<T = BinaryToTextEncoding> {
|
|
|
356
357
|
|
|
357
358
|
export interface ChecksumOutput<T = BinaryToTextEncoding> extends ChecksumBase<T> {
|
|
358
359
|
filename?: string;
|
|
359
|
-
include?:
|
|
360
|
-
exclude?:
|
|
360
|
+
include?: ArrayOf<string>;
|
|
361
|
+
exclude?: ArrayOf<string>;
|
|
361
362
|
recursive?: boolean | 1;
|
|
362
363
|
}
|
|
363
364
|
|
package/lib/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
1
|
+
/* eslint @typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-redeclare: "off" */
|
|
2
2
|
|
|
3
3
|
type Undef<T> = T | undefined;
|
|
4
4
|
type Null<T> = T | null;
|
|
@@ -18,11 +18,10 @@ type NumString = number | string;
|
|
|
18
18
|
type ArrayOf<T> = T | T[];
|
|
19
19
|
type TupleOf<T> = [T, T];
|
|
20
20
|
type FirstOf<T, U = boolean> = T[] | [U, ...T[]];
|
|
21
|
-
type
|
|
22
|
-
type BufferContent = string | Buffer;
|
|
21
|
+
type Bufferable = string | Buffer;
|
|
23
22
|
|
|
24
23
|
type AnyObject = Record<string, unknown>;
|
|
25
|
-
type PlainObject = Record<
|
|
24
|
+
type PlainObject = Record<string | number | symbol, unknown>;
|
|
26
25
|
|
|
27
26
|
type StandardMap = Record<string, any>;
|
|
28
27
|
type StringMap = Record<string, Undef<string>>;
|
package/lib/watch.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { DataSource, WatchResponse } from './squared';
|
|
|
3
3
|
import type { ExternalAsset } from './asset';
|
|
4
4
|
import type { IAbortComponent } from './core';
|
|
5
5
|
import type { PostFinalizeCallback } from './filemanager';
|
|
6
|
-
import type { SecureConfig } from './
|
|
6
|
+
import type { SecureConfig } from './http';
|
|
7
7
|
|
|
8
8
|
import type { WatchEventValue } from '../index.d';
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
27
27
|
always: boolean;
|
|
28
28
|
id?: string;
|
|
29
29
|
url?: URL;
|
|
30
|
-
document?:
|
|
30
|
+
document?: ArrayOf<string>;
|
|
31
31
|
main?: T;
|
|
32
32
|
bundleMain?: T;
|
|
33
33
|
sourceFiles?: string[];
|
|
@@ -44,7 +44,7 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
44
44
|
get server(): Null<ws.Server>;
|
|
45
45
|
set related(value);
|
|
46
46
|
get related(): T[];
|
|
47
|
-
get socketId():
|
|
47
|
+
get socketId(): ArrayOf<string>;
|
|
48
48
|
set etag(value: unknown);
|
|
49
49
|
get etag(): string;
|
|
50
50
|
set lastModified(value: unknown);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Type definitions for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,10 +20,9 @@
|
|
|
20
20
|
"license": "BSD 3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"bytes": "^3.1.2"
|
|
24
|
-
"uuid": "^9.0.1"
|
|
23
|
+
"bytes": "^3.1.2"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
|
-
"typescript": "5.
|
|
26
|
+
"typescript": "5.4.5"
|
|
28
27
|
}
|
|
29
28
|
}
|