@e-mc/types 0.10.1 → 0.10.3

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
@@ -1,114 +1,114 @@
1
- import type { LogStatus } from './squared';
2
-
3
- import type { LOG_STATE, LOG_TYPE, STATUS_TYPE } from '../index.d';
4
-
5
- import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
6
-
7
- type HexColor = `#${string}`;
8
-
9
- export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" | "timeStamp"> {
10
- type?: LogType;
11
- statusType?: StatusType;
12
- sessionId?: string;
13
- abortable?: boolean;
14
- titleJustify?: TextAlign;
15
- rawOutput?: boolean;
16
- broadcastId?: BroadcastValue;
17
- newline?: boolean | number;
18
- }
19
-
20
- export interface LoggerColor {
21
- titleColor?: ForegroundColor;
22
- titleBgColor?: BackgroundColor;
23
- titleBold?: boolean;
24
- valueColor?: ForegroundColor;
25
- valueBgColor?: BackgroundColor;
26
- valueBold?: boolean;
27
- hintColor?: ForegroundColor;
28
- hintBgColor?: BackgroundColor;
29
- hintBold?: boolean;
30
- messageColor?: ForegroundColor;
31
- messageBgColor?: BackgroundColor;
32
- messageBold?: boolean;
33
- }
34
-
35
- export interface LoggerStatus<T = boolean> {
36
- fatal?: T;
37
- error?: T;
38
- warn?: T;
39
- info?: T;
40
- debug?: T;
41
- trace?: T;
42
- }
43
-
44
- export interface LogOptions extends Partial<Pick<LogStatus<StatusType>, "duration" | "from" | "source">> {
45
- queue?: boolean;
46
- timeStamp?: LogDate;
47
- }
48
-
49
- export interface LogMessageOptions extends LogBaseOptions {
50
- failed?: boolean;
51
- useColor?: boolean;
52
- messageWidth?: number;
53
- messageUnit?: string;
54
- messageUnitMinWidth?: number;
55
- messageUnitIndent?: number | [number, string];
56
- messageTextWrap?: boolean | TextWrapStyle;
57
- progressBar?: boolean;
58
- alwaysVisible?: boolean;
59
- titleIndent?: boolean | number;
60
- }
61
-
62
- export interface LogFailOptions extends LogBaseOptions {
63
- exec?: ExecCommand;
64
- code?: string;
65
- fatal?: boolean;
66
- passThrough?: boolean;
67
- startTime?: LogTime;
68
- }
69
-
70
- export interface LogProcessOptions extends LogMessageOptions {
71
- bypassLog?: boolean;
72
- meterIncrement?: number;
73
- delayTime?: number | HighResolutionTime;
74
- }
75
-
76
- export interface LogTimeElapsedOptions extends LogMessageOptions {
77
- showCpu?: boolean;
78
- }
79
-
80
- export interface LogTypeValue {
81
- type: LogType;
82
- value: LogValue;
83
- timeStamp: number;
84
- sessionId?: string;
85
- }
86
-
87
- export interface LogArguments extends Pick<LogBaseOptions, "type" | "sessionId"> {
88
- title?: string;
89
- value?: LogValue;
90
- message?: unknown;
91
- }
92
-
93
- export interface ExecCommand {
94
- command: string;
95
- args?: string[];
96
- warn?: string[];
97
- }
98
-
99
- export type { LOG_STATE, LOG_TYPE, STATUS_TYPE };
100
- export type LogType = LOG_TYPE[keyof LOG_TYPE];
101
- export type StatusType = STATUS_TYPE[keyof STATUS_TYPE];
102
- export type LogState = LOG_STATE[keyof LOG_STATE];
103
- export type StatusName = keyof typeof STATUS_TYPE;
104
- export type LogDate = Date | number;
105
- export type LogTime = LogDate | HighResolutionTime;
106
- export type LogValue = string | [string, Null<string>?];
107
- export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value" | "timeStamp" | "duration" | "from" | "source">>;
108
- export type BackgroundColor = typeof IBackgroundColor | HexColor;
109
- export type ForegroundColor = typeof IForegroundColor | HexColor;
110
- export type TextAlign = "left" | "center" | "right";
111
- export type TextWrapStyle = "ellipsis" | "nowrap" | "ellipsis-end" | "nowrap-end" | "none";
112
- export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
113
- export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
1
+ import type { LogStatus } from './squared';
2
+
3
+ import type { LOG_STATE, LOG_TYPE, STATUS_TYPE } from '../index.d';
4
+
5
+ import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
6
+
7
+ type HexColor = `#${string}`;
8
+
9
+ export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" | "timeStamp"> {
10
+ type?: LogType;
11
+ statusType?: StatusType;
12
+ sessionId?: string;
13
+ abortable?: boolean;
14
+ titleJustify?: TextAlign;
15
+ rawOutput?: boolean;
16
+ broadcastId?: BroadcastValue;
17
+ newline?: boolean | number;
18
+ }
19
+
20
+ export interface LoggerColor {
21
+ titleColor?: ForegroundColor;
22
+ titleBgColor?: BackgroundColor;
23
+ titleBold?: boolean;
24
+ valueColor?: ForegroundColor;
25
+ valueBgColor?: BackgroundColor;
26
+ valueBold?: boolean;
27
+ hintColor?: ForegroundColor;
28
+ hintBgColor?: BackgroundColor;
29
+ hintBold?: boolean;
30
+ messageColor?: ForegroundColor;
31
+ messageBgColor?: BackgroundColor;
32
+ messageBold?: boolean;
33
+ }
34
+
35
+ export interface LoggerStatus<T = boolean> {
36
+ fatal?: T;
37
+ error?: T;
38
+ warn?: T;
39
+ info?: T;
40
+ debug?: T;
41
+ trace?: T;
42
+ }
43
+
44
+ export interface LogOptions extends Partial<Pick<LogStatus<StatusType>, "duration" | "from" | "source">> {
45
+ queue?: boolean;
46
+ timeStamp?: LogDate;
47
+ }
48
+
49
+ export interface LogMessageOptions extends LogBaseOptions {
50
+ failed?: boolean;
51
+ useColor?: boolean;
52
+ messageWidth?: number;
53
+ messageUnit?: string;
54
+ messageUnitMinWidth?: number;
55
+ messageUnitIndent?: number | [number, string];
56
+ messageTextWrap?: boolean | TextWrapStyle;
57
+ progressBar?: boolean;
58
+ alwaysVisible?: boolean;
59
+ titleIndent?: boolean | number;
60
+ }
61
+
62
+ export interface LogFailOptions extends LogBaseOptions {
63
+ exec?: ExecCommand;
64
+ code?: string;
65
+ fatal?: boolean;
66
+ passThrough?: boolean;
67
+ startTime?: LogTime;
68
+ }
69
+
70
+ export interface LogProcessOptions extends LogMessageOptions {
71
+ bypassLog?: boolean;
72
+ meterIncrement?: number;
73
+ delayTime?: number | HighResolutionTime;
74
+ }
75
+
76
+ export interface LogTimeElapsedOptions extends LogMessageOptions {
77
+ showCpu?: boolean;
78
+ }
79
+
80
+ export interface LogTypeValue {
81
+ type: LogType;
82
+ value: LogValue;
83
+ timeStamp: number;
84
+ sessionId?: string;
85
+ }
86
+
87
+ export interface LogArguments extends Pick<LogBaseOptions, "type" | "sessionId"> {
88
+ title?: string;
89
+ value?: LogValue;
90
+ message?: unknown;
91
+ }
92
+
93
+ export interface ExecCommand {
94
+ command: string;
95
+ args?: string[];
96
+ warn?: string[];
97
+ }
98
+
99
+ export type { LOG_STATE, LOG_TYPE, STATUS_TYPE };
100
+ export type LogType = LOG_TYPE[keyof LOG_TYPE];
101
+ export type StatusType = STATUS_TYPE[keyof STATUS_TYPE];
102
+ export type LogState = LOG_STATE[keyof LOG_STATE];
103
+ export type StatusName = keyof typeof STATUS_TYPE;
104
+ export type LogDate = Date | number;
105
+ export type LogTime = LogDate | HighResolutionTime;
106
+ export type LogValue = string | [string, Null<string>?];
107
+ export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value" | "timeStamp" | "duration" | "from" | "source">>;
108
+ export type BackgroundColor = typeof IBackgroundColor | HexColor;
109
+ export type ForegroundColor = typeof IForegroundColor | HexColor;
110
+ export type TextAlign = "left" | "center" | "right";
111
+ export type TextWrapStyle = "ellipsis" | "nowrap" | "ellipsis-end" | "nowrap-end" | "none";
112
+ export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
113
+ export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
114
114
  export type BroadcastValue = ArrayOf<string> | { value: ArrayOf<string>; stripAnsi?: boolean };
package/lib/module.d.ts CHANGED
@@ -1,128 +1,138 @@
1
- import type { ChecksumBase } from './squared';
2
-
3
- import type { StreamAction } from './asset';
4
-
5
- import type { HashOptions } from 'crypto';
6
- import type { Readable } from 'stream';
7
-
8
- export const enum NORMALIZE_FLAGS {
9
- NONE = 0,
10
- RESOLVE = 1,
11
- ENSURE_DIR = 2,
12
- POSIX = 4
13
- }
14
-
15
- export interface RequireAction {
16
- requireExt?: ArrayOf<string> | boolean;
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
-
34
- export interface PermissionOptions {
35
- ownPermissionOnly?: boolean;
36
- hostPermissionOnly?: boolean;
37
- }
38
-
39
- export interface FileSystemOptions extends PermissionOptions, ThrowsAction {
40
- absolutePath?: boolean;
41
- ignorePermission?: boolean;
42
- }
43
-
44
- export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction {
45
- cache?: boolean;
46
- encoding?: BufferEncoding;
47
- }
48
-
49
- export interface WriteFileOptions extends FileSystemOptions {
50
- overwrite?: boolean;
51
- encoding?: BufferEncoding;
52
- }
53
-
54
- export interface DeleteFileOptions extends FileSystemOptions {
55
- emptyDir?: boolean;
56
- }
57
-
58
- export interface CopyFileOptions extends FileSystemOptions {
59
- overwrite?: boolean;
60
- createDir?: boolean;
61
- outSrc?: string;
62
- }
63
-
64
- export interface RemoveDirOptions extends FileSystemOptions {
65
- emptyDir?: boolean;
66
- recursive?: boolean;
67
- }
68
-
69
- export type MoveFileOptions = CopyFileOptions;
70
- export type CreateDirOptions = FileSystemOptions;
71
-
72
- export interface ParseFunctionOptions extends RequireAction {
73
- absolute?: boolean;
74
- sync?: boolean;
75
- external?: boolean;
76
- context?: unknown;
77
- }
78
-
79
- export interface CheckSemVerOptions extends MinMax {
80
- startDir?: string;
81
- unstable: boolean;
82
- }
83
-
84
- export interface CopyDirOptions {
85
- move?: boolean;
86
- recursive?: boolean | number;
87
- symFile?: boolean;
88
- symDir?: boolean;
89
- ignoreFile?: RegExp;
90
- ignoreDir?: RegExp;
91
- silent?: boolean;
92
- overwrite?: boolean;
93
- }
94
-
95
- export interface CopyDirResult {
96
- success: string[];
97
- failed: string[];
98
- ignored: string[];
99
- }
100
-
101
- export interface StreamBase extends StreamAction {
102
- signal?: AbortSignal;
103
- }
104
-
105
- export interface ReadHashOptions extends ChecksumBase, StreamBase {
106
- chunkSize?: number;
107
- }
108
-
109
- export interface ReadBufferOptions extends StreamBase {
110
- encoding?: BufferEncoding;
111
- cache?: boolean;
112
- }
113
-
114
- export interface AsHashOptions extends HashOptions, ChecksumBase {}
115
-
116
- export interface TempDirOptions {
117
- pathname?: string;
118
- filename?: string;
119
- moduleDir?: boolean;
120
- uuidDir?: boolean;
121
- createDir?: boolean;
122
- increment?: number;
123
- }
124
-
125
- export type ReadTextOptions = ReadBufferOptions;
126
- export type ReadFileCallback<T extends Bufferable = Bufferable> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
127
- export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc" | "file";
1
+ import type { ChecksumBase } from './squared';
2
+
3
+ import type { StreamAction } from './asset';
4
+
5
+ import type { HashOptions } from 'crypto';
6
+ import type { Readable } from 'stream';
7
+
8
+ export const enum NORMALIZE_FLAGS {
9
+ NONE = 0,
10
+ RESOLVE = 1,
11
+ ENSURE_DIR = 2,
12
+ POSIX = 4
13
+ }
14
+
15
+ export interface RequireAction {
16
+ requireExt?: ArrayOf<string> | boolean;
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
+
34
+ export interface PermissionOptions {
35
+ ownPermissionOnly?: boolean;
36
+ hostPermissionOnly?: boolean;
37
+ }
38
+
39
+ export interface FileSystemOptions extends PermissionOptions, ThrowsAction {
40
+ absolutePath?: boolean;
41
+ ignorePermission?: boolean;
42
+ }
43
+
44
+ export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction {
45
+ cache?: boolean;
46
+ encoding?: BufferEncoding;
47
+ }
48
+
49
+ export interface WriteFileOptions extends FileSystemOptions {
50
+ overwrite?: boolean;
51
+ encoding?: BufferEncoding;
52
+ }
53
+
54
+ export interface DeleteFileOptions extends FileSystemOptions {
55
+ emptyDir?: boolean;
56
+ }
57
+
58
+ export interface CopyFileOptions extends FileSystemOptions {
59
+ overwrite?: boolean;
60
+ createDir?: boolean;
61
+ outSrc?: string;
62
+ }
63
+
64
+ export interface RemoveDirOptions extends FileSystemOptions {
65
+ emptyDir?: boolean;
66
+ recursive?: boolean;
67
+ }
68
+
69
+ export type MoveFileOptions = CopyFileOptions;
70
+ export type CreateDirOptions = FileSystemOptions;
71
+
72
+ export interface ParseFunctionOptions extends RequireAction {
73
+ absolute?: boolean;
74
+ sync?: boolean;
75
+ external?: boolean;
76
+ context?: unknown;
77
+ }
78
+
79
+ export interface CheckSemVerOptions extends MinMax {
80
+ equals?: string;
81
+ includes?: boolean;
82
+ startDir?: string;
83
+ unstable?: boolean;
84
+ }
85
+
86
+ export interface CopyDirOptions {
87
+ move?: boolean;
88
+ recursive?: boolean | number;
89
+ symFile?: boolean;
90
+ symDir?: boolean;
91
+ ignoreFile?: RegExp;
92
+ ignoreDir?: RegExp;
93
+ silent?: boolean;
94
+ overwrite?: boolean;
95
+ }
96
+
97
+ export interface CopyDirResult {
98
+ success: string[];
99
+ failed: string[];
100
+ ignored: string[];
101
+ }
102
+
103
+ export interface GlobDirOptions {
104
+ exclude?: ArrayOf<string>;
105
+ recursive?: boolean | number;
106
+ matchBase?: boolean;
107
+ dot?: boolean;
108
+ contains?: boolean;
109
+ }
110
+
111
+ export interface StreamBase extends StreamAction {
112
+ signal?: AbortSignal;
113
+ }
114
+
115
+ export interface ReadHashOptions extends ChecksumBase, StreamBase {
116
+ chunkSize?: number;
117
+ }
118
+
119
+ export interface ReadBufferOptions extends StreamBase {
120
+ encoding?: BufferEncoding;
121
+ cache?: boolean;
122
+ }
123
+
124
+ export interface AsHashOptions extends HashOptions, ChecksumBase {}
125
+
126
+ export interface TempDirOptions {
127
+ pathname?: string;
128
+ filename?: string;
129
+ moduleDir?: boolean;
130
+ uuidDir?: boolean;
131
+ createDir?: boolean;
132
+ increment?: number;
133
+ }
134
+
135
+ export type ReadTextOptions = ReadBufferOptions;
136
+ export type ReadFileCallback<T extends Bufferable = Bufferable> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
137
+ export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc" | "file";
128
138
  export type FileTypeFormat = Bufferable | Uint8Array | ArrayBuffer | Readable;
package/lib/node.d.ts CHANGED
@@ -1,22 +1,22 @@
1
- import type { RequestData as IRequestData } from './squared';
2
-
3
- import type { ExternalAsset } from './asset';
4
- import type { HostInitConfig, HostInitLog } from './core';
5
- import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
6
-
7
- export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig<U>> {
8
- readonly assets?: T[];
9
- }
10
-
11
- export interface Settings {
12
- temp_dir?: string;
13
- temp?: TempModule;
14
- node?: NodeModule;
15
- process?: ProcessModule;
16
- permission?: PermissionModule;
17
- memory?: MemoryModule;
18
- download?: DownloadModule;
19
- request?: RequestModule;
20
- error?: ErrorModule;
21
- logger?: LoggerModule;
1
+ import type { RequestData as IRequestData } from './squared';
2
+
3
+ import type { ExternalAsset } from './asset';
4
+ import type { HostInitConfig, HostInitLog } from './core';
5
+ import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
6
+
7
+ export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig<U>> {
8
+ readonly assets?: T[];
9
+ }
10
+
11
+ export interface Settings {
12
+ temp_dir?: string;
13
+ temp?: TempModule;
14
+ node?: NodeModule;
15
+ process?: ProcessModule;
16
+ permission?: PermissionModule;
17
+ memory?: MemoryModule;
18
+ download?: DownloadModule;
19
+ request?: RequestModule;
20
+ error?: ErrorModule;
21
+ logger?: LoggerModule;
22
22
  }
package/lib/object.d.ts CHANGED
@@ -1,30 +1,30 @@
1
- interface Point {
2
- x: number;
3
- y: number;
4
- }
5
-
6
- interface Dimension {
7
- width: number;
8
- height: number;
9
- }
10
-
11
- interface KeyValue<T, U> {
12
- key: T;
13
- value: U;
14
- }
15
-
16
- interface ErrorCode extends Error {
17
- code?: unknown;
18
- }
19
-
20
- interface AuthValue {
21
- username?: string;
22
- password?: string;
23
- }
24
-
25
- interface MinMax<T = number> {
26
- min?: T;
27
- max?: T;
28
- }
29
-
1
+ interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+
6
+ interface Dimension {
7
+ width: number;
8
+ height: number;
9
+ }
10
+
11
+ interface KeyValue<T, U> {
12
+ key: T;
13
+ value: U;
14
+ }
15
+
16
+ interface ErrorCode extends Error {
17
+ code?: unknown;
18
+ }
19
+
20
+ interface AuthValue {
21
+ username?: string;
22
+ password?: string;
23
+ }
24
+
25
+ interface MinMax<T = number> {
26
+ min?: T;
27
+ max?: T;
28
+ }
29
+
30
30
  type HighResolutionTime = TupleOf<number>;