@thestarweb/star-framework-app-web 1.2.5 → 1.3.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/CHANGELOG.md +46 -0
- package/dist/abort-signal/browser.js +2 -2
- package/dist/abort-signal/browser.js.map +1 -1
- package/dist/abort-signal/index.js +3 -3
- package/dist/abort-signal/index.js.map +1 -1
- package/dist/abort-signal/server.js +4 -3
- package/dist/abort-signal/server.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/cli/dev-server.js +1 -1
- package/dist/cli/dev-server.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/interceptor/index.js +5 -4
- package/dist/interceptor/index.js.map +1 -1
- package/dist/interceptor/middleware-to-interceptor/index.js +1 -1
- package/dist/interceptor/middleware-to-interceptor/index.js.map +1 -1
- package/dist/params/index.js +1 -0
- package/dist/params/index.js.map +1 -1
- package/dist/request/index.js +2 -2
- package/dist/request/index.js.map +1 -1
- package/dist/request/server.js +2 -2
- package/dist/request/server.js.map +1 -1
- package/dist/request/types.js +5 -4
- package/dist/request/types.js.map +1 -1
- package/dist/route/index.js +7 -3
- package/dist/route/index.js.map +1 -1
- package/dist/server/body/helper.js +1 -1
- package/dist/server/body/helper.js.map +1 -1
- package/dist/server/dump-api-type.js +1 -1
- package/dist/server/dump-api-type.js.map +1 -1
- package/dist/server/index.js +8 -5
- package/dist/server/index.js.map +1 -1
- package/dist/view/data-context/context.js +9 -6
- package/dist/view/data-context/context.js.map +1 -1
- package/dist/view/data-context/index.js +1 -1
- package/dist/view/html/create-element.js +2 -2
- package/dist/view/html/create-element.js.map +1 -1
- package/dist/view/html/parse-html-to-v-dom.js +1 -1
- package/dist/view/html/parse-html-to-v-dom.js.map +1 -1
- package/dist/view/html/render-v-dom-to-string.js +3 -3
- package/dist/view/html/render-v-dom-to-string.js.map +1 -1
- package/dist/view/layout.js +6 -4
- package/dist/view/layout.js.map +1 -1
- package/dist/view/render/render.js +5 -3
- package/dist/view/render/render.js.map +1 -1
- package/dist/view/types.js +1 -1
- package/dist/view/utils/find-route-dom.js +1 -1
- package/dist/view/utils/find-route-dom.js.map +1 -1
- package/dist/view/utils/get-render/client.js +10 -6
- package/dist/view/utils/get-render/client.js.map +1 -1
- package/dist/view/utils/get-render/common.js +6 -6
- package/dist/view/utils/get-render/common.js.map +1 -1
- package/dist/view/utils/get-render/server.js +26 -1
- package/dist/view/utils/get-render/server.js.map +1 -1
- package/dist/view/utils/remove-prefix.js +8 -0
- package/dist/view/utils/remove-prefix.js.map +1 -0
- package/dist/view/view.js +1 -1
- package/dist/view/view.js.map +1 -1
- package/package.json +10 -7
- package/resource/base-style.css +27 -27
- package/resource/default-index.html +10 -10
- package/src/cli-helper.ts +5 -5
- package/src/interceptor/index.ts +26 -26
- package/src/interceptor/middleware-to-interceptor/index.ts +29 -29
- package/src/interceptor/middleware-to-interceptor/mock-res.ts +255 -255
- package/src/interceptor/middleware-to-interceptor/mook-req.ts +218 -218
- package/src/interceptor/types.ts +7 -7
- package/src/params/index.ts +1 -0
- package/src/request/server.ts +2 -2
- package/src/request/types.ts +6 -5
- package/src/return-types/index.ts +2 -2
- package/src/return-types/location-to.ts +8 -8
- package/src/return-types/response-with-meta.ts +17 -17
- package/src/route/index.ts +43 -43
- package/src/route/types.ts +11 -11
- package/src/server/body/helper.ts +110 -110
- package/src/server/body/json.ts +217 -217
- package/src/server/body/types.ts +6 -6
- package/src/server/index.ts +8 -2
- package/src/server/types.ts +11 -11
- package/src/view/const.ts +2 -2
- package/src/view/data-context/index.ts +18 -18
- package/src/view/html/index.ts +3 -3
- package/src/view/html/render-v-dom-to-string.ts +79 -79
- package/src/view/html/types.ts +32 -32
- package/src/view/index.ts +6 -6
- package/src/view/render/html-render.ts +21 -21
- package/src/view/render/index.ts +2 -2
- package/src/view/types.ts +1 -1
- package/src/view/utils/find-route-dom.ts +19 -19
- package/src/view/utils/get-render/client.ts +9 -3
- package/src/view/utils/get-render/common.ts +2 -2
- package/src/view/utils/get-render/server.ts +34 -1
- package/src/view/utils/index.ts +2 -2
- package/src/view/utils/loading-progress.ts +58 -58
- package/src/view/utils/remove-prefix.ts +5 -0
- package/dist/runtime/index.js +0 -84
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/type.js +0 -11
- package/dist/runtime/type.js.map +0 -1
- package/dist/server/utils/pass-through-readable.js +0 -13
- package/dist/server/utils/pass-through-readable.js.map +0 -1
- package/dist/view/data-context/conetext.js +0 -70
- package/dist/view/data-context/conetext.js.map +0 -1
|
@@ -1,255 +1,255 @@
|
|
|
1
|
-
import { type OutgoingHttpHeaders } from "node:http";
|
|
2
|
-
import { ResponseWithMeta } from "../../return-types/response-with-meta.js";
|
|
3
|
-
import { type PipeOptions } from "node:stream";
|
|
4
|
-
|
|
5
|
-
export class MookRes {
|
|
6
|
-
_transformStream = new TransformStream();
|
|
7
|
-
_readable: ReadableStream;
|
|
8
|
-
_writeable: WritableStreamDefaultWriter;
|
|
9
|
-
|
|
10
|
-
statusCode = 404;
|
|
11
|
-
statusMessage = "";
|
|
12
|
-
strictContentLength = false;
|
|
13
|
-
headers: Record<string, any> = {};
|
|
14
|
-
assignSocket(socket: any): void {
|
|
15
|
-
throw new Error("Method not implemented.");
|
|
16
|
-
}
|
|
17
|
-
detachSocket(socket: any): void {
|
|
18
|
-
throw new Error("Method not implemented.");
|
|
19
|
-
}
|
|
20
|
-
writeContinue(callback?: () => void): void {
|
|
21
|
-
throw new Error("Method not implemented.");
|
|
22
|
-
}
|
|
23
|
-
writeEarlyHints(
|
|
24
|
-
hints: Record<string, string | string[]>,
|
|
25
|
-
callback?: () => void,
|
|
26
|
-
): void {
|
|
27
|
-
throw new Error("Method not implemented.");
|
|
28
|
-
}
|
|
29
|
-
writeHead(statusCode: any, statusMessage?: unknown, headers?: any): this {
|
|
30
|
-
this.statusCode = statusCode;
|
|
31
|
-
if (headers) this.setHeaders(headers);
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
writeProcessing(callback?: () => void): void {
|
|
35
|
-
throw new Error("Method not implemented.");
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private readonly __sf_send: () => void;
|
|
39
|
-
constructor(
|
|
40
|
-
public req: any,
|
|
41
|
-
callback: (res: ResponseWithMeta) => any,
|
|
42
|
-
) {
|
|
43
|
-
this._readable = this._transformStream.readable;
|
|
44
|
-
this._writeable = this._transformStream.writable.getWriter();
|
|
45
|
-
this.__sf_send = () => {
|
|
46
|
-
if (!this.sendDate) {
|
|
47
|
-
this.sendDate = true;
|
|
48
|
-
callback(
|
|
49
|
-
new ResponseWithMeta(this._transformStream.readable, {
|
|
50
|
-
code: this.statusCode,
|
|
51
|
-
header: this.getHeaders() as any,
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
chunkedEncoding = false;
|
|
58
|
-
shouldKeepAlive = true;
|
|
59
|
-
useChunkedEncodingByDefault = false;
|
|
60
|
-
sendDate = false;
|
|
61
|
-
finishe = false;
|
|
62
|
-
headersSent = false;
|
|
63
|
-
connection = null;
|
|
64
|
-
socket = null;
|
|
65
|
-
setTimeout(msecs: number, callback?: () => void): this {
|
|
66
|
-
throw new Error("Method not implemented.");
|
|
67
|
-
}
|
|
68
|
-
setHeader(name: string, value: number | string | readonly string[]) {
|
|
69
|
-
this.headers[name] = value;
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
setHeaders(
|
|
73
|
-
headers: Headers | Map<string, number | string | readonly string[]>,
|
|
74
|
-
): this {
|
|
75
|
-
if (headers instanceof Map) {
|
|
76
|
-
headers.forEach((value, key) => {
|
|
77
|
-
this.setHeader(key, value);
|
|
78
|
-
});
|
|
79
|
-
} else {
|
|
80
|
-
this.headers = {
|
|
81
|
-
...this.headers,
|
|
82
|
-
...headers,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
appendHeader(name: string, value: string | readonly string[]): this {
|
|
88
|
-
if (!this.headers[name]) {
|
|
89
|
-
this.headers[name] = value;
|
|
90
|
-
} else {
|
|
91
|
-
if (!Array.isArray(this.headers[name])) {
|
|
92
|
-
this.headers[name] = [this.headers[name]];
|
|
93
|
-
}
|
|
94
|
-
this.headers[name].push(...(Array.isArray(value) ? value : [value]));
|
|
95
|
-
}
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
getHeader(name: string) {
|
|
99
|
-
return this.headers[name];
|
|
100
|
-
}
|
|
101
|
-
getHeaders() {
|
|
102
|
-
return this.headers;
|
|
103
|
-
}
|
|
104
|
-
getHeaderNames() {
|
|
105
|
-
return Object.keys(this.headers);
|
|
106
|
-
}
|
|
107
|
-
hasHeader(name: string) {
|
|
108
|
-
return name in this.headers;
|
|
109
|
-
}
|
|
110
|
-
removeHeader(name: string): void {
|
|
111
|
-
delete this.headers[name];
|
|
112
|
-
}
|
|
113
|
-
addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>) {
|
|
114
|
-
throw new Error("Method not implemented.");
|
|
115
|
-
}
|
|
116
|
-
flushHeaders(): void {
|
|
117
|
-
throw new Error("Method not implemented.");
|
|
118
|
-
}
|
|
119
|
-
addListener(eventName: unknown, listener: unknown): this {
|
|
120
|
-
throw new Error("Method not implemented.");
|
|
121
|
-
}
|
|
122
|
-
emit(eventName: unknown, ...args: unknown[]): boolean {
|
|
123
|
-
throw new Error("Method not implemented.");
|
|
124
|
-
}
|
|
125
|
-
listenerCount(eventName: unknown, listener?: unknown): number {
|
|
126
|
-
throw new Error("Method not implemented.");
|
|
127
|
-
}
|
|
128
|
-
listeners(eventName: unknown): any {
|
|
129
|
-
throw new Error("Method not implemented.");
|
|
130
|
-
}
|
|
131
|
-
off(eventName: unknown, listener: unknown): this {
|
|
132
|
-
throw new Error("Method not implemented.");
|
|
133
|
-
}
|
|
134
|
-
on(eventName: unknown, listener: unknown): this {
|
|
135
|
-
throw new Error("Method not implemented.");
|
|
136
|
-
}
|
|
137
|
-
once(eventName: unknown, listener: unknown): this {
|
|
138
|
-
throw new Error("Method not implemented.");
|
|
139
|
-
}
|
|
140
|
-
prependListener(eventName: unknown, listener: unknown): this {
|
|
141
|
-
throw new Error("Method not implemented.");
|
|
142
|
-
}
|
|
143
|
-
prependOnceListener(eventName: unknown, listener: unknown): this {
|
|
144
|
-
throw new Error("Method not implemented.");
|
|
145
|
-
}
|
|
146
|
-
rawListeners(eventName: unknown): any {
|
|
147
|
-
throw new Error("Method not implemented.");
|
|
148
|
-
}
|
|
149
|
-
removeAllListeners(eventName?: unknown): this {
|
|
150
|
-
throw new Error("Method not implemented.");
|
|
151
|
-
}
|
|
152
|
-
removeListener(eventName: unknown, listener: unknown): this {
|
|
153
|
-
throw new Error("Method not implemented.");
|
|
154
|
-
}
|
|
155
|
-
writable = true;
|
|
156
|
-
writableAborted = false;
|
|
157
|
-
writableEnded = false;
|
|
158
|
-
writableFinished = false;
|
|
159
|
-
writableHighWaterMark = 16 * 1024;
|
|
160
|
-
writableLength = 0;
|
|
161
|
-
writableObjectMode = false;
|
|
162
|
-
writableCorked = 0;
|
|
163
|
-
destroyed = false;
|
|
164
|
-
closed = false;
|
|
165
|
-
errored = null;
|
|
166
|
-
writableNeedDrain = false;
|
|
167
|
-
_write(
|
|
168
|
-
chunk: any,
|
|
169
|
-
encoding: BufferEncoding,
|
|
170
|
-
callback?: (error?: Error | null) => void,
|
|
171
|
-
) {
|
|
172
|
-
this.__sf_send();
|
|
173
|
-
const p = this._writeable.write(
|
|
174
|
-
typeof chunk === "string" ? Buffer.from(chunk, encoding) : chunk,
|
|
175
|
-
);
|
|
176
|
-
if (callback) {
|
|
177
|
-
p.then(() => callback());
|
|
178
|
-
p.catch((e) => callback(e));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
_writev?(
|
|
182
|
-
chunks: { chunk: any; encoding: BufferEncoding }[],
|
|
183
|
-
callback: (error?: Error | null) => void,
|
|
184
|
-
): void {
|
|
185
|
-
const p = chunks.reduce((p, { chunk, encoding }) => {
|
|
186
|
-
return p.then(() => this._write(chunk, encoding));
|
|
187
|
-
}, Promise.resolve());
|
|
188
|
-
if (callback) {
|
|
189
|
-
p.then(() => callback());
|
|
190
|
-
p.catch((e) => callback(e));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
_construct?(callback: (error?: Error | null) => void): void {
|
|
194
|
-
throw new Error("Method not implemented.");
|
|
195
|
-
}
|
|
196
|
-
_destroy(
|
|
197
|
-
error: Error | null,
|
|
198
|
-
callback: (error?: Error | null) => void,
|
|
199
|
-
): void {
|
|
200
|
-
throw new Error("Method not implemented.");
|
|
201
|
-
}
|
|
202
|
-
_final(callback: (error?: Error | null) => void): void {
|
|
203
|
-
throw new Error("Method not implemented.");
|
|
204
|
-
}
|
|
205
|
-
_defaultEncoding: BufferEncoding = "utf-8";
|
|
206
|
-
write(chunk: unknown, encoding?: any, callback?: any): boolean {
|
|
207
|
-
if (typeof encoding === "function") {
|
|
208
|
-
callback = encoding;
|
|
209
|
-
encoding = undefined;
|
|
210
|
-
}
|
|
211
|
-
this._write(chunk, encoding || this._defaultEncoding, callback);
|
|
212
|
-
return true;
|
|
213
|
-
}
|
|
214
|
-
setDefaultEncoding(encoding: BufferEncoding) {
|
|
215
|
-
this._defaultEncoding = encoding;
|
|
216
|
-
return this;
|
|
217
|
-
}
|
|
218
|
-
end(chunk?: unknown, encoding?: unknown, cb?: unknown) {
|
|
219
|
-
this.writableEnded = true;
|
|
220
|
-
this.writableFinished = true;
|
|
221
|
-
if (typeof chunk !== "function") {
|
|
222
|
-
this.write(chunk, encoding, cb);
|
|
223
|
-
} else {
|
|
224
|
-
this.__sf_send();
|
|
225
|
-
chunk?.();
|
|
226
|
-
}
|
|
227
|
-
this._writeable.close();
|
|
228
|
-
return this;
|
|
229
|
-
}
|
|
230
|
-
cork(): void {
|
|
231
|
-
this.writableCorked++;
|
|
232
|
-
}
|
|
233
|
-
uncork(): void {
|
|
234
|
-
this.writableCorked--;
|
|
235
|
-
}
|
|
236
|
-
destroy(error?: Error): this {
|
|
237
|
-
return this;
|
|
238
|
-
}
|
|
239
|
-
async [Symbol.asyncDispose](): Promise<void> {}
|
|
240
|
-
pipe<T extends NodeJS.WritableStream>(
|
|
241
|
-
destination: T,
|
|
242
|
-
options?: PipeOptions,
|
|
243
|
-
): T {
|
|
244
|
-
throw new Error("Method not implemented.");
|
|
245
|
-
}
|
|
246
|
-
eventNames(): (string | symbol)[] {
|
|
247
|
-
throw new Error("Method not implemented.");
|
|
248
|
-
}
|
|
249
|
-
getMaxListeners(): number {
|
|
250
|
-
throw new Error("Method not implemented.");
|
|
251
|
-
}
|
|
252
|
-
setMaxListeners(n: number): this {
|
|
253
|
-
throw new Error("Method not implemented.");
|
|
254
|
-
}
|
|
255
|
-
}
|
|
1
|
+
import { type OutgoingHttpHeaders } from "node:http";
|
|
2
|
+
import { ResponseWithMeta } from "../../return-types/response-with-meta.js";
|
|
3
|
+
import { type PipeOptions } from "node:stream";
|
|
4
|
+
|
|
5
|
+
export class MookRes {
|
|
6
|
+
_transformStream = new TransformStream();
|
|
7
|
+
_readable: ReadableStream;
|
|
8
|
+
_writeable: WritableStreamDefaultWriter;
|
|
9
|
+
|
|
10
|
+
statusCode = 404;
|
|
11
|
+
statusMessage = "";
|
|
12
|
+
strictContentLength = false;
|
|
13
|
+
headers: Record<string, any> = {};
|
|
14
|
+
assignSocket(socket: any): void {
|
|
15
|
+
throw new Error("Method not implemented.");
|
|
16
|
+
}
|
|
17
|
+
detachSocket(socket: any): void {
|
|
18
|
+
throw new Error("Method not implemented.");
|
|
19
|
+
}
|
|
20
|
+
writeContinue(callback?: () => void): void {
|
|
21
|
+
throw new Error("Method not implemented.");
|
|
22
|
+
}
|
|
23
|
+
writeEarlyHints(
|
|
24
|
+
hints: Record<string, string | string[]>,
|
|
25
|
+
callback?: () => void,
|
|
26
|
+
): void {
|
|
27
|
+
throw new Error("Method not implemented.");
|
|
28
|
+
}
|
|
29
|
+
writeHead(statusCode: any, statusMessage?: unknown, headers?: any): this {
|
|
30
|
+
this.statusCode = statusCode;
|
|
31
|
+
if (headers) this.setHeaders(headers);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
writeProcessing(callback?: () => void): void {
|
|
35
|
+
throw new Error("Method not implemented.");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private readonly __sf_send: () => void;
|
|
39
|
+
constructor(
|
|
40
|
+
public req: any,
|
|
41
|
+
callback: (res: ResponseWithMeta) => any,
|
|
42
|
+
) {
|
|
43
|
+
this._readable = this._transformStream.readable;
|
|
44
|
+
this._writeable = this._transformStream.writable.getWriter();
|
|
45
|
+
this.__sf_send = () => {
|
|
46
|
+
if (!this.sendDate) {
|
|
47
|
+
this.sendDate = true;
|
|
48
|
+
callback(
|
|
49
|
+
new ResponseWithMeta(this._transformStream.readable, {
|
|
50
|
+
code: this.statusCode,
|
|
51
|
+
header: this.getHeaders() as any,
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
chunkedEncoding = false;
|
|
58
|
+
shouldKeepAlive = true;
|
|
59
|
+
useChunkedEncodingByDefault = false;
|
|
60
|
+
sendDate = false;
|
|
61
|
+
finishe = false;
|
|
62
|
+
headersSent = false;
|
|
63
|
+
connection = null;
|
|
64
|
+
socket = null;
|
|
65
|
+
setTimeout(msecs: number, callback?: () => void): this {
|
|
66
|
+
throw new Error("Method not implemented.");
|
|
67
|
+
}
|
|
68
|
+
setHeader(name: string, value: number | string | readonly string[]) {
|
|
69
|
+
this.headers[name] = value;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
setHeaders(
|
|
73
|
+
headers: Headers | Map<string, number | string | readonly string[]>,
|
|
74
|
+
): this {
|
|
75
|
+
if (headers instanceof Map) {
|
|
76
|
+
headers.forEach((value, key) => {
|
|
77
|
+
this.setHeader(key, value);
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
this.headers = {
|
|
81
|
+
...this.headers,
|
|
82
|
+
...headers,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
appendHeader(name: string, value: string | readonly string[]): this {
|
|
88
|
+
if (!this.headers[name]) {
|
|
89
|
+
this.headers[name] = value;
|
|
90
|
+
} else {
|
|
91
|
+
if (!Array.isArray(this.headers[name])) {
|
|
92
|
+
this.headers[name] = [this.headers[name]];
|
|
93
|
+
}
|
|
94
|
+
this.headers[name].push(...(Array.isArray(value) ? value : [value]));
|
|
95
|
+
}
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
getHeader(name: string) {
|
|
99
|
+
return this.headers[name];
|
|
100
|
+
}
|
|
101
|
+
getHeaders() {
|
|
102
|
+
return this.headers;
|
|
103
|
+
}
|
|
104
|
+
getHeaderNames() {
|
|
105
|
+
return Object.keys(this.headers);
|
|
106
|
+
}
|
|
107
|
+
hasHeader(name: string) {
|
|
108
|
+
return name in this.headers;
|
|
109
|
+
}
|
|
110
|
+
removeHeader(name: string): void {
|
|
111
|
+
delete this.headers[name];
|
|
112
|
+
}
|
|
113
|
+
addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>) {
|
|
114
|
+
throw new Error("Method not implemented.");
|
|
115
|
+
}
|
|
116
|
+
flushHeaders(): void {
|
|
117
|
+
throw new Error("Method not implemented.");
|
|
118
|
+
}
|
|
119
|
+
addListener(eventName: unknown, listener: unknown): this {
|
|
120
|
+
throw new Error("Method not implemented.");
|
|
121
|
+
}
|
|
122
|
+
emit(eventName: unknown, ...args: unknown[]): boolean {
|
|
123
|
+
throw new Error("Method not implemented.");
|
|
124
|
+
}
|
|
125
|
+
listenerCount(eventName: unknown, listener?: unknown): number {
|
|
126
|
+
throw new Error("Method not implemented.");
|
|
127
|
+
}
|
|
128
|
+
listeners(eventName: unknown): any {
|
|
129
|
+
throw new Error("Method not implemented.");
|
|
130
|
+
}
|
|
131
|
+
off(eventName: unknown, listener: unknown): this {
|
|
132
|
+
throw new Error("Method not implemented.");
|
|
133
|
+
}
|
|
134
|
+
on(eventName: unknown, listener: unknown): this {
|
|
135
|
+
throw new Error("Method not implemented.");
|
|
136
|
+
}
|
|
137
|
+
once(eventName: unknown, listener: unknown): this {
|
|
138
|
+
throw new Error("Method not implemented.");
|
|
139
|
+
}
|
|
140
|
+
prependListener(eventName: unknown, listener: unknown): this {
|
|
141
|
+
throw new Error("Method not implemented.");
|
|
142
|
+
}
|
|
143
|
+
prependOnceListener(eventName: unknown, listener: unknown): this {
|
|
144
|
+
throw new Error("Method not implemented.");
|
|
145
|
+
}
|
|
146
|
+
rawListeners(eventName: unknown): any {
|
|
147
|
+
throw new Error("Method not implemented.");
|
|
148
|
+
}
|
|
149
|
+
removeAllListeners(eventName?: unknown): this {
|
|
150
|
+
throw new Error("Method not implemented.");
|
|
151
|
+
}
|
|
152
|
+
removeListener(eventName: unknown, listener: unknown): this {
|
|
153
|
+
throw new Error("Method not implemented.");
|
|
154
|
+
}
|
|
155
|
+
writable = true;
|
|
156
|
+
writableAborted = false;
|
|
157
|
+
writableEnded = false;
|
|
158
|
+
writableFinished = false;
|
|
159
|
+
writableHighWaterMark = 16 * 1024;
|
|
160
|
+
writableLength = 0;
|
|
161
|
+
writableObjectMode = false;
|
|
162
|
+
writableCorked = 0;
|
|
163
|
+
destroyed = false;
|
|
164
|
+
closed = false;
|
|
165
|
+
errored = null;
|
|
166
|
+
writableNeedDrain = false;
|
|
167
|
+
_write(
|
|
168
|
+
chunk: any,
|
|
169
|
+
encoding: BufferEncoding,
|
|
170
|
+
callback?: (error?: Error | null) => void,
|
|
171
|
+
) {
|
|
172
|
+
this.__sf_send();
|
|
173
|
+
const p = this._writeable.write(
|
|
174
|
+
typeof chunk === "string" ? Buffer.from(chunk, encoding) : chunk,
|
|
175
|
+
);
|
|
176
|
+
if (callback) {
|
|
177
|
+
p.then(() => callback());
|
|
178
|
+
p.catch((e) => callback(e));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
_writev?(
|
|
182
|
+
chunks: { chunk: any; encoding: BufferEncoding }[],
|
|
183
|
+
callback: (error?: Error | null) => void,
|
|
184
|
+
): void {
|
|
185
|
+
const p = chunks.reduce((p, { chunk, encoding }) => {
|
|
186
|
+
return p.then(() => this._write(chunk, encoding));
|
|
187
|
+
}, Promise.resolve());
|
|
188
|
+
if (callback) {
|
|
189
|
+
p.then(() => callback());
|
|
190
|
+
p.catch((e) => callback(e));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
_construct?(callback: (error?: Error | null) => void): void {
|
|
194
|
+
throw new Error("Method not implemented.");
|
|
195
|
+
}
|
|
196
|
+
_destroy(
|
|
197
|
+
error: Error | null,
|
|
198
|
+
callback: (error?: Error | null) => void,
|
|
199
|
+
): void {
|
|
200
|
+
throw new Error("Method not implemented.");
|
|
201
|
+
}
|
|
202
|
+
_final(callback: (error?: Error | null) => void): void {
|
|
203
|
+
throw new Error("Method not implemented.");
|
|
204
|
+
}
|
|
205
|
+
_defaultEncoding: BufferEncoding = "utf-8";
|
|
206
|
+
write(chunk: unknown, encoding?: any, callback?: any): boolean {
|
|
207
|
+
if (typeof encoding === "function") {
|
|
208
|
+
callback = encoding;
|
|
209
|
+
encoding = undefined;
|
|
210
|
+
}
|
|
211
|
+
this._write(chunk, encoding || this._defaultEncoding, callback);
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
setDefaultEncoding(encoding: BufferEncoding) {
|
|
215
|
+
this._defaultEncoding = encoding;
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
end(chunk?: unknown, encoding?: unknown, cb?: unknown) {
|
|
219
|
+
this.writableEnded = true;
|
|
220
|
+
this.writableFinished = true;
|
|
221
|
+
if (typeof chunk !== "function") {
|
|
222
|
+
this.write(chunk, encoding, cb);
|
|
223
|
+
} else {
|
|
224
|
+
this.__sf_send();
|
|
225
|
+
chunk?.();
|
|
226
|
+
}
|
|
227
|
+
this._writeable.close();
|
|
228
|
+
return this;
|
|
229
|
+
}
|
|
230
|
+
cork(): void {
|
|
231
|
+
this.writableCorked++;
|
|
232
|
+
}
|
|
233
|
+
uncork(): void {
|
|
234
|
+
this.writableCorked--;
|
|
235
|
+
}
|
|
236
|
+
destroy(error?: Error): this {
|
|
237
|
+
return this;
|
|
238
|
+
}
|
|
239
|
+
async [Symbol.asyncDispose](): Promise<void> {}
|
|
240
|
+
pipe<T extends NodeJS.WritableStream>(
|
|
241
|
+
destination: T,
|
|
242
|
+
options?: PipeOptions,
|
|
243
|
+
): T {
|
|
244
|
+
throw new Error("Method not implemented.");
|
|
245
|
+
}
|
|
246
|
+
eventNames(): (string | symbol)[] {
|
|
247
|
+
throw new Error("Method not implemented.");
|
|
248
|
+
}
|
|
249
|
+
getMaxListeners(): number {
|
|
250
|
+
throw new Error("Method not implemented.");
|
|
251
|
+
}
|
|
252
|
+
setMaxListeners(n: number): this {
|
|
253
|
+
throw new Error("Method not implemented.");
|
|
254
|
+
}
|
|
255
|
+
}
|