@e-mc/types 0.8.19 → 0.8.21

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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2024 An Pham
1
+ Copyright 2023 An Pham
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.19/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.21/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { LogArguments } from "./lib/logger";
@@ -37,7 +37,7 @@ function isObject(value: unknown): value is object;
37
37
  function isPlainObject(value: unknown): value is Record<string | number | symbol, unknown>;
38
38
  function isString(value: unknown): value is string;
39
39
  function isEmpty(value: unknown): boolean;
40
- function asFunction(value: unknown, sync?: boolean): ((...args: unknown[]) => Promise<unknown> | unknown) | null;
40
+ function asFunction(value: unknown, sync?: boolean): ((...args: unknown[]) => unknown) | null;
41
41
  function parseTime(value: number | string, start?: number): number;
42
42
  function parseExpires(value: number | string, start?: number): number;
43
43
  function formatTime(value: number, char: string): string;
@@ -186,8 +186,8 @@ const IMPORT_MAP: Record<string, string | undefined>;
186
186
 
187
187
  ## References
188
188
 
189
- - https://www.unpkg.com/@e-mc/types@0.8.19/lib/logger.d.ts
190
- - https://www.unpkg.com/@e-mc/types@0.8.19/lib/module.d.ts
189
+ - https://www.unpkg.com/@e-mc/types@0.8.21/lib/logger.d.ts
190
+ - https://www.unpkg.com/@e-mc/types@0.8.21/lib/module.d.ts
191
191
 
192
192
  * https://nodejs.org/api/perf_hooks.html
193
193
  * https://www.npmjs.com/package/@types/bytes
package/constant.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const enum INTERNAL {
2
- VERSION = '0.8.19',
2
+ VERSION = '0.8.21',
3
3
  TEMP_DIR = 'tmp',
4
4
  CJS = '__cjs__'
5
5
  }
@@ -260,7 +260,6 @@ export const enum SETTINGS_KEY_NAME {
260
260
  NODE_REQUIRE_EXT = "node.require.ext",
261
261
  NODE_REQUIRE_NPM = "node.require.npm",
262
262
  NODE_REQUIRE_INLINE = "node.require.inline",
263
- NODE_PACKAGE_MANAGER = "node.settings.package_manager",
264
263
  TEMP_DIR = "temp.dir",
265
264
  TEMP_WRITE = "temp.write",
266
265
  PROCESS_PASSWORD = "process.password",
package/index.d.ts CHANGED
@@ -263,7 +263,7 @@ declare namespace types {
263
263
  function isPlainObject<T = PlainObject>(value: unknown): value is T;
264
264
  function isString(value: unknown): value is string;
265
265
  function isEmpty(value: unknown): boolean;
266
- function asFunction<U = unknown, V = unknown>(value: unknown, sync?: boolean): Null<FunctionType<Promise<U> | U, V>>;
266
+ function asFunction<U = unknown, V = unknown>(value: unknown, sync?: boolean): Null<FunctionType<U, V>>;
267
267
  function parseTime(value: NumString, start?: number): number;
268
268
  function parseExpires(value: NumString, start?: number): number;
269
269
  function formatTime(value: number, char: string): string;
package/lib/http.d.ts CHANGED
@@ -74,6 +74,11 @@ export const enum HTTP_STATUS {
74
74
  INVALID_SSL_CERTIFICATE = 526
75
75
  }
76
76
 
77
+ export interface AuthValue {
78
+ username?: string;
79
+ password?: string;
80
+ }
81
+
77
82
  export const enum QUERY_RESULT {
78
83
  FAIL,
79
84
  OK,
package/lib/index.d.ts CHANGED
@@ -30,12 +30,12 @@ import type { LookupFunction } from 'net';
30
30
  import type { SecureContextOptions } from 'tls';
31
31
  import type { ClientRequest, OutgoingHttpHeaders } from 'http';
32
32
  import type { BinaryLike } from 'crypto';
33
+ // @ts-ignore
34
+ import type { FileTypeResult } from 'file-type';
33
35
 
34
36
  import type * as EventEmitter from 'events';
35
-
36
37
  // @ts-ignore
37
38
  import type * as ws from 'ws';
38
- import type { FileTypeResult } from 'file-type';
39
39
 
40
40
  type BufferView = BufferContent | NodeJS.ArrayBufferView;
41
41
  type CpuUsage = NodeJS.CpuUsage;
package/lib/request.d.ts CHANGED
@@ -60,6 +60,7 @@ export interface OpenOptions extends KeepAliveAction, SilentAction {
60
60
  encoding?: BufferEncoding;
61
61
  format?: BufferFormat | { out?: BufferFormat; parser?: PlainObject };
62
62
  headers?: OutgoingHttpHeaders;
63
+ signal?: AbortSignal;
63
64
  timeout?: number;
64
65
  pipeTo?: string | Writable;
65
66
  postData?: unknown;
@@ -89,6 +90,7 @@ export interface FormDataPart {
89
90
  export interface Aria2Options extends BinaryAction, SilentAction {
90
91
  pathname?: string;
91
92
  headers?: OutgoingHttpHeaders;
93
+ signal?: AbortSignal;
92
94
  }
93
95
 
94
96
  export interface HostConfig extends OpenOptions {
package/lib/settings.d.ts CHANGED
@@ -36,7 +36,7 @@ export interface ClientSettings<T = PlainObject> extends PlainObject {
36
36
  cache_dir?: string;
37
37
  }
38
38
 
39
- export interface NodeModule<T = NodeSettings> extends HandlerSettings<T> {
39
+ export interface NodeModule<T = PlainObject> extends HandlerSettings<T> {
40
40
  process?: {
41
41
  cpu_usage?: boolean;
42
42
  memory_usage?: boolean;
@@ -49,10 +49,6 @@ export interface NodeModule<T = NodeSettings> extends HandlerSettings<T> {
49
49
  };
50
50
  }
51
51
 
52
- export interface NodeSettings extends PlainObject {
53
- package_manager?: "npm" | "yarn" | "pnpm";
54
- }
55
-
56
52
  export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
57
53
  env?: ProcessEnvConfig;
58
54
  thread?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/types",
3
- "version": "0.8.19",
3
+ "version": "0.8.21",
4
4
  "description": "Type definitions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",