@e-mc/types 0.10.5 → 0.11.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/LICENSE +1 -1
- package/README.md +10 -9
- package/constant.d.ts +39 -10
- package/index.d.ts +33 -19
- package/index.js +75 -111
- package/lib/asset.d.ts +3 -3
- package/lib/cloud.d.ts +11 -4
- package/lib/compress.d.ts +12 -11
- package/lib/core.d.ts +31 -30
- package/lib/db.d.ts +20 -17
- package/lib/document.d.ts +17 -16
- package/lib/filemanager.d.ts +12 -11
- package/lib/http.d.ts +7 -6
- package/lib/image.d.ts +53 -43
- package/lib/index.d.ts +195 -170
- package/lib/logger.d.ts +7 -2
- package/lib/module.d.ts +31 -44
- package/lib/node.d.ts +9 -3
- package/lib/object.d.ts +1 -3
- package/lib/request.d.ts +96 -24
- package/lib/settings.d.ts +126 -90
- package/lib/squared.d.ts +25 -56
- package/lib/type.d.ts +11 -6
- package/lib/watch.d.ts +5 -5
- package/package.json +2 -2
- package/lib/compat-v4.d.ts +0 -116
package/lib/watch.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { SecureConfig } from './http';
|
|
|
7
7
|
|
|
8
8
|
import type { WatchEventValue } from '../index.d';
|
|
9
9
|
|
|
10
|
-
import type { ServerOptions } from 'https';
|
|
10
|
+
import type { ServerOptions } from 'node:https';
|
|
11
11
|
|
|
12
12
|
// @ts-ignore
|
|
13
13
|
import type * as ws from 'ws';
|
|
@@ -27,7 +27,7 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
27
27
|
always: boolean;
|
|
28
28
|
id?: string;
|
|
29
29
|
url?: URL;
|
|
30
|
-
document?:
|
|
30
|
+
document?: string | string[];
|
|
31
31
|
main?: T;
|
|
32
32
|
bundleMain?: T;
|
|
33
33
|
sourceFiles?: string[];
|
|
@@ -38,13 +38,13 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
38
38
|
add(expires: number, socketId?: string, id?: string): boolean;
|
|
39
39
|
connection(server: ws.Server, port?: number, secure?: boolean): void;
|
|
40
40
|
send(event: WatchEventValue, data: Partial<WatchResponse>): boolean;
|
|
41
|
-
find(socketId: string):
|
|
41
|
+
find(socketId: string): ISocketRequest | undefined;
|
|
42
42
|
pause(): void;
|
|
43
43
|
resume(): void;
|
|
44
|
-
get server():
|
|
44
|
+
get server(): ws.Server | null;
|
|
45
45
|
set related(value);
|
|
46
46
|
get related(): T[];
|
|
47
|
-
get socketId():
|
|
47
|
+
get socketId(): string | string[];
|
|
48
48
|
set etag(value: unknown);
|
|
49
49
|
get etag(): string;
|
|
50
50
|
set lastModified(value: unknown);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Type definitions for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"bytes": "^3.1.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"typescript": "5.
|
|
26
|
+
"typescript": "5.7.2"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/lib/compat-v4.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
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
|
-
}
|