@e-mc/types 0.10.1 → 0.10.3
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 +208 -208
- package/constant.d.ts +338 -338
- package/index.d.ts +336 -336
- package/index.js +4 -4
- package/lib/asset.d.ts +76 -76
- package/lib/cloud.d.ts +106 -106
- package/lib/compat-v4.d.ts +120 -120
- package/lib/compress.d.ts +25 -25
- package/lib/core.d.ts +195 -195
- package/lib/db.d.ts +107 -109
- package/lib/document.d.ts +199 -199
- package/lib/filemanager.d.ts +122 -122
- package/lib/http.d.ts +115 -115
- package/lib/index.d.ts +796 -790
- package/lib/logger.d.ts +113 -113
- package/lib/module.d.ts +137 -127
- package/lib/node.d.ts +21 -21
- package/lib/object.d.ts +29 -29
- package/lib/request.d.ts +146 -138
- package/lib/settings.d.ts +490 -490
- package/lib/squared.d.ts +339 -339
- package/lib/type.d.ts +34 -33
- package/lib/watch.d.ts +77 -77
- package/package.json +28 -28
- package/lib/dom.d.ts +0 -9
package/lib/type.d.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
type Undef<T> = T | undefined;
|
|
2
|
-
type Null<T> = T | null;
|
|
3
|
-
type Void<T> = T | void;
|
|
4
|
-
type Optional<T> = T | null | undefined;
|
|
5
|
-
type Nullable<T> = { [P in keyof T]: T[P] | null; };
|
|
6
|
-
type Writable<T> = { -readonly [P in keyof T]: T[P] };
|
|
7
|
-
type KeyOfType<T, U = any, V = any> = { [K in keyof T]: K extends U ? T[K] extends V ? K : never : never }[keyof T];
|
|
8
|
-
type MapOfType<T, U = any, V = any> = { [K in KeyOfType<T, U, V>]: K extends U ? T[K] extends V ? T[K] : never : never };
|
|
9
|
-
|
|
10
|
-
type Constructor<out T> = new(...args: any[]) => T;
|
|
11
|
-
type ConstructorDerived<T> = Pick<T, { [K in keyof T]: T[K] extends new() => any ? never : K }[keyof T]>;
|
|
12
|
-
|
|
13
|
-
type FunctionType<T = unknown, U = unknown> = (...args: U[]) => T;
|
|
14
|
-
type FunctionArgs<T extends unknown[], U = unknown> = (...args: T) => U;
|
|
15
|
-
|
|
16
|
-
/** @deprecated */
|
|
17
|
-
type NumString = number | string;
|
|
18
|
-
type IntBool = boolean | 0 | 1;
|
|
19
|
-
type ArrayOf<T> = T | T[];
|
|
20
|
-
|
|
21
|
-
type
|
|
22
|
-
type
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type
|
|
29
|
-
type
|
|
30
|
-
type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
type Undef<T> = T | undefined;
|
|
2
|
+
type Null<T> = T | null;
|
|
3
|
+
type Void<T> = T | void;
|
|
4
|
+
type Optional<T> = T | null | undefined;
|
|
5
|
+
type Nullable<T> = { [P in keyof T]: T[P] | null; };
|
|
6
|
+
type Writable<T> = { -readonly [P in keyof T]: T[P] };
|
|
7
|
+
type KeyOfType<T, U = any, V = any> = { [K in keyof T]: K extends U ? T[K] extends V ? K : never : never }[keyof T];
|
|
8
|
+
type MapOfType<T, U = any, V = any> = { [K in KeyOfType<T, U, V>]: K extends U ? T[K] extends V ? T[K] : never : never };
|
|
9
|
+
|
|
10
|
+
type Constructor<out T> = new(...args: any[]) => T;
|
|
11
|
+
type ConstructorDerived<T> = Pick<T, { [K in keyof T]: T[K] extends new() => any ? never : K }[keyof T]>;
|
|
12
|
+
|
|
13
|
+
type FunctionType<T = unknown, U = unknown> = (...args: U[]) => T;
|
|
14
|
+
type FunctionArgs<T extends unknown[], U = unknown> = (...args: T) => U;
|
|
15
|
+
|
|
16
|
+
/** @deprecated */
|
|
17
|
+
type NumString = number | string;
|
|
18
|
+
type IntBool = boolean | 0 | 1;
|
|
19
|
+
type ArrayOf<T> = T | T[];
|
|
20
|
+
/** @deprecated */
|
|
21
|
+
type TupleOf<T> = [T, T];
|
|
22
|
+
type FirstOf<T, U = boolean> = T extends U ? [T, ...T[]] : T[] | [U, T, ...T[]];
|
|
23
|
+
type Bufferable = string | Buffer;
|
|
24
|
+
|
|
25
|
+
type AnyObject = Record<string, unknown>;
|
|
26
|
+
type PlainObject = Record<string | number | symbol, unknown>;
|
|
27
|
+
|
|
28
|
+
type StandardMap = Record<string, any>;
|
|
29
|
+
type StringMap = Record<string, string | undefined>;
|
|
30
|
+
type ObjectMap<T> = Record<string, T | undefined>;
|
|
31
|
+
type IterableMap<T> = Record<string, T>;
|
|
32
|
+
|
|
33
|
+
type PropertyAction<T, U extends string, V extends boolean = false> = {
|
|
34
|
+
[K in keyof T as `${U}${V extends true ? string & K : Capitalize<string & K>}`]: T[K];
|
|
34
35
|
};
|
package/lib/watch.d.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import type { DataSource, WatchResponse } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { ExternalAsset } from './asset';
|
|
4
|
-
import type { IAbortComponent } from './core';
|
|
5
|
-
import type { PostFinalizeCallback } from './filemanager';
|
|
6
|
-
import type { SecureConfig } from './http';
|
|
7
|
-
|
|
8
|
-
import type { WatchEventValue } from '../index.d';
|
|
9
|
-
|
|
10
|
-
import type { ServerOptions } from 'https';
|
|
11
|
-
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import type * as ws from 'ws';
|
|
14
|
-
|
|
15
|
-
export interface ISocketRequest {
|
|
16
|
-
expires: number;
|
|
17
|
-
readonly socketId: string;
|
|
18
|
-
readonly id: string;
|
|
19
|
-
get expired(): boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAbortComponent {
|
|
23
|
-
captured: boolean;
|
|
24
|
-
port: number;
|
|
25
|
-
secure: boolean;
|
|
26
|
-
hot: boolean;
|
|
27
|
-
always: boolean;
|
|
28
|
-
id?: string;
|
|
29
|
-
url?: URL;
|
|
30
|
-
document?: ArrayOf<string>;
|
|
31
|
-
main?: T;
|
|
32
|
-
bundleMain?: T;
|
|
33
|
-
sourceFiles?: string[];
|
|
34
|
-
readonly uri: string;
|
|
35
|
-
readonly startTime: number;
|
|
36
|
-
readonly assets: T[];
|
|
37
|
-
readonly sockets: ISocketRequest[];
|
|
38
|
-
add(expires: number, socketId?: string, id?: string): boolean;
|
|
39
|
-
connection(server: ws.Server, port?: number, secure?: boolean): void;
|
|
40
|
-
send(event: WatchEventValue, data: Partial<WatchResponse>): boolean;
|
|
41
|
-
find(socketId: string): Undef<ISocketRequest>;
|
|
42
|
-
pause(): void;
|
|
43
|
-
resume(): void;
|
|
44
|
-
get server(): Null<ws.Server>;
|
|
45
|
-
set related(value);
|
|
46
|
-
get related(): T[];
|
|
47
|
-
get socketId(): ArrayOf<string>;
|
|
48
|
-
set etag(value: unknown);
|
|
49
|
-
get etag(): string;
|
|
50
|
-
set lastModified(value: unknown);
|
|
51
|
-
get lastModified(): string;
|
|
52
|
-
get expires(): number;
|
|
53
|
-
get started(): boolean;
|
|
54
|
-
get expired(): boolean;
|
|
55
|
-
get paused(): boolean;
|
|
56
|
-
get abortable(): boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface FileGroupConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
60
|
-
CONNECTION_TIMEOUT: number;
|
|
61
|
-
CLIENT_SESSION: Map<ws, number>;
|
|
62
|
-
checkTimeout(client: ws): boolean;
|
|
63
|
-
cloneAsset(asset: T): T;
|
|
64
|
-
readonly prototype: IFileGroup<T>;
|
|
65
|
-
new(uri: string, assets: T[], abortable: boolean): IFileGroup<T>;
|
|
66
|
-
new(uri: string, assets: T[], startTime?: number, abortable?: boolean): IFileGroup<T>;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface WatchInitResult<T = ExternalAsset> {
|
|
70
|
-
using?: T[];
|
|
71
|
-
dataSource?: DataSource[];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface SecureOptions<T = string> extends SecureConfig<T> {
|
|
75
|
-
config?: ServerOptions;
|
|
76
|
-
}
|
|
77
|
-
|
|
1
|
+
import type { DataSource, WatchResponse } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { ExternalAsset } from './asset';
|
|
4
|
+
import type { IAbortComponent } from './core';
|
|
5
|
+
import type { PostFinalizeCallback } from './filemanager';
|
|
6
|
+
import type { SecureConfig } from './http';
|
|
7
|
+
|
|
8
|
+
import type { WatchEventValue } from '../index.d';
|
|
9
|
+
|
|
10
|
+
import type { ServerOptions } from 'https';
|
|
11
|
+
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
import type * as ws from 'ws';
|
|
14
|
+
|
|
15
|
+
export interface ISocketRequest {
|
|
16
|
+
expires: number;
|
|
17
|
+
readonly socketId: string;
|
|
18
|
+
readonly id: string;
|
|
19
|
+
get expired(): boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAbortComponent {
|
|
23
|
+
captured: boolean;
|
|
24
|
+
port: number;
|
|
25
|
+
secure: boolean;
|
|
26
|
+
hot: boolean;
|
|
27
|
+
always: boolean;
|
|
28
|
+
id?: string;
|
|
29
|
+
url?: URL;
|
|
30
|
+
document?: ArrayOf<string>;
|
|
31
|
+
main?: T;
|
|
32
|
+
bundleMain?: T;
|
|
33
|
+
sourceFiles?: string[];
|
|
34
|
+
readonly uri: string;
|
|
35
|
+
readonly startTime: number;
|
|
36
|
+
readonly assets: T[];
|
|
37
|
+
readonly sockets: ISocketRequest[];
|
|
38
|
+
add(expires: number, socketId?: string, id?: string): boolean;
|
|
39
|
+
connection(server: ws.Server, port?: number, secure?: boolean): void;
|
|
40
|
+
send(event: WatchEventValue, data: Partial<WatchResponse>): boolean;
|
|
41
|
+
find(socketId: string): Undef<ISocketRequest>;
|
|
42
|
+
pause(): void;
|
|
43
|
+
resume(): void;
|
|
44
|
+
get server(): Null<ws.Server>;
|
|
45
|
+
set related(value);
|
|
46
|
+
get related(): T[];
|
|
47
|
+
get socketId(): ArrayOf<string>;
|
|
48
|
+
set etag(value: unknown);
|
|
49
|
+
get etag(): string;
|
|
50
|
+
set lastModified(value: unknown);
|
|
51
|
+
get lastModified(): string;
|
|
52
|
+
get expires(): number;
|
|
53
|
+
get started(): boolean;
|
|
54
|
+
get expired(): boolean;
|
|
55
|
+
get paused(): boolean;
|
|
56
|
+
get abortable(): boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface FileGroupConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
60
|
+
CONNECTION_TIMEOUT: number;
|
|
61
|
+
CLIENT_SESSION: Map<ws, number>;
|
|
62
|
+
checkTimeout(client: ws): boolean;
|
|
63
|
+
cloneAsset(asset: T): T;
|
|
64
|
+
readonly prototype: IFileGroup<T>;
|
|
65
|
+
new(uri: string, assets: T[], abortable: boolean): IFileGroup<T>;
|
|
66
|
+
new(uri: string, assets: T[], startTime?: number, abortable?: boolean): IFileGroup<T>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface WatchInitResult<T = ExternalAsset> {
|
|
70
|
+
using?: T[];
|
|
71
|
+
dataSource?: DataSource[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface SecureOptions<T = string> extends SecureConfig<T> {
|
|
75
|
+
config?: ServerOptions;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
78
|
export type ModifiedPostFinalizeListener<T extends ExternalAsset = ExternalAsset> = (watch: IFileGroup<T>, assets?: T[]) => PostFinalizeCallback;
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@e-mc/types",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Type definitions for E-mc.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/anpham6/e-mc.git",
|
|
13
|
-
"directory": "src/types"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"squared",
|
|
17
|
-
"squared-functions"
|
|
18
|
-
],
|
|
19
|
-
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "BSD
|
|
21
|
-
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"bytes": "^3.1.2"
|
|
24
|
-
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"typescript": "5.5.4"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@e-mc/types",
|
|
3
|
+
"version": "0.10.3",
|
|
4
|
+
"description": "Type definitions for E-mc.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/anpham6/e-mc.git",
|
|
13
|
+
"directory": "src/types"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"squared",
|
|
17
|
+
"squared-functions"
|
|
18
|
+
],
|
|
19
|
+
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
+
"license": "BSD-3-Clause",
|
|
21
|
+
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"bytes": "^3.1.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "5.5.4"
|
|
27
|
+
}
|
|
28
|
+
}
|