@e-mc/types 0.9.9 → 0.9.11
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 +10 -10
- package/README.md +204 -204
- package/constant.d.ts +310 -309
- package/index.d.ts +323 -323
- package/index.js +3 -3
- package/lib/asset.d.ts +76 -76
- package/lib/cloud.d.ts +106 -106
- package/lib/compat-v4.d.ts +115 -115
- package/lib/compress.d.ts +24 -24
- package/lib/core.d.ts +195 -195
- package/lib/db.d.ts +105 -105
- package/lib/document.d.ts +197 -197
- package/lib/filemanager.d.ts +121 -121
- package/lib/http.d.ts +114 -114
- package/lib/index.d.ts +784 -783
- package/lib/logger.d.ts +110 -110
- package/lib/module.d.ts +144 -144
- package/lib/node.d.ts +21 -21
- package/lib/object.d.ts +31 -31
- package/lib/request.d.ts +136 -134
- package/lib/settings.d.ts +471 -467
- package/lib/squared.d.ts +375 -375
- package/lib/type.d.ts +31 -31
- package/lib/watch.d.ts +77 -77
- package/package.json +28 -28
- package/lib/dom.d.ts +0 -9
package/lib/asset.d.ts
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import type { BundleAction, FileAsset, LocationUri, MimeTypeAction } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { IFileManager, IModule } from './index';
|
|
4
|
-
import type { IAbortComponent } from './core';
|
|
5
|
-
import type { FetchType } from './filemanager';
|
|
6
|
-
|
|
7
|
-
interface ProcessInit {
|
|
8
|
-
threadCount: number;
|
|
9
|
-
startTime: number;
|
|
10
|
-
timeout: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface BinaryAction {
|
|
14
|
-
binOpts?: string[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface StreamAction {
|
|
18
|
-
minStreamSize?: NumString;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface FileData<T extends ExternalAsset> extends MimeTypeAction {
|
|
22
|
-
file: T;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface FileCommand<T extends ExternalAsset> extends FileData<T> {
|
|
26
|
-
command?: string;
|
|
27
|
-
outputType?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface IFileThread<T extends ExternalAsset = ExternalAsset> extends IAbortComponent, Required<FileData<T>> {
|
|
31
|
-
threadCount: number;
|
|
32
|
-
readonly startTime: number;
|
|
33
|
-
openThread(instance: IModule, timeout?: number): boolean;
|
|
34
|
-
closeThread(instance: IModule, callback?: FunctionType<void>): boolean;
|
|
35
|
-
getObject<U extends FileCommand<T>>(data?: PlainObject): U;
|
|
36
|
-
get host(): IFileManager<T>;
|
|
37
|
-
get queuedTasks(): FunctionType<void>[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface FileThreadConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
41
|
-
readonly prototype: IFileThread<T>;
|
|
42
|
-
new(host: IFileManager<T>, file: ExternalAsset, threadCount: number): IFileThread<T>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface OutputFinalize<T extends ExternalAsset> extends FileCommand<T> {
|
|
46
|
-
output: string;
|
|
47
|
-
baseDirectory?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface InitialValue extends Partial<LocationUri>, MimeTypeAction {
|
|
51
|
-
localUri?: string;
|
|
52
|
-
buffer?: Buffer;
|
|
53
|
-
etag?: string;
|
|
54
|
-
cacheable?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface ExternalAsset extends FileAsset, BundleAction, BinaryAction, StreamAction {
|
|
58
|
-
id?: number;
|
|
59
|
-
url?: URL;
|
|
60
|
-
socketPath?: string;
|
|
61
|
-
buffer?: Null<Buffer>;
|
|
62
|
-
localUri?: string;
|
|
63
|
-
fetchType?: FetchType;
|
|
64
|
-
sourceUTF8?: string;
|
|
65
|
-
transforms?: string[];
|
|
66
|
-
descendants?: string[];
|
|
67
|
-
torrentFiles?: string[];
|
|
68
|
-
sourceFiles?: string[];
|
|
69
|
-
initialValue?: InitialValue;
|
|
70
|
-
processModule?: ObjectMap<ProcessInit>;
|
|
71
|
-
etag?: string;
|
|
72
|
-
lastModified?: string;
|
|
73
|
-
contentLength?: number;
|
|
74
|
-
invalid?: boolean;
|
|
75
|
-
}
|
|
76
|
-
|
|
1
|
+
import type { BundleAction, FileAsset, LocationUri, MimeTypeAction } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { IFileManager, IModule } from './index';
|
|
4
|
+
import type { IAbortComponent } from './core';
|
|
5
|
+
import type { FetchType } from './filemanager';
|
|
6
|
+
|
|
7
|
+
interface ProcessInit {
|
|
8
|
+
threadCount: number;
|
|
9
|
+
startTime: number;
|
|
10
|
+
timeout: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface BinaryAction {
|
|
14
|
+
binOpts?: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface StreamAction {
|
|
18
|
+
minStreamSize?: NumString;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface FileData<T extends ExternalAsset> extends MimeTypeAction {
|
|
22
|
+
file: T;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FileCommand<T extends ExternalAsset> extends FileData<T> {
|
|
26
|
+
command?: string;
|
|
27
|
+
outputType?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IFileThread<T extends ExternalAsset = ExternalAsset> extends IAbortComponent, Required<FileData<T>> {
|
|
31
|
+
threadCount: number;
|
|
32
|
+
readonly startTime: number;
|
|
33
|
+
openThread(instance: IModule, timeout?: number): boolean;
|
|
34
|
+
closeThread(instance: IModule, callback?: FunctionType<void>): boolean;
|
|
35
|
+
getObject<U extends FileCommand<T>>(data?: PlainObject): U;
|
|
36
|
+
get host(): IFileManager<T>;
|
|
37
|
+
get queuedTasks(): FunctionType<void>[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface FileThreadConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
41
|
+
readonly prototype: IFileThread<T>;
|
|
42
|
+
new(host: IFileManager<T>, file: ExternalAsset, threadCount: number): IFileThread<T>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface OutputFinalize<T extends ExternalAsset> extends FileCommand<T> {
|
|
46
|
+
output: string;
|
|
47
|
+
baseDirectory?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface InitialValue extends Partial<LocationUri>, MimeTypeAction {
|
|
51
|
+
localUri?: string;
|
|
52
|
+
buffer?: Buffer;
|
|
53
|
+
etag?: string;
|
|
54
|
+
cacheable?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ExternalAsset extends FileAsset, BundleAction, BinaryAction, StreamAction {
|
|
58
|
+
id?: number;
|
|
59
|
+
url?: URL;
|
|
60
|
+
socketPath?: string;
|
|
61
|
+
buffer?: Null<Buffer>;
|
|
62
|
+
localUri?: string;
|
|
63
|
+
fetchType?: FetchType;
|
|
64
|
+
sourceUTF8?: string;
|
|
65
|
+
transforms?: string[];
|
|
66
|
+
descendants?: string[];
|
|
67
|
+
torrentFiles?: string[];
|
|
68
|
+
sourceFiles?: string[];
|
|
69
|
+
initialValue?: InitialValue;
|
|
70
|
+
processModule?: ObjectMap<ProcessInit>;
|
|
71
|
+
etag?: string;
|
|
72
|
+
lastModified?: string;
|
|
73
|
+
contentLength?: number;
|
|
74
|
+
invalid?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
77
|
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha224" | "sha384" | "sha512";
|
package/lib/cloud.d.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import type { DbDataSource, LocationUri, StorageAction } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { ExternalAsset, StreamAction } from './asset';
|
|
4
|
-
import type { ExecuteAction } from './db';
|
|
5
|
-
|
|
6
|
-
export interface UploadAction {
|
|
7
|
-
cloudUrl?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface CloudAsset<T = CloudStorage> extends ExternalAsset, UploadAction, StorageAction<T> {}
|
|
11
|
-
|
|
12
|
-
export interface CloudService<T = unknown, U = string> {
|
|
13
|
-
service: U;
|
|
14
|
-
credential?: T;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface CloudDatabase<T = unknown, U = PlainObject, V = unknown, W = unknown, X = unknown> extends CloudService<X>, Omit<DbDataSource<T, U, V>, "credential" | "parallel" | "withCommand" | "usePool">, ExecuteAction<W> {
|
|
18
|
-
id?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface CloudStorage<T = unknown, U = string> extends CloudService<T, U> {
|
|
22
|
-
bucket?: string;
|
|
23
|
-
admin?: CloudStorageAdmin;
|
|
24
|
-
upload?: CloudStorageUpload;
|
|
25
|
-
download?: CloudStorageDownload;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface CloudStorageAdmin<T = unknown, U = string, V = unknown, W = unknown, X = unknown, Y = unknown> extends CloudStorageACL<U> {
|
|
29
|
-
emptyBucket?: boolean;
|
|
30
|
-
configBucket?: {
|
|
31
|
-
create?: T;
|
|
32
|
-
policy?: V;
|
|
33
|
-
tags?: unknown;
|
|
34
|
-
website?: BucketWebsiteOptions;
|
|
35
|
-
retentionPolicy?: W;
|
|
36
|
-
cors?: X;
|
|
37
|
-
lifecycle?: Y;
|
|
38
|
-
};
|
|
39
|
-
recursive?: boolean;
|
|
40
|
-
preservePath?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface CloudStorageAction<T = unknown, U = string, V = unknown, W = unknown, X = unknown, Y = unknown> extends Partial<LocationUri>, StreamAction {
|
|
44
|
-
active?: boolean;
|
|
45
|
-
overwrite?: boolean;
|
|
46
|
-
chunkSize?: NumString;
|
|
47
|
-
chunkLimit?: number;
|
|
48
|
-
flags?: number;
|
|
49
|
-
admin?: CloudStorageAdmin<T, U, V, W, X, Y>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface CloudStorageUpload<T = unknown, U = string, V = unknown, W = string, X = unknown, Y = unknown, Z = unknown> extends CloudStorageACL<U>, CloudStorageAction<V, W, unknown, X, Y, Z> {
|
|
53
|
-
buffer?: Null<Buffer>;
|
|
54
|
-
contentType?: string;
|
|
55
|
-
metadata?: Record<string, string>;
|
|
56
|
-
tags?: Record<string, string> | false;
|
|
57
|
-
options?: T;
|
|
58
|
-
fileGroup?: UploadContent[];
|
|
59
|
-
localStorage?: boolean;
|
|
60
|
-
endpoint?: string;
|
|
61
|
-
all?: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface CloudStorageACL<T = string> {
|
|
65
|
-
publicRead?: boolean | 0;
|
|
66
|
-
acl?: T;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface CloudStorageDownload<T = unknown, U = unknown> extends CloudStorageAction {
|
|
70
|
-
keyname?: string;
|
|
71
|
-
versionId?: string;
|
|
72
|
-
options?: U;
|
|
73
|
-
deleteObject?: T;
|
|
74
|
-
waitStatus?: boolean;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface BucketWebsiteOptions {
|
|
78
|
-
indexPage?: string;
|
|
79
|
-
errorPage?: string;
|
|
80
|
-
indexPath?: string;
|
|
81
|
-
errorPath?: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface UploadData<T = unknown, U = string, V = unknown, W = string, X = unknown, Y = unknown, Z = unknown> extends BucketAction {
|
|
85
|
-
upload: CloudStorageUpload<T, U, V, W, X, Y, Z>;
|
|
86
|
-
localUri: string;
|
|
87
|
-
buffer: Buffer;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface DownloadData<T = unknown, U = unknown> extends BucketAction {
|
|
91
|
-
download: CloudStorageDownload<T, U>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface BucketAction {
|
|
95
|
-
bucket: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface UploadAssetOptions {
|
|
99
|
-
contentType?: string;
|
|
100
|
-
ignoreProcess?: boolean;
|
|
101
|
-
preferBuffer?: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export type UploadContent = [Bufferable, string, string?];
|
|
105
|
-
export type CloudSource = "atlas" | "aws" | "aws-v3" | "az" | "azure" | "gcp" | "gcloud" | "ibm" | "oci" | "minio";
|
|
106
|
-
export type CloudFeatures = "storage" | "database";
|
|
1
|
+
import type { DbDataSource, LocationUri, StorageAction } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { ExternalAsset, StreamAction } from './asset';
|
|
4
|
+
import type { ExecuteAction } from './db';
|
|
5
|
+
|
|
6
|
+
export interface UploadAction {
|
|
7
|
+
cloudUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CloudAsset<T = CloudStorage> extends ExternalAsset, UploadAction, StorageAction<T> {}
|
|
11
|
+
|
|
12
|
+
export interface CloudService<T = unknown, U = string> {
|
|
13
|
+
service: U;
|
|
14
|
+
credential?: T;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CloudDatabase<T = unknown, U = PlainObject, V = unknown, W = unknown, X = unknown> extends CloudService<X>, Omit<DbDataSource<T, U, V>, "credential" | "parallel" | "withCommand" | "usePool">, ExecuteAction<W> {
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CloudStorage<T = unknown, U = string> extends CloudService<T, U> {
|
|
22
|
+
bucket?: string;
|
|
23
|
+
admin?: CloudStorageAdmin;
|
|
24
|
+
upload?: CloudStorageUpload;
|
|
25
|
+
download?: CloudStorageDownload;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CloudStorageAdmin<T = unknown, U = string, V = unknown, W = unknown, X = unknown, Y = unknown> extends CloudStorageACL<U> {
|
|
29
|
+
emptyBucket?: boolean;
|
|
30
|
+
configBucket?: {
|
|
31
|
+
create?: T;
|
|
32
|
+
policy?: V;
|
|
33
|
+
tags?: unknown;
|
|
34
|
+
website?: BucketWebsiteOptions;
|
|
35
|
+
retentionPolicy?: W;
|
|
36
|
+
cors?: X;
|
|
37
|
+
lifecycle?: Y;
|
|
38
|
+
};
|
|
39
|
+
recursive?: boolean;
|
|
40
|
+
preservePath?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CloudStorageAction<T = unknown, U = string, V = unknown, W = unknown, X = unknown, Y = unknown> extends Partial<LocationUri>, StreamAction {
|
|
44
|
+
active?: boolean;
|
|
45
|
+
overwrite?: boolean;
|
|
46
|
+
chunkSize?: NumString;
|
|
47
|
+
chunkLimit?: number;
|
|
48
|
+
flags?: number;
|
|
49
|
+
admin?: CloudStorageAdmin<T, U, V, W, X, Y>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CloudStorageUpload<T = unknown, U = string, V = unknown, W = string, X = unknown, Y = unknown, Z = unknown> extends CloudStorageACL<U>, CloudStorageAction<V, W, unknown, X, Y, Z> {
|
|
53
|
+
buffer?: Null<Buffer>;
|
|
54
|
+
contentType?: string;
|
|
55
|
+
metadata?: Record<string, string>;
|
|
56
|
+
tags?: Record<string, string> | false;
|
|
57
|
+
options?: T;
|
|
58
|
+
fileGroup?: UploadContent[];
|
|
59
|
+
localStorage?: boolean;
|
|
60
|
+
endpoint?: string;
|
|
61
|
+
all?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CloudStorageACL<T = string> {
|
|
65
|
+
publicRead?: boolean | 0;
|
|
66
|
+
acl?: T;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CloudStorageDownload<T = unknown, U = unknown> extends CloudStorageAction {
|
|
70
|
+
keyname?: string;
|
|
71
|
+
versionId?: string;
|
|
72
|
+
options?: U;
|
|
73
|
+
deleteObject?: T;
|
|
74
|
+
waitStatus?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface BucketWebsiteOptions {
|
|
78
|
+
indexPage?: string;
|
|
79
|
+
errorPage?: string;
|
|
80
|
+
indexPath?: string;
|
|
81
|
+
errorPath?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface UploadData<T = unknown, U = string, V = unknown, W = string, X = unknown, Y = unknown, Z = unknown> extends BucketAction {
|
|
85
|
+
upload: CloudStorageUpload<T, U, V, W, X, Y, Z>;
|
|
86
|
+
localUri: string;
|
|
87
|
+
buffer: Buffer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface DownloadData<T = unknown, U = unknown> extends BucketAction {
|
|
91
|
+
download: CloudStorageDownload<T, U>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface BucketAction {
|
|
95
|
+
bucket: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface UploadAssetOptions {
|
|
99
|
+
contentType?: string;
|
|
100
|
+
ignoreProcess?: boolean;
|
|
101
|
+
preferBuffer?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type UploadContent = [Bufferable, string, string?];
|
|
105
|
+
export type CloudSource = "atlas" | "aws" | "aws-v3" | "az" | "azure" | "gcp" | "gcloud" | "ibm" | "oci" | "minio";
|
|
106
|
+
export type CloudFeatures = "storage" | "database";
|
|
107
107
|
export type CloudFunctions = "upload" | "download";
|
package/lib/compat-v4.d.ts
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import type { CloudConstructor, FileManagerConstructor, ICloud, IFileManager, IHost, IModule, ModuleConstructor, WatchConstructor } from './index';
|
|
2
|
-
|
|
3
|
-
import type { ExternalAsset } from './asset';
|
|
4
|
-
import type { CacheOptions } from './core';
|
|
5
|
-
import type { QueryResult } from './db';
|
|
6
|
-
import type { ITransformSeries, OutV3, TransformSeriesConstructor } from './document';
|
|
7
|
-
import type { IHttpMemoryCache } from './filemanager';
|
|
8
|
-
import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
9
|
-
import type { CloneObjectOptions, GetFunctionsOptions } from './module';
|
|
10
|
-
import type { LogFailOptions, LogType, LogValue } from './logger';
|
|
11
|
-
import type { HostConfig, OpenOptions, ProxySettings } from './request';
|
|
12
|
-
import type { DbCoerceSettings, DnsLookupSettings, HttpMemorySettings, HttpSettings } from './settings';
|
|
13
|
-
|
|
14
|
-
import type { OutgoingHttpHeaders } from 'http';
|
|
15
|
-
import type { LookupFunction } from 'net';
|
|
16
|
-
import type { Readable, Writable } from 'stream';
|
|
17
|
-
|
|
18
|
-
type CpuUsage = NodeJS.CpuUsage;
|
|
19
|
-
|
|
20
|
-
export interface IModuleLibV4 {
|
|
21
|
-
isString(value: unknown): value is string;
|
|
22
|
-
isObject<T = object>(value: unknown): value is T;
|
|
23
|
-
isPlainObject<T = PlainObject>(value: unknown): value is T;
|
|
24
|
-
escapePattern(value: unknown, lookBehind?: boolean): string;
|
|
25
|
-
generateUUID(format?: string, dictionary?: string): string;
|
|
26
|
-
validateUUID(value: unknown): boolean;
|
|
27
|
-
cloneObject<T, U = unknown>(data: T, options?: boolean | WeakSet<object> | CloneObjectOptions<U>): T;
|
|
28
|
-
coerceObject<T = unknown>(data: T, parseString?: FunctionType<unknown, string> | boolean, cache?: boolean): T;
|
|
29
|
-
asFunction<T = unknown, U = FunctionType<Promise<T> | T>>(value: unknown, sync?: boolean): Null<U>;
|
|
30
|
-
isFileHTTP(value: string | URL): boolean;
|
|
31
|
-
isFileUNC(value: string | URL): boolean;
|
|
32
|
-
isPathUNC(value: string | URL): boolean;
|
|
33
|
-
toTimeMs(hrtime: HighResolutionTime, format?: boolean): NumString;
|
|
34
|
-
renameExt(value: string, ext: string, when?: string): string;
|
|
35
|
-
existsSafe(value: string, isFile?: boolean): boolean;
|
|
36
|
-
readFileSafe(value: string, encoding: BufferEncoding | "buffer", cache?: boolean): Null<Bufferable>;
|
|
37
|
-
getFunctions<T extends FunctionType>(values: unknown[], absolute?: boolean | GetFunctionsOptions, sync?: boolean, outFailed?: string[]): T[];
|
|
38
|
-
formatSize(value: NumString, options?: PlainObject): NumString;
|
|
39
|
-
hasSameStat(src: string, dest: string, keepEmpty?: boolean): boolean;
|
|
40
|
-
hasSize(value: string, keepEmpty?: boolean): boolean;
|
|
41
|
-
getSize(value: string, diskUsed?: boolean): number;
|
|
42
|
-
byteLength(value: Bufferable, encoding?: BufferEncoding): number;
|
|
43
|
-
cleanupStream(target: Readable | Writable, pathname?: string): void;
|
|
44
|
-
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface IModuleCompatV4<T extends IHost = IHost> extends IModule<T> {
|
|
48
|
-
set startCPU(value);
|
|
49
|
-
get startCPU(): Null<CpuUsage>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ModuleCompatV4Constructor extends ModuleConstructor, IModuleLibV4 {
|
|
53
|
-
readonly prototype: IModuleCompatV4;
|
|
54
|
-
new(...args: unknown[]): IModuleCompatV4;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface IFileManagerCompatV4<T extends ExternalAsset = ExternalAsset> extends IFileManager<T> {
|
|
58
|
-
archiving: boolean;
|
|
59
|
-
cacheHttpRequest: boolean | FirstOf<string>;
|
|
60
|
-
cacheHttpRequestBuffer: IHttpMemoryCache<T>;
|
|
61
|
-
fetchTimeout: number;
|
|
62
|
-
httpProxy: Null<ProxySettings>;
|
|
63
|
-
acceptEncoding: boolean;
|
|
64
|
-
keepAliveTimeout: number;
|
|
65
|
-
addDns(hostname: string, address: string, family?: NumString): void;
|
|
66
|
-
lookupDns(hostname: string): LookupFunction;
|
|
67
|
-
getHttpProxy(uri: string, localhost?: boolean): Null<ProxySettings>;
|
|
68
|
-
getHttpHeaders(uri: string): Undef<OutgoingHttpHeaders>;
|
|
69
|
-
createHttpRequest(uri: string | URL, options?: OpenOptions): HostConfig;
|
|
70
|
-
getHttpClient(uri: string | URL, options: OpenOptions): HttpRequestClient;
|
|
71
|
-
set httpVersion(value);
|
|
72
|
-
get httpVersion(): Null<HttpProtocolVersion>;
|
|
73
|
-
set ipVersion(value);
|
|
74
|
-
get ipVersion(): InternetProtocolVersion;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface FileManagerCompatV4Constructor<T extends ExternalAsset = ExternalAsset> extends FileManagerConstructor<T> {
|
|
78
|
-
fromHttpStatusCode(value: NumString): string;
|
|
79
|
-
resetHttpHost(version?: HttpProtocolVersion): void;
|
|
80
|
-
defineHttpBuffer(options: HttpMemorySettings): void;
|
|
81
|
-
defineHttpSettings(options: HttpSettings): void;
|
|
82
|
-
defineHttpAgent(options: HttpAgentSettings): void;
|
|
83
|
-
defineDnsLookup(options: DnsLookupSettings, clear?: boolean): void;
|
|
84
|
-
clearDnsLookup(): void;
|
|
85
|
-
getAria2Path(): string;
|
|
86
|
-
clearHttpBuffer(percent?: number, limit?: number): void;
|
|
87
|
-
readonly prototype: IFileManagerCompatV4<T>;
|
|
88
|
-
new(...args: unknown[]): IFileManagerCompatV4<T>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface ICloudCompatV4<T extends IHost = IHost> extends ICloud<T> {
|
|
92
|
-
getDatabaseResult(service: string, credential: unknown, queryString: string, options?: CacheOptions | boolean | string): Undef<QueryResult>;
|
|
93
|
-
setDatabaseResult(service: string, credential: unknown, queryString: string, result: unknown, options?: CacheOptions | string): QueryResult;
|
|
94
|
-
hasDatabaseCache(service: string, sessionKey?: string): boolean;
|
|
95
|
-
hasDatabaseCoerce(service: string, component: keyof DbCoerceSettings, credential?: unknown): boolean;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface CloudCompatV4Constructor extends CloudConstructor {
|
|
99
|
-
readonly prototype: ICloudCompatV4;
|
|
100
|
-
new(...args: unknown[]): ICloudCompatV4;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface WatchCompatV4Constructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset> extends WatchConstructor<T, U> {
|
|
104
|
-
readCACert(value: string, cache?: boolean): string;
|
|
105
|
-
readTLSKey(value: string, cache?: boolean): string;
|
|
106
|
-
readTLSCert(value: string, cache?: boolean): string;
|
|
107
|
-
isCert(value: string): boolean;
|
|
108
|
-
parseExpires(value: NumString, start?: number): number;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface ITransformSeriesCompatV4<T = AnyObject, U = T> extends ITransformSeries<T, U>, PropertyAction<OutV3, "out"> {}
|
|
112
|
-
|
|
113
|
-
export interface TransformSeriesCompatV4Constructor extends TransformSeriesConstructor {
|
|
114
|
-
readonly prototype: ITransformSeriesCompatV4;
|
|
115
|
-
new(...args: unknown[]): ITransformSeriesCompatV4;
|
|
1
|
+
import type { CloudConstructor, FileManagerConstructor, ICloud, IFileManager, IHost, IModule, ModuleConstructor, WatchConstructor } from './index';
|
|
2
|
+
|
|
3
|
+
import type { ExternalAsset } from './asset';
|
|
4
|
+
import type { CacheOptions } from './core';
|
|
5
|
+
import type { QueryResult } from './db';
|
|
6
|
+
import type { ITransformSeries, OutV3, TransformSeriesConstructor } from './document';
|
|
7
|
+
import type { IHttpMemoryCache } from './filemanager';
|
|
8
|
+
import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
9
|
+
import type { CloneObjectOptions, GetFunctionsOptions } from './module';
|
|
10
|
+
import type { LogFailOptions, LogType, LogValue } from './logger';
|
|
11
|
+
import type { HostConfig, OpenOptions, ProxySettings } from './request';
|
|
12
|
+
import type { DbCoerceSettings, DnsLookupSettings, HttpMemorySettings, HttpSettings } from './settings';
|
|
13
|
+
|
|
14
|
+
import type { OutgoingHttpHeaders } from 'http';
|
|
15
|
+
import type { LookupFunction } from 'net';
|
|
16
|
+
import type { Readable, Writable } from 'stream';
|
|
17
|
+
|
|
18
|
+
type CpuUsage = NodeJS.CpuUsage;
|
|
19
|
+
|
|
20
|
+
export interface IModuleLibV4 {
|
|
21
|
+
isString(value: unknown): value is string;
|
|
22
|
+
isObject<T = object>(value: unknown): value is T;
|
|
23
|
+
isPlainObject<T = PlainObject>(value: unknown): value is T;
|
|
24
|
+
escapePattern(value: unknown, lookBehind?: boolean): string;
|
|
25
|
+
generateUUID(format?: string, dictionary?: string): string;
|
|
26
|
+
validateUUID(value: unknown): boolean;
|
|
27
|
+
cloneObject<T, U = unknown>(data: T, options?: boolean | WeakSet<object> | CloneObjectOptions<U>): T;
|
|
28
|
+
coerceObject<T = unknown>(data: T, parseString?: FunctionType<unknown, string> | boolean, cache?: boolean): T;
|
|
29
|
+
asFunction<T = unknown, U = FunctionType<Promise<T> | T>>(value: unknown, sync?: boolean): Null<U>;
|
|
30
|
+
isFileHTTP(value: string | URL): boolean;
|
|
31
|
+
isFileUNC(value: string | URL): boolean;
|
|
32
|
+
isPathUNC(value: string | URL): boolean;
|
|
33
|
+
toTimeMs(hrtime: HighResolutionTime, format?: boolean): NumString;
|
|
34
|
+
renameExt(value: string, ext: string, when?: string): string;
|
|
35
|
+
existsSafe(value: string, isFile?: boolean): boolean;
|
|
36
|
+
readFileSafe(value: string, encoding: BufferEncoding | "buffer", cache?: boolean): Null<Bufferable>;
|
|
37
|
+
getFunctions<T extends FunctionType>(values: unknown[], absolute?: boolean | GetFunctionsOptions, sync?: boolean, outFailed?: string[]): T[];
|
|
38
|
+
formatSize(value: NumString, options?: PlainObject): NumString;
|
|
39
|
+
hasSameStat(src: string, dest: string, keepEmpty?: boolean): boolean;
|
|
40
|
+
hasSize(value: string, keepEmpty?: boolean): boolean;
|
|
41
|
+
getSize(value: string, diskUsed?: boolean): number;
|
|
42
|
+
byteLength(value: Bufferable, encoding?: BufferEncoding): number;
|
|
43
|
+
cleanupStream(target: Readable | Writable, pathname?: string): void;
|
|
44
|
+
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IModuleCompatV4<T extends IHost = IHost> extends IModule<T> {
|
|
48
|
+
set startCPU(value);
|
|
49
|
+
get startCPU(): Null<CpuUsage>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ModuleCompatV4Constructor extends ModuleConstructor, IModuleLibV4 {
|
|
53
|
+
readonly prototype: IModuleCompatV4;
|
|
54
|
+
new(...args: unknown[]): IModuleCompatV4;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface IFileManagerCompatV4<T extends ExternalAsset = ExternalAsset> extends IFileManager<T> {
|
|
58
|
+
archiving: boolean;
|
|
59
|
+
cacheHttpRequest: boolean | FirstOf<string>;
|
|
60
|
+
cacheHttpRequestBuffer: IHttpMemoryCache<T>;
|
|
61
|
+
fetchTimeout: number;
|
|
62
|
+
httpProxy: Null<ProxySettings>;
|
|
63
|
+
acceptEncoding: boolean;
|
|
64
|
+
keepAliveTimeout: number;
|
|
65
|
+
addDns(hostname: string, address: string, family?: NumString): void;
|
|
66
|
+
lookupDns(hostname: string): LookupFunction;
|
|
67
|
+
getHttpProxy(uri: string, localhost?: boolean): Null<ProxySettings>;
|
|
68
|
+
getHttpHeaders(uri: string): Undef<OutgoingHttpHeaders>;
|
|
69
|
+
createHttpRequest(uri: string | URL, options?: OpenOptions): HostConfig;
|
|
70
|
+
getHttpClient(uri: string | URL, options: OpenOptions): HttpRequestClient;
|
|
71
|
+
set httpVersion(value);
|
|
72
|
+
get httpVersion(): Null<HttpProtocolVersion>;
|
|
73
|
+
set ipVersion(value);
|
|
74
|
+
get ipVersion(): InternetProtocolVersion;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface FileManagerCompatV4Constructor<T extends ExternalAsset = ExternalAsset> extends FileManagerConstructor<T> {
|
|
78
|
+
fromHttpStatusCode(value: NumString): string;
|
|
79
|
+
resetHttpHost(version?: HttpProtocolVersion): void;
|
|
80
|
+
defineHttpBuffer(options: HttpMemorySettings): void;
|
|
81
|
+
defineHttpSettings(options: HttpSettings): void;
|
|
82
|
+
defineHttpAgent(options: HttpAgentSettings): void;
|
|
83
|
+
defineDnsLookup(options: DnsLookupSettings, clear?: boolean): void;
|
|
84
|
+
clearDnsLookup(): void;
|
|
85
|
+
getAria2Path(): string;
|
|
86
|
+
clearHttpBuffer(percent?: number, limit?: number): void;
|
|
87
|
+
readonly prototype: IFileManagerCompatV4<T>;
|
|
88
|
+
new(...args: unknown[]): IFileManagerCompatV4<T>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ICloudCompatV4<T extends IHost = IHost> extends ICloud<T> {
|
|
92
|
+
getDatabaseResult(service: string, credential: unknown, queryString: string, options?: CacheOptions | boolean | string): Undef<QueryResult>;
|
|
93
|
+
setDatabaseResult(service: string, credential: unknown, queryString: string, result: unknown, options?: CacheOptions | string): QueryResult;
|
|
94
|
+
hasDatabaseCache(service: string, sessionKey?: string): boolean;
|
|
95
|
+
hasDatabaseCoerce(service: string, component: keyof DbCoerceSettings, credential?: unknown): boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface CloudCompatV4Constructor extends CloudConstructor {
|
|
99
|
+
readonly prototype: ICloudCompatV4;
|
|
100
|
+
new(...args: unknown[]): ICloudCompatV4;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface WatchCompatV4Constructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset> extends WatchConstructor<T, U> {
|
|
104
|
+
readCACert(value: string, cache?: boolean): string;
|
|
105
|
+
readTLSKey(value: string, cache?: boolean): string;
|
|
106
|
+
readTLSCert(value: string, cache?: boolean): string;
|
|
107
|
+
isCert(value: string): boolean;
|
|
108
|
+
parseExpires(value: NumString, start?: number): number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ITransformSeriesCompatV4<T = AnyObject, U = T> extends ITransformSeries<T, U>, PropertyAction<OutV3, "out"> {}
|
|
112
|
+
|
|
113
|
+
export interface TransformSeriesCompatV4Constructor extends TransformSeriesConstructor {
|
|
114
|
+
readonly prototype: ITransformSeriesCompatV4;
|
|
115
|
+
new(...args: unknown[]): ITransformSeriesCompatV4;
|
|
116
116
|
}
|
package/lib/compress.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { CompressFormat as ICompressFormat } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { LogBaseOptions, LogTime } from './logger';
|
|
4
|
-
|
|
5
|
-
type ResultCallback<T = Null<Buffer | Uint8Array>> = (err: unknown, data?: T, ext?: string) => void;
|
|
6
|
-
type ResultData = Null<Buffer | Uint8Array> | string;
|
|
7
|
-
|
|
8
|
-
export interface CompressFormat extends ICompressFormat, LogBaseOptions {
|
|
9
|
-
filename?: string;
|
|
10
|
-
startTime?: LogTime;
|
|
11
|
-
etag?: string;
|
|
12
|
-
proxyUrl?: string | ((uri: string) => Undef<string>);
|
|
13
|
-
outExt?: string;
|
|
14
|
-
outFile?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface Woff {
|
|
18
|
-
toWoff(this: void, data: BufferLike): Buffer;
|
|
19
|
-
toSfnt(this: void, data: BufferLike): Buffer;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type BufferLike = Buffer | Uint8Array | ArrayBuffer | SharedArrayBuffer | readonly number[];
|
|
23
|
-
export type TryFileCompressor = (data: string | Buffer, output: string, config: CompressFormat, callback?: ResultCallback<ResultData>) => Void<Promise<ResultData>>;
|
|
24
|
-
export type TryFileCompressorAsync = (data: string | Buffer, output: string, config: CompressFormat) => Promise<ResultData>;
|
|
1
|
+
import type { CompressFormat as ICompressFormat } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { LogBaseOptions, LogTime } from './logger';
|
|
4
|
+
|
|
5
|
+
type ResultCallback<T = Null<Buffer | Uint8Array>> = (err: unknown, data?: T, ext?: string) => void;
|
|
6
|
+
type ResultData = Null<Buffer | Uint8Array> | string;
|
|
7
|
+
|
|
8
|
+
export interface CompressFormat extends ICompressFormat, LogBaseOptions {
|
|
9
|
+
filename?: string;
|
|
10
|
+
startTime?: LogTime;
|
|
11
|
+
etag?: string;
|
|
12
|
+
proxyUrl?: string | ((uri: string) => Undef<string>);
|
|
13
|
+
outExt?: string;
|
|
14
|
+
outFile?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface Woff {
|
|
18
|
+
toWoff(this: void, data: BufferLike): Buffer;
|
|
19
|
+
toSfnt(this: void, data: BufferLike): Buffer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type BufferLike = Buffer | Uint8Array | ArrayBuffer | SharedArrayBuffer | readonly number[];
|
|
23
|
+
export type TryFileCompressor = (data: string | Buffer, output: string, config: CompressFormat, callback?: ResultCallback<ResultData>) => Void<Promise<ResultData>>;
|
|
24
|
+
export type TryFileCompressorAsync = (data: string | Buffer, output: string, config: CompressFormat) => Promise<ResultData>;
|
|
25
25
|
export type BufferResult = Null<Buffer | Uint8Array>;
|