@e-mc/types 0.9.8 → 0.9.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/LICENSE +10 -10
- package/README.md +204 -204
- package/constant.d.ts +309 -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/dom.d.ts +8 -8
- 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 +467 -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/document.d.ts
CHANGED
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
import type { LocationUri, MimeTypeAction, StorageAction } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { IDocument, IFileManager, IModule } from './index';
|
|
4
|
-
import type { ExternalAsset, InitialValue } from './asset';
|
|
5
|
-
import type { CloudStorage } from './cloud';
|
|
6
|
-
import type { LogComponent, LogDate } from './logger';
|
|
7
|
-
import type { DocumentTransform } from './settings';
|
|
8
|
-
|
|
9
|
-
export interface DocumentAsset extends ExternalAsset, StorageAction<CloudStorage> {
|
|
10
|
-
initialValue?: InitialValue & { inlineFilename?: string };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface StartOfSourceMap {
|
|
14
|
-
file?: string;
|
|
15
|
-
sourceRoot?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface RawSourceMap<T = NumString> extends StartOfSourceMap {
|
|
19
|
-
version: T;
|
|
20
|
-
sources: string[];
|
|
21
|
-
names: string[];
|
|
22
|
-
sourcesContent?: string[];
|
|
23
|
-
mappings: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface SourceInput<T = [string, string?, string?][]> {
|
|
27
|
-
code?: string;
|
|
28
|
-
sourceFile?: T;
|
|
29
|
-
sourceName?: string;
|
|
30
|
-
sourcesRelativeTo?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface SourceCode {
|
|
34
|
-
code: string;
|
|
35
|
-
map?: RawSourceMap;
|
|
36
|
-
sourceMappingURL?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ChunkFile {
|
|
40
|
-
code: string;
|
|
41
|
-
filename?: string;
|
|
42
|
-
entryPoint?: boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface ChunkData extends ChunkFile {
|
|
46
|
-
sourceMap?: SourceMap;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface CacheData {
|
|
50
|
-
uri?: string;
|
|
51
|
-
etag?: string;
|
|
52
|
-
encoding?: BufferEncoding;
|
|
53
|
-
override?: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface TransformAction {
|
|
57
|
-
cacheData?: CacheData;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface TransformResult extends SourceCode {
|
|
61
|
-
type?: string;
|
|
62
|
-
chunks?: Null<(SourceCode & ChunkFile)[]>;
|
|
63
|
-
sourceFiles?: string[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface TransformOutput extends Partial<LocationUri>, Omit<SourceInput<string>, "code">, MimeTypeAction {
|
|
67
|
-
imported?: boolean;
|
|
68
|
-
sourceMap?: SourceMap;
|
|
69
|
-
metadata?: unknown;
|
|
70
|
-
external?: PlainObject;
|
|
71
|
-
productionRelease?: boolean;
|
|
72
|
-
getMainFile?(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
|
|
73
|
-
getSourceFiles?(imports?: StringMap): Undef<SourceInput>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface TransformOptions<T = AnyObject, U = T> extends TransformOutput {
|
|
77
|
-
baseConfig: T;
|
|
78
|
-
outputConfig: U;
|
|
79
|
-
sourceMap: SourceMap;
|
|
80
|
-
supplementChunks: ChunkData[];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface ITransformSeries<T = AnyObject, U = T> extends IModule, TransformOptions<T, U> {
|
|
84
|
-
readonly type: string;
|
|
85
|
-
init(instance: IModule, dirname?: string): this;
|
|
86
|
-
close(instance: IModule): void;
|
|
87
|
-
createSourceMap(value: string): SourceMap;
|
|
88
|
-
getMainFile(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
|
|
89
|
-
getSourceFiles(imports?: StringMap): Undef<SourceInput>;
|
|
90
|
-
toBaseConfig(all?: boolean): T;
|
|
91
|
-
upgrade<V = unknown>(context: V, dirname?: string, name?: string): V;
|
|
92
|
-
set code(value);
|
|
93
|
-
get code(): string;
|
|
94
|
-
get out(): IOut;
|
|
95
|
-
get metadata(): object;
|
|
96
|
-
get options(): TransformOutput;
|
|
97
|
-
get productionRelease(): boolean;
|
|
98
|
-
get imported(): boolean;
|
|
99
|
-
set version(value);
|
|
100
|
-
get version(): string;
|
|
101
|
-
set packageName(value);
|
|
102
|
-
get packageName(): string;
|
|
103
|
-
get packageVersion(): string;
|
|
104
|
-
get username(): string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface TransformSeriesConstructor {
|
|
108
|
-
readonly prototype: ITransformSeries;
|
|
109
|
-
new(type: string, code: string, options: TransformOutput): ITransformSeries;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface IOut extends OutV3, OutV4 {}
|
|
113
|
-
|
|
114
|
-
export interface OutV3 {
|
|
115
|
-
sourceFiles?: string[];
|
|
116
|
-
ignoreCache?: boolean;
|
|
117
|
-
logAppend?: LogComponent[];
|
|
118
|
-
messageAppend?: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface OutV4 {
|
|
122
|
-
logQueued?: LogComponent[];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface SourceMapOptions extends MimeTypeAction {
|
|
126
|
-
file?: string;
|
|
127
|
-
hash?: string;
|
|
128
|
-
sourceRoot?: string;
|
|
129
|
-
sourceMappingURL?: string;
|
|
130
|
-
inlineMap?: boolean;
|
|
131
|
-
emptySources?: boolean;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface SourceMap extends SourceCode {
|
|
135
|
-
output: Map<string, SourceCode>;
|
|
136
|
-
reset(): void;
|
|
137
|
-
nextMap(name: string, code: string, map: unknown, sourceMappingURL?: string, emptySources?: boolean): boolean;
|
|
138
|
-
set map(value);
|
|
139
|
-
get map(): Undef<RawSourceMap>;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export interface SourceMapConstructor {
|
|
143
|
-
findSourceMap(code?: string, uri?: string): Undef<RawSourceMap>;
|
|
144
|
-
removeSourceMappingURL(value: string): [string, string?, Null<RawSourceMap>?];
|
|
145
|
-
isRaw(map: unknown): map is RawSourceMap;
|
|
146
|
-
readonly prototype: SourceMap;
|
|
147
|
-
new(code: string, remove: boolean): SourceMap;
|
|
148
|
-
new(code: string, uri?: string, remove?: boolean): SourceMap;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export interface ImportMap {
|
|
152
|
-
imports?: StringMap;
|
|
153
|
-
scopes?: ObjectMap<StringMap>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface UpdateGradleOptions {
|
|
157
|
-
multiple?: boolean;
|
|
158
|
-
addendum?: string;
|
|
159
|
-
upgrade?: boolean;
|
|
160
|
-
updateOnly?: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface LintMessage {
|
|
164
|
-
ruleId: string;
|
|
165
|
-
message: string;
|
|
166
|
-
line: number;
|
|
167
|
-
column: number;
|
|
168
|
-
endLine?: number;
|
|
169
|
-
endColumn?: number;
|
|
170
|
-
severity?: 0 | 1 | 2 | "" | "error" | "warning";
|
|
171
|
-
fatal?: boolean;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface GenerateLintTableOptions extends Partial<LocationUri> {
|
|
175
|
-
leadingText?: string;
|
|
176
|
-
trailingText?: string;
|
|
177
|
-
errorCount?: number;
|
|
178
|
-
warningCount?: number;
|
|
179
|
-
fatalErrorCount?: number;
|
|
180
|
-
timeStamp?: LogDate;
|
|
181
|
-
ruleWidth?: number;
|
|
182
|
-
messageWidth?: number;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface CustomizeOptions {
|
|
186
|
-
transform?: DocumentTransform;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface AsSourceFileOptions {
|
|
190
|
-
encoding?: BufferEncoding;
|
|
191
|
-
persist?: boolean;
|
|
192
|
-
cache?: boolean;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export type Transformer = FunctionType<Undef<Promise<string> | string>>;
|
|
196
|
-
export type ConfigOrTransformer = AnyObject | Transformer;
|
|
197
|
-
export type PluginConfig = [string, Undef<ConfigOrTransformer>, Undef<AnyObject>, boolean?] | [];
|
|
1
|
+
import type { LocationUri, MimeTypeAction, StorageAction } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { IDocument, IFileManager, IModule } from './index';
|
|
4
|
+
import type { ExternalAsset, InitialValue } from './asset';
|
|
5
|
+
import type { CloudStorage } from './cloud';
|
|
6
|
+
import type { LogComponent, LogDate } from './logger';
|
|
7
|
+
import type { DocumentTransform } from './settings';
|
|
8
|
+
|
|
9
|
+
export interface DocumentAsset extends ExternalAsset, StorageAction<CloudStorage> {
|
|
10
|
+
initialValue?: InitialValue & { inlineFilename?: string };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface StartOfSourceMap {
|
|
14
|
+
file?: string;
|
|
15
|
+
sourceRoot?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface RawSourceMap<T = NumString> extends StartOfSourceMap {
|
|
19
|
+
version: T;
|
|
20
|
+
sources: string[];
|
|
21
|
+
names: string[];
|
|
22
|
+
sourcesContent?: string[];
|
|
23
|
+
mappings: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SourceInput<T = [string, string?, string?][]> {
|
|
27
|
+
code?: string;
|
|
28
|
+
sourceFile?: T;
|
|
29
|
+
sourceName?: string;
|
|
30
|
+
sourcesRelativeTo?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SourceCode {
|
|
34
|
+
code: string;
|
|
35
|
+
map?: RawSourceMap;
|
|
36
|
+
sourceMappingURL?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ChunkFile {
|
|
40
|
+
code: string;
|
|
41
|
+
filename?: string;
|
|
42
|
+
entryPoint?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ChunkData extends ChunkFile {
|
|
46
|
+
sourceMap?: SourceMap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CacheData {
|
|
50
|
+
uri?: string;
|
|
51
|
+
etag?: string;
|
|
52
|
+
encoding?: BufferEncoding;
|
|
53
|
+
override?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TransformAction {
|
|
57
|
+
cacheData?: CacheData;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface TransformResult extends SourceCode {
|
|
61
|
+
type?: string;
|
|
62
|
+
chunks?: Null<(SourceCode & ChunkFile)[]>;
|
|
63
|
+
sourceFiles?: string[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface TransformOutput extends Partial<LocationUri>, Omit<SourceInput<string>, "code">, MimeTypeAction {
|
|
67
|
+
imported?: boolean;
|
|
68
|
+
sourceMap?: SourceMap;
|
|
69
|
+
metadata?: unknown;
|
|
70
|
+
external?: PlainObject;
|
|
71
|
+
productionRelease?: boolean;
|
|
72
|
+
getMainFile?(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
|
|
73
|
+
getSourceFiles?(imports?: StringMap): Undef<SourceInput>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface TransformOptions<T = AnyObject, U = T> extends TransformOutput {
|
|
77
|
+
baseConfig: T;
|
|
78
|
+
outputConfig: U;
|
|
79
|
+
sourceMap: SourceMap;
|
|
80
|
+
supplementChunks: ChunkData[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ITransformSeries<T = AnyObject, U = T> extends IModule, TransformOptions<T, U> {
|
|
84
|
+
readonly type: string;
|
|
85
|
+
init(instance: IModule, dirname?: string): this;
|
|
86
|
+
close(instance: IModule): void;
|
|
87
|
+
createSourceMap(value: string): SourceMap;
|
|
88
|
+
getMainFile(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
|
|
89
|
+
getSourceFiles(imports?: StringMap): Undef<SourceInput>;
|
|
90
|
+
toBaseConfig(all?: boolean): T;
|
|
91
|
+
upgrade<V = unknown>(context: V, dirname?: string, name?: string): V;
|
|
92
|
+
set code(value);
|
|
93
|
+
get code(): string;
|
|
94
|
+
get out(): IOut;
|
|
95
|
+
get metadata(): object;
|
|
96
|
+
get options(): TransformOutput;
|
|
97
|
+
get productionRelease(): boolean;
|
|
98
|
+
get imported(): boolean;
|
|
99
|
+
set version(value);
|
|
100
|
+
get version(): string;
|
|
101
|
+
set packageName(value);
|
|
102
|
+
get packageName(): string;
|
|
103
|
+
get packageVersion(): string;
|
|
104
|
+
get username(): string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface TransformSeriesConstructor {
|
|
108
|
+
readonly prototype: ITransformSeries;
|
|
109
|
+
new(type: string, code: string, options: TransformOutput): ITransformSeries;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface IOut extends OutV3, OutV4 {}
|
|
113
|
+
|
|
114
|
+
export interface OutV3 {
|
|
115
|
+
sourceFiles?: string[];
|
|
116
|
+
ignoreCache?: boolean;
|
|
117
|
+
logAppend?: LogComponent[];
|
|
118
|
+
messageAppend?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface OutV4 {
|
|
122
|
+
logQueued?: LogComponent[];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface SourceMapOptions extends MimeTypeAction {
|
|
126
|
+
file?: string;
|
|
127
|
+
hash?: string;
|
|
128
|
+
sourceRoot?: string;
|
|
129
|
+
sourceMappingURL?: string;
|
|
130
|
+
inlineMap?: boolean;
|
|
131
|
+
emptySources?: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface SourceMap extends SourceCode {
|
|
135
|
+
output: Map<string, SourceCode>;
|
|
136
|
+
reset(): void;
|
|
137
|
+
nextMap(name: string, code: string, map: unknown, sourceMappingURL?: string, emptySources?: boolean): boolean;
|
|
138
|
+
set map(value);
|
|
139
|
+
get map(): Undef<RawSourceMap>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface SourceMapConstructor {
|
|
143
|
+
findSourceMap(code?: string, uri?: string): Undef<RawSourceMap>;
|
|
144
|
+
removeSourceMappingURL(value: string): [string, string?, Null<RawSourceMap>?];
|
|
145
|
+
isRaw(map: unknown): map is RawSourceMap;
|
|
146
|
+
readonly prototype: SourceMap;
|
|
147
|
+
new(code: string, remove: boolean): SourceMap;
|
|
148
|
+
new(code: string, uri?: string, remove?: boolean): SourceMap;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ImportMap {
|
|
152
|
+
imports?: StringMap;
|
|
153
|
+
scopes?: ObjectMap<StringMap>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface UpdateGradleOptions {
|
|
157
|
+
multiple?: boolean;
|
|
158
|
+
addendum?: string;
|
|
159
|
+
upgrade?: boolean;
|
|
160
|
+
updateOnly?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface LintMessage {
|
|
164
|
+
ruleId: string;
|
|
165
|
+
message: string;
|
|
166
|
+
line: number;
|
|
167
|
+
column: number;
|
|
168
|
+
endLine?: number;
|
|
169
|
+
endColumn?: number;
|
|
170
|
+
severity?: 0 | 1 | 2 | "" | "error" | "warning";
|
|
171
|
+
fatal?: boolean;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface GenerateLintTableOptions extends Partial<LocationUri> {
|
|
175
|
+
leadingText?: string;
|
|
176
|
+
trailingText?: string;
|
|
177
|
+
errorCount?: number;
|
|
178
|
+
warningCount?: number;
|
|
179
|
+
fatalErrorCount?: number;
|
|
180
|
+
timeStamp?: LogDate;
|
|
181
|
+
ruleWidth?: number;
|
|
182
|
+
messageWidth?: number;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface CustomizeOptions {
|
|
186
|
+
transform?: DocumentTransform;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AsSourceFileOptions {
|
|
190
|
+
encoding?: BufferEncoding;
|
|
191
|
+
persist?: boolean;
|
|
192
|
+
cache?: boolean;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export type Transformer = FunctionType<Undef<Promise<string> | string>>;
|
|
196
|
+
export type ConfigOrTransformer = AnyObject | Transformer;
|
|
197
|
+
export type PluginConfig = [string, Undef<ConfigOrTransformer>, Undef<AnyObject>, boolean?] | [];
|
|
198
198
|
export type TransformCallback<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset> = (this: T, instance: IDocument<T, U>, requireOrDocumentDir?: NodeJS.Require | string) => Void<Promise<void>>;
|
package/lib/dom.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
interface EventListenerOptions {
|
|
2
|
-
capture?: boolean;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface AddEventListenerOptions extends EventListenerOptions {
|
|
6
|
-
once?: boolean;
|
|
7
|
-
passive?: boolean;
|
|
8
|
-
signal?: AbortSignal;
|
|
1
|
+
interface EventListenerOptions {
|
|
2
|
+
capture?: boolean;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface AddEventListenerOptions extends EventListenerOptions {
|
|
6
|
+
once?: boolean;
|
|
7
|
+
passive?: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
9
|
}
|
package/lib/filemanager.d.ts
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import type { BundleAction, ChecksumOutput, FileInfo, LogStatus } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { IFileManager, IImage, IModule, ImageConstructor, ModuleConstructor } from './index';
|
|
4
|
-
import type { ExternalAsset } from './asset';
|
|
5
|
-
import type { HostInitLog as IHostInitLog } from './core';
|
|
6
|
-
import type { ReadHashOptions } from './module';
|
|
7
|
-
import type { RequestData as IRequestData } from './node';
|
|
8
|
-
import type { RequestInit } from './request';
|
|
9
|
-
|
|
10
|
-
import type { FETCH_TYPE } from '../index.d';
|
|
11
|
-
|
|
12
|
-
export const enum FINALIZE_STATE {
|
|
13
|
-
READY = 0,
|
|
14
|
-
COMMIT = 1,
|
|
15
|
-
END = 2,
|
|
16
|
-
RESTART = 3,
|
|
17
|
-
QUEUED = 4,
|
|
18
|
-
RESTARTED = 5,
|
|
19
|
-
ABORTED = 6
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const enum INCREMENTAL {
|
|
23
|
-
NONE = 'none',
|
|
24
|
-
STAGING = 'staging',
|
|
25
|
-
ETAG = 'etag',
|
|
26
|
-
EXISTS = 'exists'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface RequestData<T extends ExternalAsset = ExternalAsset> extends IRequestData<T>, RequestInit {
|
|
30
|
-
timeout?: ObjectMap<NumString>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface InstallData<T extends IModule = IModule, U extends ModuleConstructor = ModuleConstructor> {
|
|
34
|
-
instance: T;
|
|
35
|
-
constructor: U;
|
|
36
|
-
params: unknown[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IHttpDiskCache<T extends ExternalAsset = ExternalAsset> {
|
|
40
|
-
limit: number;
|
|
41
|
-
expires: number;
|
|
42
|
-
readonly host: IFileManager<T>;
|
|
43
|
-
has(uri: string | URL): boolean;
|
|
44
|
-
add<U extends HttpDiskCacheAddOptions>(uri: string | URL, etag: string, target: string | Buffer, options?: U): void;
|
|
45
|
-
within(value: T | number): boolean;
|
|
46
|
-
clear(value?: unknown): void;
|
|
47
|
-
set enabled(value);
|
|
48
|
-
get enabled(): boolean;
|
|
49
|
-
set exclude(value);
|
|
50
|
-
get exclude(): string[];
|
|
51
|
-
set include(value);
|
|
52
|
-
get include(): string[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface IHttpMemoryCache<T extends ExternalAsset = ExternalAsset> extends IHttpDiskCache<T> {
|
|
56
|
-
toDisk: TupleOf<number>;
|
|
57
|
-
purge(percent?: number, limit?: number): void;
|
|
58
|
-
withinDisk(value: T | number): boolean;
|
|
59
|
-
clear(uri?: string | URL): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface HttpDiskCacheAddOptions {
|
|
63
|
-
buffer?: Null<Bufferable>;
|
|
64
|
-
contentLength?: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface HttpMemoryCacheAddOptions extends Omit<HttpDiskCacheAddOptions, "buffer"> {
|
|
68
|
-
toDisk?: string;
|
|
69
|
-
encoding?: BufferEncoding;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ReplaceOptions {
|
|
73
|
-
mimeType?: string;
|
|
74
|
-
rewritePath?: boolean;
|
|
75
|
-
ignoreExt?: boolean;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface AssetContentOptions extends BundleAction {
|
|
79
|
-
localUri: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface FileOutput {
|
|
83
|
-
pathname: string;
|
|
84
|
-
localUri: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface FinalizeResult {
|
|
88
|
-
files: FileInfo[];
|
|
89
|
-
errors: string[];
|
|
90
|
-
status?: LogStatus[];
|
|
91
|
-
aborted?: boolean;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface DeleteFileAddendum {
|
|
95
|
-
id?: number;
|
|
96
|
-
all?: boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface HostInitLog extends IHostInitLog {
|
|
100
|
-
useNumeric: boolean;
|
|
101
|
-
showSize?: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
|
105
|
-
instance?: IModule;
|
|
106
|
-
assets?: T[];
|
|
107
|
-
replaced?: boolean;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface ChecksumOptions extends ReadHashOptions, Pick<ChecksumOutput, "include" | "exclude" | "recursive"> {
|
|
111
|
-
dot?: boolean;
|
|
112
|
-
sortBy?: number;
|
|
113
|
-
verbose?: boolean;
|
|
114
|
-
ignore?: string[];
|
|
115
|
-
joinRoot?: boolean;
|
|
116
|
-
outPath?: string;
|
|
117
|
-
throwsEmpty?: boolean;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export type ImageMimeMap = Map<string, InstallData<IImage, ImageConstructor>>;
|
|
121
|
-
export type FetchType = FETCH_TYPE[keyof FETCH_TYPE];
|
|
1
|
+
import type { BundleAction, ChecksumOutput, FileInfo, LogStatus } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { IFileManager, IImage, IModule, ImageConstructor, ModuleConstructor } from './index';
|
|
4
|
+
import type { ExternalAsset } from './asset';
|
|
5
|
+
import type { HostInitLog as IHostInitLog } from './core';
|
|
6
|
+
import type { ReadHashOptions } from './module';
|
|
7
|
+
import type { RequestData as IRequestData } from './node';
|
|
8
|
+
import type { RequestInit } from './request';
|
|
9
|
+
|
|
10
|
+
import type { FETCH_TYPE } from '../index.d';
|
|
11
|
+
|
|
12
|
+
export const enum FINALIZE_STATE {
|
|
13
|
+
READY = 0,
|
|
14
|
+
COMMIT = 1,
|
|
15
|
+
END = 2,
|
|
16
|
+
RESTART = 3,
|
|
17
|
+
QUEUED = 4,
|
|
18
|
+
RESTARTED = 5,
|
|
19
|
+
ABORTED = 6
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const enum INCREMENTAL {
|
|
23
|
+
NONE = 'none',
|
|
24
|
+
STAGING = 'staging',
|
|
25
|
+
ETAG = 'etag',
|
|
26
|
+
EXISTS = 'exists'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface RequestData<T extends ExternalAsset = ExternalAsset> extends IRequestData<T>, RequestInit {
|
|
30
|
+
timeout?: ObjectMap<NumString>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface InstallData<T extends IModule = IModule, U extends ModuleConstructor = ModuleConstructor> {
|
|
34
|
+
instance: T;
|
|
35
|
+
constructor: U;
|
|
36
|
+
params: unknown[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IHttpDiskCache<T extends ExternalAsset = ExternalAsset> {
|
|
40
|
+
limit: number;
|
|
41
|
+
expires: number;
|
|
42
|
+
readonly host: IFileManager<T>;
|
|
43
|
+
has(uri: string | URL): boolean;
|
|
44
|
+
add<U extends HttpDiskCacheAddOptions>(uri: string | URL, etag: string, target: string | Buffer, options?: U): void;
|
|
45
|
+
within(value: T | number): boolean;
|
|
46
|
+
clear(value?: unknown): void;
|
|
47
|
+
set enabled(value);
|
|
48
|
+
get enabled(): boolean;
|
|
49
|
+
set exclude(value);
|
|
50
|
+
get exclude(): string[];
|
|
51
|
+
set include(value);
|
|
52
|
+
get include(): string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IHttpMemoryCache<T extends ExternalAsset = ExternalAsset> extends IHttpDiskCache<T> {
|
|
56
|
+
toDisk: TupleOf<number>;
|
|
57
|
+
purge(percent?: number, limit?: number): void;
|
|
58
|
+
withinDisk(value: T | number): boolean;
|
|
59
|
+
clear(uri?: string | URL): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface HttpDiskCacheAddOptions {
|
|
63
|
+
buffer?: Null<Bufferable>;
|
|
64
|
+
contentLength?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface HttpMemoryCacheAddOptions extends Omit<HttpDiskCacheAddOptions, "buffer"> {
|
|
68
|
+
toDisk?: string;
|
|
69
|
+
encoding?: BufferEncoding;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ReplaceOptions {
|
|
73
|
+
mimeType?: string;
|
|
74
|
+
rewritePath?: boolean;
|
|
75
|
+
ignoreExt?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AssetContentOptions extends BundleAction {
|
|
79
|
+
localUri: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface FileOutput {
|
|
83
|
+
pathname: string;
|
|
84
|
+
localUri: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface FinalizeResult {
|
|
88
|
+
files: FileInfo[];
|
|
89
|
+
errors: string[];
|
|
90
|
+
status?: LogStatus[];
|
|
91
|
+
aborted?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface DeleteFileAddendum {
|
|
95
|
+
id?: number;
|
|
96
|
+
all?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface HostInitLog extends IHostInitLog {
|
|
100
|
+
useNumeric: boolean;
|
|
101
|
+
showSize?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
|
105
|
+
instance?: IModule;
|
|
106
|
+
assets?: T[];
|
|
107
|
+
replaced?: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ChecksumOptions extends ReadHashOptions, Pick<ChecksumOutput, "include" | "exclude" | "recursive"> {
|
|
111
|
+
dot?: boolean;
|
|
112
|
+
sortBy?: number;
|
|
113
|
+
verbose?: boolean;
|
|
114
|
+
ignore?: string[];
|
|
115
|
+
joinRoot?: boolean;
|
|
116
|
+
outPath?: string;
|
|
117
|
+
throwsEmpty?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type ImageMimeMap = Map<string, InstallData<IImage, ImageConstructor>>;
|
|
121
|
+
export type FetchType = FETCH_TYPE[keyof FETCH_TYPE];
|
|
122
122
|
export type PostFinalizeCallback = (files: FileInfo[] | string[], errors: string[], status?: LogStatus[]) => void;
|