@e-mc/types 0.7.13 → 0.7.14

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,121 +1,121 @@
1
- import type { LogStatus } from './squared';
2
-
3
- import type { LOG_TYPE, STATUS_TYPE } from '../index.d';
4
-
5
- // @ts-ignore
6
- import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
7
-
8
- type HexColor = `#${string}`;
9
-
10
- export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" | "timeStamp"> {
11
- type?: LogType;
12
- statusType?: StatusType;
13
- sessionId?: string;
14
- abortable?: boolean;
15
- titleJustify?: TextAlign;
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 LoggerFormat<T = NumString> {
36
- width?: T;
37
- color?: ForegroundColor;
38
- bg_color?: BackgroundColor;
39
- bg_alt_color?: BackgroundColor;
40
- bold?: boolean;
41
- justify?: TextAlign;
42
- unit?: string;
43
- }
44
-
45
- export interface LoggerStatus<T = boolean> {
46
- fatal?: T;
47
- error?: T;
48
- warn?: T;
49
- info?: T;
50
- debug?: T;
51
- trace?: T;
52
- }
53
-
54
- export interface LogOptions extends Partial<Pick<LogStatus<StatusType>, "duration" | "from" | "source">> {
55
- queue?: boolean;
56
- timeStamp?: LogDate;
57
- }
58
-
59
- export interface LogMessageOptions extends LogBaseOptions {
60
- failed?: boolean;
61
- useColor?: boolean;
62
- messageWidth?: number;
63
- messageUnit?: string;
64
- messageUnitMinWidth?: number;
65
- messageUnitIndent?: number | [number, string];
66
- progressBar?: boolean;
67
- alwaysVisible?: boolean;
68
- titleIndent?: boolean | number;
69
- }
70
-
71
- export interface LogFailOptions extends LogBaseOptions {
72
- exec?: ExecCommand;
73
- code?: string;
74
- fatal?: boolean;
75
- passThrough?: boolean;
76
- startTime?: LogTime;
77
- }
78
-
79
- export interface LogProcessOptions extends LogMessageOptions {
80
- bypassLog?: boolean;
81
- meterIncrement?: number;
82
- delayTime?: number | HighResolutionTime;
83
- }
84
-
85
- export interface LogTimeElapsedOptions extends LogMessageOptions {
86
- showCpu?: boolean;
87
- }
88
-
89
- export interface LogTypeValue {
90
- type: LogType;
91
- value: LogValue;
92
- timeStamp: number;
93
- sessionId?: string;
94
- }
95
-
96
- export interface LogArguments extends Pick<LogBaseOptions, "type" | "sessionId"> {
97
- title?: string;
98
- value?: LogValue;
99
- message?: unknown;
100
- }
101
-
102
- export interface ExecCommand {
103
- command: string;
104
- args?: string[];
105
- warn?: string[];
106
- }
107
-
108
- export type { LOG_TYPE, STATUS_TYPE };
109
- export type LogType = LOG_TYPE[keyof LOG_TYPE];
110
- export type StatusType = STATUS_TYPE[keyof STATUS_TYPE];
111
- export type StatusName = keyof typeof STATUS_TYPE;
112
- export type LogDate = Date | number;
113
- export type LogTime = LogDate | HighResolutionTime;
114
- export type LogValue = string | [string, Null<string>?];
115
- export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value" | "timeStamp" | "duration" | "from" | "source">>;
116
- export type BackgroundColor = typeof IBackgroundColor | HexColor;
117
- export type ForegroundColor = typeof IForegroundColor | HexColor;
118
- export type TextAlign = "left" | "center" | "right";
119
- export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
120
- export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
1
+ import type { LogStatus } from './squared';
2
+
3
+ import type { LOG_TYPE, STATUS_TYPE } from '../index.d';
4
+
5
+ // @ts-ignore
6
+ import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
7
+
8
+ type HexColor = `#${string}`;
9
+
10
+ export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" | "timeStamp"> {
11
+ type?: LogType;
12
+ statusType?: StatusType;
13
+ sessionId?: string;
14
+ abortable?: boolean;
15
+ titleJustify?: TextAlign;
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 LoggerFormat<T = NumString> {
36
+ width?: T;
37
+ color?: ForegroundColor;
38
+ bg_color?: BackgroundColor;
39
+ bg_alt_color?: BackgroundColor;
40
+ bold?: boolean;
41
+ justify?: TextAlign;
42
+ unit?: string;
43
+ }
44
+
45
+ export interface LoggerStatus<T = boolean> {
46
+ fatal?: T;
47
+ error?: T;
48
+ warn?: T;
49
+ info?: T;
50
+ debug?: T;
51
+ trace?: T;
52
+ }
53
+
54
+ export interface LogOptions extends Partial<Pick<LogStatus<StatusType>, "duration" | "from" | "source">> {
55
+ queue?: boolean;
56
+ timeStamp?: LogDate;
57
+ }
58
+
59
+ export interface LogMessageOptions extends LogBaseOptions {
60
+ failed?: boolean;
61
+ useColor?: boolean;
62
+ messageWidth?: number;
63
+ messageUnit?: string;
64
+ messageUnitMinWidth?: number;
65
+ messageUnitIndent?: number | [number, string];
66
+ progressBar?: boolean;
67
+ alwaysVisible?: boolean;
68
+ titleIndent?: boolean | number;
69
+ }
70
+
71
+ export interface LogFailOptions extends LogBaseOptions {
72
+ exec?: ExecCommand;
73
+ code?: string;
74
+ fatal?: boolean;
75
+ passThrough?: boolean;
76
+ startTime?: LogTime;
77
+ }
78
+
79
+ export interface LogProcessOptions extends LogMessageOptions {
80
+ bypassLog?: boolean;
81
+ meterIncrement?: number;
82
+ delayTime?: number | HighResolutionTime;
83
+ }
84
+
85
+ export interface LogTimeElapsedOptions extends LogMessageOptions {
86
+ showCpu?: boolean;
87
+ }
88
+
89
+ export interface LogTypeValue {
90
+ type: LogType;
91
+ value: LogValue;
92
+ timeStamp: number;
93
+ sessionId?: string;
94
+ }
95
+
96
+ export interface LogArguments extends Pick<LogBaseOptions, "type" | "sessionId"> {
97
+ title?: string;
98
+ value?: LogValue;
99
+ message?: unknown;
100
+ }
101
+
102
+ export interface ExecCommand {
103
+ command: string;
104
+ args?: string[];
105
+ warn?: string[];
106
+ }
107
+
108
+ export type { LOG_TYPE, STATUS_TYPE };
109
+ export type LogType = LOG_TYPE[keyof LOG_TYPE];
110
+ export type StatusType = STATUS_TYPE[keyof STATUS_TYPE];
111
+ export type StatusName = keyof typeof STATUS_TYPE;
112
+ export type LogDate = Date | number;
113
+ export type LogTime = LogDate | HighResolutionTime;
114
+ export type LogValue = string | [string, Null<string>?];
115
+ export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value" | "timeStamp" | "duration" | "from" | "source">>;
116
+ export type BackgroundColor = typeof IBackgroundColor | HexColor;
117
+ export type ForegroundColor = typeof IForegroundColor | HexColor;
118
+ export type TextAlign = "left" | "center" | "right";
119
+ export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
120
+ export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
121
121
  export type BroadcastValue = StringOfArray | { value: StringOfArray; stripAnsi?: boolean };
package/lib/module.d.ts CHANGED
@@ -1,121 +1,121 @@
1
- import type { ChecksumBase } from './squared';
2
-
3
- import type { HashOptions } from 'crypto';
4
-
5
- declare enum NORMALIZE_FLAGS {
6
- NONE = 0,
7
- RESOLVE = 1,
8
- ENSURE_DIR = 2,
9
- POSIX = 4
10
- }
11
-
12
- export interface RequireAction {
13
- requireExt?: StringOfArray | boolean;
14
- }
15
-
16
- export interface PermissionOptions {
17
- ownPermissionOnly?: boolean;
18
- hostPermissionOnly?: boolean;
19
- }
20
-
21
- export interface FileSystemOptions extends PermissionOptions {
22
- absolutePath?: boolean;
23
- ignorePermission?: boolean;
24
- throwsPermission?: boolean;
25
- throwsDoesNotExist?: boolean;
26
- }
27
-
28
- export interface ReadFileOptions extends FileSystemOptions, RequireAction {
29
- cache?: boolean;
30
- encoding?: BufferEncoding;
31
- }
32
-
33
- export interface WriteFileOptions extends FileSystemOptions {
34
- overwrite?: boolean;
35
- encoding?: BufferEncoding;
36
- }
37
-
38
- export interface DeleteFileOptions extends FileSystemOptions {
39
- emptyDir?: boolean;
40
- }
41
-
42
- export interface CopyFileOptions extends FileSystemOptions {
43
- overwrite?: boolean;
44
- createDir?: boolean;
45
- outSrc?: string;
46
- }
47
-
48
- export interface RemoveDirOptions extends FileSystemOptions {
49
- emptyDir?: boolean;
50
- recursive?: boolean;
51
- }
52
-
53
- export type MoveFileOptions = CopyFileOptions;
54
- export type CreateDirOptions = FileSystemOptions;
55
-
56
- export interface GetFunctionsOptions extends ParseFunctionOptions {
57
- outFailed?: string[];
58
- }
59
-
60
- export interface ParseFunctionOptions extends RequireAction {
61
- absolute?: boolean;
62
- sync?: boolean;
63
- external?: boolean;
64
- context?: unknown;
65
- }
66
-
67
- export interface CloneObjectOptions<T = unknown> {
68
- target?: T;
69
- deep?: boolean;
70
- deepIgnore?: WeakSet<object>;
71
- typedArray?: boolean;
72
- symbol?: boolean;
73
- inherited?: boolean;
74
- nonenumerable?: boolean;
75
- preserve?: boolean;
76
- }
77
-
78
- export interface CheckSemVerOptions extends MinMax {
79
- startDir?: string;
80
- unstable: boolean;
81
- }
82
-
83
- export interface CopyDirOptions {
84
- move?: boolean;
85
- recursive?: boolean | number;
86
- symFile?: boolean;
87
- symDir?: boolean;
88
- ignoreFile?: RegExp;
89
- ignoreDir?: RegExp;
90
- silent?: boolean;
91
- overwrite?: boolean;
92
- }
93
-
94
- export interface CopyDirResult {
95
- success: string[];
96
- failed: string[];
97
- ignored: string[];
98
- }
99
-
100
- export interface ReadHashOptions extends ChecksumBase {
101
- chunkSize?: number;
102
- minStreamSize?: number;
103
- }
104
-
105
- export interface AsHashOptions extends HashOptions, ChecksumBase {
106
- /** @deprecated */
107
- minLength?: number;
108
- }
109
-
110
- export interface GetTempDirOptions {
111
- pathname?: string;
112
- filename?: string;
113
- moduleDir?: boolean;
114
- uuidDir?: boolean;
115
- createDir?: boolean;
116
- increment?: number;
117
- }
118
-
119
- export type NormalizeFlags = typeof NORMALIZE_FLAGS[keyof typeof NORMALIZE_FLAGS];
120
- export type ReadFileCallback<T> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
1
+ import type { ChecksumBase } from './squared';
2
+
3
+ import type { HashOptions } from 'crypto';
4
+
5
+ declare enum NORMALIZE_FLAGS {
6
+ NONE = 0,
7
+ RESOLVE = 1,
8
+ ENSURE_DIR = 2,
9
+ POSIX = 4
10
+ }
11
+
12
+ export interface RequireAction {
13
+ requireExt?: StringOfArray | boolean;
14
+ }
15
+
16
+ export interface PermissionOptions {
17
+ ownPermissionOnly?: boolean;
18
+ hostPermissionOnly?: boolean;
19
+ }
20
+
21
+ export interface FileSystemOptions extends PermissionOptions {
22
+ absolutePath?: boolean;
23
+ ignorePermission?: boolean;
24
+ throwsPermission?: boolean;
25
+ throwsDoesNotExist?: boolean;
26
+ }
27
+
28
+ export interface ReadFileOptions extends FileSystemOptions, RequireAction {
29
+ cache?: boolean;
30
+ encoding?: BufferEncoding;
31
+ }
32
+
33
+ export interface WriteFileOptions extends FileSystemOptions {
34
+ overwrite?: boolean;
35
+ encoding?: BufferEncoding;
36
+ }
37
+
38
+ export interface DeleteFileOptions extends FileSystemOptions {
39
+ emptyDir?: boolean;
40
+ }
41
+
42
+ export interface CopyFileOptions extends FileSystemOptions {
43
+ overwrite?: boolean;
44
+ createDir?: boolean;
45
+ outSrc?: string;
46
+ }
47
+
48
+ export interface RemoveDirOptions extends FileSystemOptions {
49
+ emptyDir?: boolean;
50
+ recursive?: boolean;
51
+ }
52
+
53
+ export type MoveFileOptions = CopyFileOptions;
54
+ export type CreateDirOptions = FileSystemOptions;
55
+
56
+ export interface GetFunctionsOptions extends ParseFunctionOptions {
57
+ outFailed?: string[];
58
+ }
59
+
60
+ export interface ParseFunctionOptions extends RequireAction {
61
+ absolute?: boolean;
62
+ sync?: boolean;
63
+ external?: boolean;
64
+ context?: unknown;
65
+ }
66
+
67
+ export interface CloneObjectOptions<T = unknown> {
68
+ target?: T;
69
+ deep?: boolean;
70
+ deepIgnore?: WeakSet<object>;
71
+ typedArray?: boolean;
72
+ symbol?: boolean;
73
+ inherited?: boolean;
74
+ nonenumerable?: boolean;
75
+ preserve?: boolean;
76
+ }
77
+
78
+ export interface CheckSemVerOptions extends MinMax {
79
+ startDir?: string;
80
+ unstable?: boolean;
81
+ }
82
+
83
+ export interface CopyDirOptions {
84
+ move?: boolean;
85
+ recursive?: boolean | number;
86
+ symFile?: boolean;
87
+ symDir?: boolean;
88
+ ignoreFile?: RegExp;
89
+ ignoreDir?: RegExp;
90
+ silent?: boolean;
91
+ overwrite?: boolean;
92
+ }
93
+
94
+ export interface CopyDirResult {
95
+ success: string[];
96
+ failed: string[];
97
+ ignored: string[];
98
+ }
99
+
100
+ export interface ReadHashOptions extends ChecksumBase {
101
+ chunkSize?: number;
102
+ minStreamSize?: number;
103
+ }
104
+
105
+ export interface AsHashOptions extends HashOptions, ChecksumBase {
106
+ /** @deprecated */
107
+ minLength?: number;
108
+ }
109
+
110
+ export interface GetTempDirOptions {
111
+ pathname?: string;
112
+ filename?: string;
113
+ moduleDir?: boolean;
114
+ uuidDir?: boolean;
115
+ createDir?: boolean;
116
+ increment?: number;
117
+ }
118
+
119
+ export type NormalizeFlags = typeof NORMALIZE_FLAGS[keyof typeof NORMALIZE_FLAGS];
120
+ export type ReadFileCallback<T> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
121
121
  export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc";
package/lib/node.d.ts CHANGED
@@ -1,24 +1,24 @@
1
- import type { RequestData as IRequestData } from './squared';
2
-
3
- import type { ExternalAsset } from './asset';
4
- import type { HostInitConfig } from './core';
5
- import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
6
-
7
- type BoolString = boolean | string;
8
-
9
- export interface RequestData<T extends ExternalAsset = ExternalAsset> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig> {
10
- readonly assets?: T[];
11
- }
12
-
13
- export interface Settings {
14
- temp_dir?: string;
15
- temp?: TempModule;
16
- node?: NodeModule;
17
- process?: ProcessModule;
18
- permission?: PermissionModule;
19
- memory?: MemoryModule;
20
- download?: DownloadModule;
21
- request?: RequestModule;
22
- error?: ErrorModule;
23
- logger?: LoggerModule;
1
+ import type { RequestData as IRequestData } from './squared';
2
+
3
+ import type { ExternalAsset } from './asset';
4
+ import type { HostInitConfig } from './core';
5
+ import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
6
+
7
+ type BoolString = boolean | string;
8
+
9
+ export interface RequestData<T extends ExternalAsset = ExternalAsset> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig> {
10
+ readonly assets?: T[];
11
+ }
12
+
13
+ export interface Settings {
14
+ temp_dir?: string;
15
+ temp?: TempModule;
16
+ node?: NodeModule;
17
+ process?: ProcessModule;
18
+ permission?: PermissionModule;
19
+ memory?: MemoryModule;
20
+ download?: DownloadModule;
21
+ request?: RequestModule;
22
+ error?: ErrorModule;
23
+ logger?: LoggerModule;
24
24
  }