@e-mc/types 0.13.9 → 0.13.10
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 +5 -5
- package/constant.d.ts +1 -1
- package/index.js +2 -2
- package/lib/cloud.d.ts +1 -0
- package/lib/document.d.ts +2 -1
- package/lib/module.d.ts +7 -2
- package/package.json +1 -1
- package/lib/compat-v4.d.ts +0 -121
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.13.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.13.10/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -209,10 +209,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
209
209
|
|
|
210
210
|
## References
|
|
211
211
|
|
|
212
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
213
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
214
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
215
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
212
|
+
- https://www.unpkg.com/@e-mc/types@0.13.10/index.d.ts
|
|
213
|
+
- https://www.unpkg.com/@e-mc/types@0.13.10/lib/logger.d.ts
|
|
214
|
+
- https://www.unpkg.com/@e-mc/types@0.13.10/lib/module.d.ts
|
|
215
|
+
- https://www.unpkg.com/@e-mc/types@0.13.10/lib/node.d.ts
|
|
216
216
|
|
|
217
217
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
218
218
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -904,7 +904,7 @@ function cloneObject(data, options) {
|
|
|
904
904
|
deepIgnore = options;
|
|
905
905
|
}
|
|
906
906
|
else if (options) {
|
|
907
|
-
({ target, deep, deepIgnore, mergeArray, typedArray, structured, inherited, nonenumerable, symbol, preserve } = options);
|
|
907
|
+
({ target, deep, deepIgnore, mergeArray, typedArray, structured, shared, inherited, nonenumerable, symbol, preserve } = options);
|
|
908
908
|
if (typeof options.freezeDepth === 'number') {
|
|
909
909
|
freezeDepth = options.freezeDepth - 1;
|
|
910
910
|
}
|
|
@@ -918,7 +918,7 @@ function cloneObject(data, options) {
|
|
|
918
918
|
let nested;
|
|
919
919
|
if (deep || freezeDepth > 0) {
|
|
920
920
|
deepIgnore ||= new WeakMap();
|
|
921
|
-
nested = { deep, deepIgnore, freezeDepth, mergeArray, mergeDepth, typedArray, structured, preserve };
|
|
921
|
+
nested = { deep, deepIgnore, freezeDepth, mergeArray, mergeDepth, typedArray, structured, shared, preserve };
|
|
922
922
|
}
|
|
923
923
|
if (Array.isArray(data)) {
|
|
924
924
|
if (deepIgnore instanceof WeakSet) {
|
package/lib/cloud.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export interface CloudStorageUpload<T = unknown, U = string, V = unknown, W = st
|
|
|
61
61
|
tags?: Record<string, string> | false;
|
|
62
62
|
options?: T;
|
|
63
63
|
fileGroup?: UploadContent[];
|
|
64
|
+
descendantsGroup?: string[];
|
|
64
65
|
localStorage?: boolean;
|
|
65
66
|
endpoint?: string;
|
|
66
67
|
all?: boolean;
|
package/lib/document.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { IDocument, IFileManager, IModule } from './index';
|
|
|
4
4
|
import type { ExternalAsset, InitialValue } from './asset';
|
|
5
5
|
import type { CloudStorage } from './cloud';
|
|
6
6
|
import type { LogComponent, LogDate } from './logger';
|
|
7
|
+
import type { DefaultAction } from './module';
|
|
7
8
|
import type { DocumentTransform } from './settings';
|
|
8
9
|
|
|
9
10
|
export interface DocumentAsset extends ExternalAsset, StorageAction<CloudStorage> {
|
|
@@ -199,7 +200,7 @@ export interface CustomizeOptions {
|
|
|
199
200
|
transform?: DocumentTransform;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
export interface AsSourceFileOptions extends EncodingAction {
|
|
203
|
+
export interface AsSourceFileOptions extends EncodingAction, DefaultAction {
|
|
203
204
|
cache?: boolean;
|
|
204
205
|
}
|
|
205
206
|
|
package/lib/module.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export interface RequireAction {
|
|
|
16
16
|
requireExt?: string | string[] | boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export interface DefaultAction {
|
|
20
|
+
default?: boolean;
|
|
21
|
+
url?: string | URL;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
export interface ThrowsAction {
|
|
20
25
|
throwsPermission?: boolean;
|
|
21
26
|
throwsDoesNotExist?: boolean;
|
|
@@ -41,7 +46,7 @@ export interface FileSystemOptions extends PermissionOptions, ThrowsAction {
|
|
|
41
46
|
ignorePermission?: boolean;
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction, EncodingAction {
|
|
49
|
+
export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction, EncodingAction, DefaultAction {
|
|
45
50
|
cache?: boolean;
|
|
46
51
|
}
|
|
47
52
|
|
|
@@ -68,7 +73,7 @@ export interface RemoveDirOptions extends FileSystemOptions {
|
|
|
68
73
|
export type MoveFileOptions = CopyFileOptions;
|
|
69
74
|
export type CreateDirOptions = FileSystemOptions;
|
|
70
75
|
|
|
71
|
-
export interface ParseFunctionOptions extends RequireAction {
|
|
76
|
+
export interface ParseFunctionOptions extends RequireAction, DefaultAction {
|
|
72
77
|
absolute?: boolean;
|
|
73
78
|
sync?: boolean;
|
|
74
79
|
external?: boolean;
|
package/package.json
CHANGED
package/lib/compat-v4.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { CloudConstructor, FileManagerConstructor, ICloud, IFileManager, IHost, IModule, ModuleConstructor, WatchConstructor } from './index';
|
|
2
|
-
|
|
3
|
-
import type { CloneObjectOptions } from '../index.d';
|
|
4
|
-
import type { ExternalAsset } from './asset';
|
|
5
|
-
import type { CacheOptions } from './core';
|
|
6
|
-
import type { QueryResult } from './db';
|
|
7
|
-
import type { ITransformSeries, OutV3, TransformSeriesConstructor } from './document';
|
|
8
|
-
import type { IHttpMemoryCache } from './filemanager';
|
|
9
|
-
import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
10
|
-
import type { ParseFunctionOptions } from './module';
|
|
11
|
-
import type { LogFailOptions, LogType, LogValue } from './logger';
|
|
12
|
-
import type { HostConfig, OpenOptions, ProxySettings } from './request';
|
|
13
|
-
import type { DbCoerceSettings, DnsLookupSettings, HttpMemorySettings, HttpSettings } from './settings';
|
|
14
|
-
|
|
15
|
-
import type { OutgoingHttpHeaders } from 'http';
|
|
16
|
-
import type { LookupFunction } from 'net';
|
|
17
|
-
import type { Readable, Writable } from 'stream';
|
|
18
|
-
|
|
19
|
-
type CpuUsage = NodeJS.CpuUsage;
|
|
20
|
-
|
|
21
|
-
export interface GetFunctionsOptions extends ParseFunctionOptions {
|
|
22
|
-
outFailed?: string[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IModuleLibV4 {
|
|
26
|
-
isString(value: unknown): value is string;
|
|
27
|
-
isObject<T = object>(value: unknown): value is T;
|
|
28
|
-
isPlainObject<T = PlainObject>(value: unknown): value is T;
|
|
29
|
-
escapePattern(value: unknown, lookBehind?: boolean): string;
|
|
30
|
-
generateUUID(format?: string, dictionary?: string): string;
|
|
31
|
-
validateUUID(value: unknown): boolean;
|
|
32
|
-
cloneObject<T, U = unknown>(data: T, options?: boolean | WeakSet<object> | CloneObjectOptions<U>): T;
|
|
33
|
-
coerceObject<T = unknown>(data: T, parseString?: FunctionType<unknown, string> | boolean, cache?: boolean): T;
|
|
34
|
-
asFunction<T = unknown, U = FunctionType<Promise<T> | T>>(value: unknown, sync?: boolean): Null<U>;
|
|
35
|
-
isFileHTTP(value: string | URL): boolean;
|
|
36
|
-
isFileUNC(value: string | URL): boolean;
|
|
37
|
-
isPathUNC(value: string | URL): boolean;
|
|
38
|
-
toTimeMs(hrtime: HighResolutionTime, format?: boolean): number | string;
|
|
39
|
-
renameExt(value: string, ext: string, when?: string): string;
|
|
40
|
-
existsSafe(value: string, isFile?: boolean): boolean;
|
|
41
|
-
readFileSafe(value: string, encoding: BufferEncoding | "buffer", cache?: boolean): Null<Bufferable>;
|
|
42
|
-
getFunctions<T extends FunctionType>(values: unknown[], absolute?: boolean | GetFunctionsOptions, sync?: boolean, outFailed?: string[]): T[];
|
|
43
|
-
formatSize(value: number | string, options?: PlainObject): number | string;
|
|
44
|
-
hasSameStat(src: string, dest: string, keepEmpty?: boolean): boolean;
|
|
45
|
-
hasSize(value: string, keepEmpty?: boolean): boolean;
|
|
46
|
-
getSize(value: string, diskUsed?: boolean): number;
|
|
47
|
-
byteLength(value: Bufferable, encoding?: BufferEncoding): number;
|
|
48
|
-
cleanupStream(target: Readable | Writable, pathname?: string): void;
|
|
49
|
-
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface IModuleCompatV4<T extends IHost = IHost> extends IModule<T> {
|
|
53
|
-
set startCPU(value);
|
|
54
|
-
get startCPU(): Null<CpuUsage>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface ModuleCompatV4Constructor extends ModuleConstructor, IModuleLibV4 {
|
|
58
|
-
readonly prototype: IModuleCompatV4;
|
|
59
|
-
new(...args: unknown[]): IModuleCompatV4;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface IFileManagerCompatV4<T extends ExternalAsset = ExternalAsset> extends IFileManager<T> {
|
|
63
|
-
archiving: boolean;
|
|
64
|
-
cacheHttpRequest: boolean | FirstOf<string>;
|
|
65
|
-
cacheHttpRequestBuffer: IHttpMemoryCache<T>;
|
|
66
|
-
fetchTimeout: number;
|
|
67
|
-
httpProxy: Null<ProxySettings>;
|
|
68
|
-
acceptEncoding: boolean;
|
|
69
|
-
keepAliveTimeout: number;
|
|
70
|
-
addDns(hostname: string, address: string, family?: number | string): void;
|
|
71
|
-
lookupDns(hostname: string): LookupFunction;
|
|
72
|
-
getHttpProxy(uri: string, localhost?: boolean): Null<ProxySettings>;
|
|
73
|
-
getHttpHeaders(uri: string): Undef<OutgoingHttpHeaders>;
|
|
74
|
-
createHttpRequest(uri: string | URL, options?: OpenOptions): HostConfig;
|
|
75
|
-
getHttpClient(uri: string | URL, options: OpenOptions): HttpRequestClient;
|
|
76
|
-
set httpVersion(value);
|
|
77
|
-
get httpVersion(): Null<HttpProtocolVersion>;
|
|
78
|
-
set ipVersion(value);
|
|
79
|
-
get ipVersion(): InternetProtocolVersion;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface FileManagerCompatV4Constructor<T extends ExternalAsset = ExternalAsset> extends FileManagerConstructor<T> {
|
|
83
|
-
fromHttpStatusCode(value: number | string): string;
|
|
84
|
-
resetHttpHost(version?: HttpProtocolVersion): void;
|
|
85
|
-
defineHttpBuffer(options: HttpMemorySettings): void;
|
|
86
|
-
defineHttpSettings(options: HttpSettings): void;
|
|
87
|
-
defineHttpAgent(options: HttpAgentSettings): void;
|
|
88
|
-
defineDnsLookup(options: DnsLookupSettings, clear?: boolean): void;
|
|
89
|
-
clearDnsLookup(): void;
|
|
90
|
-
getAria2Path(): string;
|
|
91
|
-
clearHttpBuffer(percent?: number, limit?: number): void;
|
|
92
|
-
readonly prototype: IFileManagerCompatV4<T>;
|
|
93
|
-
new(...args: unknown[]): IFileManagerCompatV4<T>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface ICloudCompatV4<T extends IHost = IHost> extends ICloud<T> {
|
|
97
|
-
getDatabaseResult(service: string, credential: unknown, queryString: string, options?: CacheOptions | boolean | string): Undef<QueryResult>;
|
|
98
|
-
setDatabaseResult(service: string, credential: unknown, queryString: string, result: unknown, options?: CacheOptions | string): QueryResult;
|
|
99
|
-
hasDatabaseCache(service: string, sessionKey?: string): boolean;
|
|
100
|
-
hasDatabaseCoerce(service: string, component: keyof DbCoerceSettings, credential?: unknown): boolean;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface CloudCompatV4Constructor extends CloudConstructor {
|
|
104
|
-
readonly prototype: ICloudCompatV4;
|
|
105
|
-
new(...args: unknown[]): ICloudCompatV4;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface WatchCompatV4Constructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset> extends WatchConstructor<T, U> {
|
|
109
|
-
readCACert(value: string, cache?: boolean): string;
|
|
110
|
-
readTLSKey(value: string, cache?: boolean): string;
|
|
111
|
-
readTLSCert(value: string, cache?: boolean): string;
|
|
112
|
-
isCert(value: string): boolean;
|
|
113
|
-
parseExpires(value: number | string, start?: number): number;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface ITransformSeriesCompatV4<T = AnyObject, U = T> extends ITransformSeries<T, U>, PropertyAction<OutV3, "out"> {}
|
|
117
|
-
|
|
118
|
-
export interface TransformSeriesCompatV4Constructor extends TransformSeriesConstructor {
|
|
119
|
-
readonly prototype: ITransformSeriesCompatV4;
|
|
120
|
-
new(...args: unknown[]): ITransformSeriesCompatV4;
|
|
121
|
-
}
|