@e-mc/types 0.9.10 → 0.9.12
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 +3 -3
- package/constant.d.ts +2 -1
- package/index.d.ts +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/module.d.ts +8 -0
- package/lib/settings.d.ts +5 -1
- package/package.json +1 -1
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.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.12/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -194,8 +194,8 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
194
194
|
|
|
195
195
|
## References
|
|
196
196
|
|
|
197
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
198
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
197
|
+
- https://www.unpkg.com/@e-mc/types@0.9.12/lib/logger.d.ts
|
|
198
|
+
- https://www.unpkg.com/@e-mc/types@0.9.12/lib/module.d.ts
|
|
199
199
|
|
|
200
200
|
* https://nodejs.org/api/perf_hooks.html
|
|
201
201
|
* 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.9.
|
|
2
|
+
VERSION = '0.9.12',
|
|
3
3
|
TEMP_DIR = 'tmp',
|
|
4
4
|
CJS = '__cjs__'
|
|
5
5
|
}
|
|
@@ -281,6 +281,7 @@ export const enum SETTINGS_KEY_NAME {
|
|
|
281
281
|
NODE_REQUIRE_EXT = "node.require.ext",
|
|
282
282
|
NODE_REQUIRE_NPM = "node.require.npm",
|
|
283
283
|
NODE_REQUIRE_INLINE = "node.require.inline",
|
|
284
|
+
NODE_PACKAGE_MANAGER = "node.settings.package_manager",
|
|
284
285
|
TEMP_DIR = "temp.dir",
|
|
285
286
|
TEMP_WRITE = "temp.write",
|
|
286
287
|
PROCESS_PASSWORD = "process.password",
|
package/index.d.ts
CHANGED
|
@@ -288,7 +288,7 @@ declare namespace types {
|
|
|
288
288
|
function isPlainObject<T = PlainObject>(value: unknown): value is T;
|
|
289
289
|
function isString(value: unknown): value is string;
|
|
290
290
|
function isEmpty(value: unknown): boolean;
|
|
291
|
-
function asFunction<
|
|
291
|
+
function asFunction<U = unknown, V = unknown>(value: unknown, sync?: boolean): Null<FunctionType<U, V>>;
|
|
292
292
|
function parseTime(value: NumString, start?: number): number;
|
|
293
293
|
function parseExpires(value: NumString, start?: number): number;
|
|
294
294
|
function formatTime(value: number, char: string): string;
|
package/lib/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { AssetContentOptions, ChecksumOptions, DeleteFileAddendum, FileOutp
|
|
|
15
15
|
import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
16
16
|
import type { CommandData, CropData, QualityData, ResizeData, RotateData, TransformOptions } from './image';
|
|
17
17
|
import type { ExecCommand, LOG_TYPE, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogState, LogTime, LogType, LogValue, STATUS_TYPE, StatusType } from './logger';
|
|
18
|
-
import type { AsHashOptions, CheckSemVerOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, GetTempDirOptions, MoveFileOptions, NormalizeFlags, ParseFunctionOptions, PermissionOptions, ProtocolType, ReadBufferOptions, ReadFileCallback, ReadFileOptions, ReadHashOptions, ReadTextOptions, RemoveDirOptions, WriteFileOptions } from './module';
|
|
18
|
+
import type { AsHashOptions, CheckSemVerOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, GetTempDirOptions, GlobDirOptions, MoveFileOptions, NormalizeFlags, ParseFunctionOptions, PermissionOptions, ProtocolType, ReadBufferOptions, ReadFileCallback, ReadFileOptions, ReadHashOptions, ReadTextOptions, RemoveDirOptions, WriteFileOptions } from './module';
|
|
19
19
|
import type { RequestData, Settings } from './node';
|
|
20
20
|
import type { ApplyOptions, Aria2Options, BufferFormat, DataEncodedResult, DataObjectResult, FormDataPart, HeadersOnCallback, HostConfig, OpenOptions, PostOptions, ProxySettings, ReadExpectType, RequestInit, StatusOnCallback } from './request';
|
|
21
21
|
import type { ClientModule, CloudAuthSettings, CloudModule, CloudServiceOptions, CompressModule, CompressSettings, DbCoerceSettings, DbModule, DbSourceOptions, DnsLookupSettings, DocumentComponent, DocumentComponentOption, DocumentModule, HandlerSettings, HttpConnectSettings, HttpMemorySettings, ImageModule, LoggerFormat, LoggerFormatSettings, PoolConfig, RequestModule, RequestSettings, TaskModule, WatchModule } from './settings';
|
|
@@ -720,8 +720,8 @@ declare namespace functions {
|
|
|
720
720
|
formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void;
|
|
721
721
|
writeFail(value: LogValue, message?: unknown, options?: LogFailOptions | LogType): void;
|
|
722
722
|
enabled(key: string, username?: string): boolean;
|
|
723
|
-
parseFunction<U = unknown>(value: unknown, options?: ParseFunctionOptions): Null<FunctionType<Promise<U> | U>>;
|
|
724
|
-
parseFunction<U = unknown>(value: unknown, absolute: boolean, sync?: boolean): Null<FunctionType<Promise<U> | U>>;
|
|
723
|
+
parseFunction<U = unknown, V = unknown>(value: unknown, options?: ParseFunctionOptions): Null<FunctionType<Promise<U> | U, V>>;
|
|
724
|
+
parseFunction<U = unknown, V = unknown>(value: unknown, absolute: boolean, sync?: boolean): Null<FunctionType<Promise<U> | U, V>>;
|
|
725
725
|
asString(value: unknown, cacheKey?: boolean | "throws"): string;
|
|
726
726
|
asHash(data: BinaryLike, options: AsHashOptions): string;
|
|
727
727
|
asHash(data: BinaryLike, algorithm?: unknown, digest?: unknown): string;
|
|
@@ -746,6 +746,8 @@ declare namespace functions {
|
|
|
746
746
|
removeDir(value: string | URL, empty?: boolean, recursive?: boolean): boolean;
|
|
747
747
|
copyDir(src: string | URL, dest: string | URL, move?: boolean, recursive?: boolean): Promise<CopyDirResult>;
|
|
748
748
|
copyDir(src: string | URL, dest: string | URL, options?: CopyDirOptions): Promise<CopyDirResult>;
|
|
749
|
+
globDir(src: string | URL, pattern: ArrayOf<string>, recursive: boolean | number): Promise<string[]>;
|
|
750
|
+
globDir(src: string | URL, pattern: ArrayOf<string>, options?: GlobDirOptions): Promise<string[]>;
|
|
749
751
|
renameFile(src: string | URL, dest: string | URL, throws?: boolean): boolean;
|
|
750
752
|
streamFile<U extends Bufferable>(value: string | URL, cache: boolean): Promise<U>;
|
|
751
753
|
streamFile<U extends ReadBufferOptions>(value: string | URL, options: U): Promise<U extends { encoding: string } ? string : Buffer>;
|
package/lib/module.d.ts
CHANGED
|
@@ -101,6 +101,14 @@ export interface CopyDirResult {
|
|
|
101
101
|
ignored: string[];
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
export interface GlobDirOptions {
|
|
105
|
+
exclude?: ArrayOf<string>;
|
|
106
|
+
recursive?: boolean | number;
|
|
107
|
+
matchBase?: boolean;
|
|
108
|
+
dot?: boolean;
|
|
109
|
+
contains?: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
104
112
|
export interface StreamBase extends StreamAction {
|
|
105
113
|
signal?: AbortSignal;
|
|
106
114
|
}
|
package/lib/settings.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface ClientSettings<T = PlainObject> extends PlainObject {
|
|
|
38
38
|
cache_dir?: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export interface NodeModule<T =
|
|
41
|
+
export interface NodeModule<T = NodeSettings> extends HandlerSettings<T> {
|
|
42
42
|
process?: {
|
|
43
43
|
cpu_usage?: boolean;
|
|
44
44
|
memory_usage?: boolean;
|
|
@@ -51,6 +51,10 @@ export interface NodeModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
export interface NodeSettings extends PlainObject {
|
|
55
|
+
package_manager?: "npm" | "yarn" | "pnpm";
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
55
59
|
env?: ProcessEnvConfig;
|
|
56
60
|
thread?: {
|