@e-mc/module 0.9.6 → 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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.9.6/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.0/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -17,15 +17,14 @@ import type { LogStatus } from "./squared";
17
17
  import type { IHost } from "./index";
18
18
  import type { IAbortComponent, IPermission } from "./core";
19
19
  import type { LOG_TYPE, STATUS_TYPE, ExecCommand, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogTime, LogType, LogValue, LoggerFormat, StatusType } from "./logger";
20
- import type { AsHashOptions, CheckSemVerOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, GetTempDirOptions, MoveFileOptions, NormalizeFlags, ParseFunctionOptions, PermissionOptions, ProtocolType, ReadBufferOptions, ReadFileCallback, ReadFileOptions, ReadHashOptions, ReadTextOptions, RemoveDirOptions, WriteFileOptions } from "./module";
20
+ import type { AsHashOptions, CheckSemVerOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, MoveFileOptions, ParseFunctionOptions, PermissionOptions, ProtocolType, ReadBufferOptions, ReadFileCallback, ReadFileOptions, ReadHashOptions, ReadTextOptions, RemoveDirOptions, TempDirOptions, WriteFileOptions } from "./module";
21
21
  import type { Settings } from "./node";
22
22
  import type { LoggerFormatSettings } from "/settings";
23
23
 
24
24
  import type { SpawnOptions } from "child_process";
25
- import type { BinaryLike } from "crypto";
25
+ import type { BinaryLike, HashOptions } from "crypto";
26
26
  import type { FileTypeResult } from "file-type";
27
27
  import type { NoParamCallback } from "fs";
28
-
29
28
  import type * as EventEmitter from "events";
30
29
 
31
30
  type BufferView = Buffer | string | NodeJS.ArrayBufferView;
@@ -34,9 +33,10 @@ type CpuUsage = NodeJS.CpuUsage;
34
33
  interface IModule extends EventEmitter, IAbortComponent {
35
34
  readonly status: LogStatus<StatusType>[];
36
35
  readonly errors: unknown[];
36
+ /** @deprecated Types.supported */
37
37
  supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
38
38
  supports(name: string, value?: boolean): boolean;
39
- getTempDir(options: GetTempDirOptions): string;
39
+ getTempDir(options: TempDirOptions): string;
40
40
  getTempDir(uuidDir: boolean, createDir: boolean): string;
41
41
  getTempDir(pathname: string, createDir: boolean): string;
42
42
  getTempDir(uuidDir: boolean, filename?: string, createDir?: boolean): string;
@@ -119,6 +119,8 @@ interface IModule extends EventEmitter, IAbortComponent {
119
119
  get sessionId(): string;
120
120
  set broadcastId(value);
121
121
  get broadcastId(): string | string[];
122
+ set silent(value);
123
+ get silent(): boolean;
122
124
  get logType(): LOG_TYPE;
123
125
  set logLevel(value: number | string);
124
126
  get logLevel(): number;
@@ -168,8 +170,10 @@ interface ModuleConstructor {
168
170
  readonly LOG_TYPE: LOG_TYPE;
169
171
  readonly LOG_FORMAT: LoggerFormatSettings<LoggerFormat<number>>;
170
172
  readonly STATUS_TYPE: STATUS_TYPE;
173
+ readonly PLATFORM_WIN32: boolean;
171
174
  readonly MAX_TIMEOUT: number;
172
175
  readonly TEMP_DIR: string;
176
+ /** @deprecated Types.supported */
173
177
  supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
174
178
  formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void;
175
179
  writeFail(value: LogValue, message?: unknown, options?: LogFailOptions | LogType): void;
@@ -177,10 +181,9 @@ interface ModuleConstructor {
177
181
  parseFunction(value: unknown, options?: ParseFunctionOptions): ((...args: unknown[]) => Promise<unknown> | unknown) | null;
178
182
  parseFunction(value: unknown, absolute: boolean, sync?: boolean): ((...args: unknown[]) => Promise<unknown> | unknown) | null;
179
183
  asString(value: unknown, cacheKey?: boolean | "throws"): string;
180
- asHash(data: BinaryLike, minLength: number): string;
181
- asHash(data: BinaryLike, algorithm: string, minLength?: number): string;
182
- asHash(data: BinaryLike, algorithm?: string, options?: AsHashOptions): string;
183
184
  asHash(data: BinaryLike, options?: AsHashOptions): string;
185
+ asHash(data: BinaryLike, algorithm?: string, options?: AsHashOptions): string;
186
+ asHash(data: BinaryLike, algorithm?: string, digest?: BinaryToTextEncoding): string;
184
187
  readHash(value: string | URL, options?: ReadHashOptions): Promise<string>;
185
188
  toPosix(value: unknown, normalize: boolean): string;
186
189
  toPosix(value: unknown, filename?: string, normalize?: boolean): string;
@@ -196,7 +199,7 @@ interface ModuleConstructor {
196
199
  resolvePath(value: string, base: string | URL): string;
197
200
  joinPath(...values: [...paths: unknown[], normalize: boolean][]): string;
198
201
  joinPath(...values: unknown[]): string;
199
- normalizePath(value: unknown, flags?: boolean | NormalizeFlags): string;
202
+ normalizePath(value: unknown, flags?: boolean | number): string;
200
203
  createDir(value: string | URL, overwrite?: boolean): boolean;
201
204
  removeDir(value: string | URL, sinceCreated: number, recursive?: boolean): boolean;
202
205
  removeDir(value: string | URL, empty?: boolean, recursive?: boolean): boolean;
@@ -240,10 +243,9 @@ interface ModuleConstructor {
240
243
  ## Settings
241
244
 
242
245
  ```typescript
243
- import type { LogMessageOptions, LogTypeValue, LoggerStatus } from "./logger";
246
+ import type { BackgroundColor, ForegroundColor, LogMessageOptions, LogTypeValue, LoggerProgress, LoggerStatus } from "./logger";
244
247
  import type { LoggerProcessSettings } from "./settings";
245
248
 
246
- import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from "chalk";
247
249
  import type { BinaryLike, CipherGCMTypes } from "crypto";
248
250
  import type { SecureVersion } from "tls";
249
251
 
@@ -299,6 +301,7 @@ interface ErrorModule {
299
301
 
300
302
  interface TempModule {
301
303
  dir?: string;
304
+ env?: string;
302
305
  write?: boolean;
303
306
  }
304
307
 
@@ -313,6 +316,7 @@ interface LoggerModule {
313
316
  bg_color?: BackgroundColor;
314
317
  bold?: boolean;
315
318
  justify?: "left" | "center" | "right";
319
+ braces?: string;
316
320
  as?: StringMap;
317
321
  };
318
322
  value?: {
@@ -327,6 +331,7 @@ interface LoggerModule {
327
331
  color?: ForegroundColor;
328
332
  bg_color?: BackgroundColor;
329
333
  bold?: boolean;
334
+ braces?: [string, string];
330
335
  as?: StringMap;
331
336
  unit?: "auto" | "s" | "ms";
332
337
  };
@@ -335,6 +340,7 @@ interface LoggerModule {
335
340
  color?: ForegroundColor;
336
341
  bg_color?: BackgroundColor;
337
342
  bold?: boolean;
343
+ braces?: [string, string];
338
344
  };
339
345
  meter?: {
340
346
  color?: ForegroundColor;
@@ -342,6 +348,12 @@ interface LoggerModule {
342
348
  bg_alt_color?: BackgroundColor;
343
349
  bold?: boolean;
344
350
  };
351
+ error?: {
352
+ color?: ForegroundColor;
353
+ alt_color?: ForegroundColor;
354
+ bg_color?: BackgroundColor;
355
+ braces?: [string, string];
356
+ };
345
357
  };
346
358
  meter?: {
347
359
  http?: number;
@@ -367,6 +379,7 @@ interface LoggerModule {
367
379
  stdout?: boolean;
368
380
  abort?: boolean;
369
381
  status?: boolean | LoggerStatus;
382
+ progress?: LoggerProgress;
370
383
  unknown?: boolean | LoggerColor;
371
384
  system?: boolean | LoggerColor;
372
385
  process?: boolean | LoggerProcessSettings;
@@ -384,18 +397,15 @@ interface LoggerModule {
384
397
  session_id?: boolean | number;
385
398
  stack_trace?: boolean | number;
386
399
  }
387
-
388
- type BackgroundColor = typeof IBackgroundColor | `#${string}`;
389
- type ForegroundColor = typeof IForegroundColor | `#${string}`;
390
400
  ```
391
401
 
392
402
  ## References
393
403
 
394
- - https://www.unpkg.com/@e-mc/types@0.9.6/lib/core.d.ts
395
- - https://www.unpkg.com/@e-mc/types@0.9.6/lib/logger.d.ts
396
- - https://www.unpkg.com/@e-mc/types@0.9.6/lib/module.d.ts
397
- - https://www.unpkg.com/@e-mc/types@0.9.6/lib/node.d.ts
398
- - https://www.unpkg.com/@e-mc/types@0.9.6/lib/settings.d.ts
404
+ - https://www.unpkg.com/@e-mc/types@0.10.0/lib/core.d.ts
405
+ - https://www.unpkg.com/@e-mc/types@0.10.0/lib/logger.d.ts
406
+ - https://www.unpkg.com/@e-mc/types@0.10.0/lib/module.d.ts
407
+ - https://www.unpkg.com/@e-mc/types@0.10.0/lib/node.d.ts
408
+ - https://www.unpkg.com/@e-mc/types@0.10.0/lib/settings.d.ts
399
409
 
400
410
  * https://www.npmjs.com/package/@types/node
401
411
 
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ModuleConstructor } from '../types/lib';
2
-
3
- declare const Module: ModuleConstructor;
4
-
1
+ import type { ModuleConstructor } from '../types/lib';
2
+
3
+ declare const Module: ModuleConstructor;
4
+
5
5
  export = Module;