chore: fix ts generation

This commit is contained in:
alexander-akait 2025-03-14 01:05:02 +03:00
parent 370bacc6c8
commit b91099b38e
5 changed files with 96 additions and 84 deletions

View File

@ -3402,8 +3402,11 @@ export interface LazyCompilationDefaultBackendOptions {
* Specifies how to create the server handling the EventSource requests. * Specifies how to create the server handling the EventSource requests.
*/ */
server?: server?:
| (import("https").ServerOptions | import("http").ServerOptions) | (
| (() => import("net").Server); | import("../lib/hmr/lazyCompilationBackend").HttpsServerOptions
| import("../lib/hmr/lazyCompilationBackend").HttpServerOptions
)
| (() => import("../lib/hmr/lazyCompilationBackend").Server);
} }
/** /**
* Options for compiling entrypoints and import()s only when they are accessed. * Options for compiling entrypoints and import()s only when they are accessed.

View File

@ -42,7 +42,7 @@
"@types/glob-to-regexp": "^0.4.4", "@types/glob-to-regexp": "^0.4.4",
"@types/jest": "^29.5.11", "@types/jest": "^29.5.11",
"@types/mime-types": "^2.1.4", "@types/mime-types": "^2.1.4",
"@types/node": "^22.0.0", "@types/node": "^22.13.10",
"assemblyscript": "^0.27.34", "assemblyscript": "^0.27.34",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"benchmark": "^2.1.4", "benchmark": "^2.1.4",

View File

@ -2086,12 +2086,12 @@
"type": "object", "type": "object",
"additionalProperties": true, "additionalProperties": true,
"properties": {}, "properties": {},
"tsType": "(import(\"https\").ServerOptions | import(\"http\").ServerOptions)" "tsType": "(import(\"../lib/hmr/lazyCompilationBackend\").HttpsServerOptions | import(\"../lib/hmr/lazyCompilationBackend\").HttpServerOptions)"
}, },
{ {
"description": "A custom create server function.", "description": "A custom create server function.",
"instanceof": "Function", "instanceof": "Function",
"tsType": "(() => import(\"net\").Server)" "tsType": "(() => import(\"../lib/hmr/lazyCompilationBackend\").Server)"
} }
] ]
} }

152
types.d.ts vendored
View File

@ -85,11 +85,7 @@ import {
WithStatement, WithStatement,
YieldExpression YieldExpression
} from "estree"; } from "estree";
import { import { IncomingMessage, ServerOptions } from "http";
IncomingMessage,
ServerOptions as ServerOptionsImport,
ServerResponse
} from "http";
import { ListenOptions, Server } from "net"; import { ListenOptions, Server } from "net";
import { validate as validateFunction } from "schema-utils"; import { validate as validateFunction } from "schema-utils";
import { default as ValidationError } from "schema-utils/declarations/ValidationError"; import { default as ValidationError } from "schema-utils/declarations/ValidationError";
@ -249,19 +245,19 @@ declare interface ArgumentConfig {
values?: any[]; values?: any[];
} }
type ArrayBufferLike = ArrayBuffer | SharedArrayBuffer; type ArrayBufferLike = ArrayBuffer | SharedArrayBuffer;
type ArrayBufferView = type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
| Uint8Array<ArrayBufferLike> | Uint8Array<TArrayBuffer>
| Uint8ClampedArray<ArrayBufferLike> | Uint8ClampedArray<TArrayBuffer>
| Uint16Array<ArrayBufferLike> | Uint16Array<TArrayBuffer>
| Uint32Array<ArrayBufferLike> | Uint32Array<TArrayBuffer>
| Int8Array<ArrayBufferLike> | Int8Array<TArrayBuffer>
| Int16Array<ArrayBufferLike> | Int16Array<TArrayBuffer>
| Int32Array<ArrayBufferLike> | Int32Array<TArrayBuffer>
| BigUint64Array<ArrayBufferLike> | BigUint64Array<TArrayBuffer>
| BigInt64Array<ArrayBufferLike> | BigInt64Array<TArrayBuffer>
| Float32Array<ArrayBufferLike> | Float32Array<TArrayBuffer>
| Float64Array<ArrayBufferLike> | Float64Array<TArrayBuffer>
| DataView<ArrayBufferLike>; | DataView<TArrayBuffer>;
declare interface Asset { declare interface Asset {
/** /**
* the filename of the asset * the filename of the asset
@ -876,10 +872,10 @@ type BufferEncoding =
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
type BufferEncodingOption = "buffer" | { encoding: "buffer" }; type BufferEncodingOption = "buffer" | { encoding: "buffer" };
type BuildInfo = KnownBuildInfo & Record<string, any>; type BuildInfo = KnownBuildInfo & Record<string, any>;
@ -3957,10 +3953,10 @@ type EncodingOption =
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| ObjectEncodingOptions; | ObjectEncodingOptions;
type Entry = type Entry =
@ -5545,7 +5541,7 @@ declare interface HashedModuleIdsPluginOptions {
/** /**
* The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
*/ */
hashDigest?: "latin1" | "base64" | "hex"; hashDigest?: "base64" | "latin1" | "hex";
/** /**
* The prefix length of the hash digest to use, defaults to 4. * The prefix length of the hash digest to use, defaults to 4.
@ -5621,6 +5617,9 @@ declare class HttpUriPlugin {
*/ */
apply(compiler: Compiler): void; apply(compiler: Compiler): void;
} }
type HttpsServerOptions = SecureContextOptions &
TlsOptions &
ServerOptions<typeof IncomingMessage>;
type IBigIntStats = IStatsBase<bigint> & { type IBigIntStats = IStatsBase<bigint> & {
atimeNs: bigint; atimeNs: bigint;
mtimeNs: bigint; mtimeNs: bigint;
@ -5891,15 +5890,15 @@ declare interface IntermediateFileSystemExtras {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| WriteStreamOptions | WriteStreamOptions
) => NodeJS.WritableStream; ) => NodeJS.WritableStream;
open: Open; open: Open;
read: Read<ArrayBufferView>; read: Read<ArrayBufferView<ArrayBufferLike>>;
close: ( close: (
df: number, df: number,
callback: (err: null | NodeJS.ErrnoException) => void callback: (err: null | NodeJS.ErrnoException) => void
@ -8013,8 +8012,8 @@ declare interface LazyCompilationDefaultBackendOptions {
* Specifies how to create the server handling the EventSource requests. * Specifies how to create the server handling the EventSource requests.
*/ */
server?: server?:
| ServerOptionsImport<typeof IncomingMessage> | ServerOptions<typeof IncomingMessage>
| ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse> | HttpsServerOptions
| (() => Server); | (() => Server);
} }
@ -10145,10 +10144,10 @@ declare interface ObjectEncodingOptions {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
} }
declare interface ObjectForExtract { declare interface ObjectForExtract {
@ -11369,9 +11368,13 @@ declare interface PathData {
url?: string; url?: string;
} }
type PathLikeFs = string | Buffer | URL; type PathLikeFs = string | Buffer | URL;
type PathLikeTypes = string | Buffer | URL_url; type PathLikeTypes = string | URL_url | Buffer<ArrayBufferLike>;
type PathOrFileDescriptorFs = string | number | Buffer | URL; type PathOrFileDescriptorFs = string | number | Buffer | URL;
type PathOrFileDescriptorTypes = string | number | Buffer | URL_url; type PathOrFileDescriptorTypes =
| string
| number
| Buffer<ArrayBufferLike>
| URL_url;
type Pattern = type Pattern =
| Identifier | Identifier
| MemberExpression | MemberExpression
@ -11722,7 +11725,10 @@ declare interface RawSourceMap {
mappings: string; mappings: string;
file: string; file: string;
} }
declare interface Read<TBuffer extends ArrayBufferView = ArrayBufferView> { declare interface Read<
TBuffer extends
ArrayBufferView<ArrayBufferLike> = ArrayBufferView<ArrayBufferLike>
> {
( (
fd: number, fd: number,
buffer: TBuffer, buffer: TBuffer,
@ -11749,11 +11755,13 @@ declare interface Read<TBuffer extends ArrayBufferView = ArrayBufferView> {
callback: ( callback: (
err: null | NodeJS.ErrnoException, err: null | NodeJS.ErrnoException,
bytesRead: number, bytesRead: number,
buffer: ArrayBufferView buffer: ArrayBufferView<ArrayBufferLike>
) => void ) => void
): void; ): void;
} }
declare interface ReadAsyncOptions<TBuffer extends ArrayBufferView> { declare interface ReadAsyncOptions<
TBuffer extends ArrayBufferView<ArrayBufferLike>
> {
offset?: number; offset?: number;
length?: number; length?: number;
position?: null | number | bigint; position?: null | number | bigint;
@ -11805,6 +11813,7 @@ declare interface ReadFileFs {
( (
path: PathOrFileDescriptorFs, path: PathOrFileDescriptorFs,
options: options:
| ({ encoding: BufferEncoding; flag?: string } & Abortable)
| "ascii" | "ascii"
| "utf8" | "utf8"
| "utf-8" | "utf-8"
@ -11812,11 +11821,10 @@ declare interface ReadFileFs {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| ({ encoding: BufferEncoding; flag?: string } & Abortable)
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex", | "hex",
callback: (err: null | NodeJS.ErrnoException, result?: string) => void callback: (err: null | NodeJS.ErrnoException, result?: string) => void
): void; ): void;
@ -11832,10 +11840,10 @@ declare interface ReadFileFs {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { flag?: string } & Abortable), | (ObjectEncodingOptions & { flag?: string } & Abortable),
callback: ( callback: (
@ -11863,10 +11871,10 @@ declare interface ReadFileSync {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| { encoding: BufferEncoding; flag?: string } | { encoding: BufferEncoding; flag?: string }
): string; ): string;
@ -11881,10 +11889,10 @@ declare interface ReadFileSync {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { flag?: string }) | (ObjectEncodingOptions & { flag?: string })
): string | Buffer; ): string | Buffer;
@ -11908,10 +11916,10 @@ declare interface ReadFileTypes {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| ({ encoding: BufferEncoding; flag?: string } & Abortable), | ({ encoding: BufferEncoding; flag?: string } & Abortable),
callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
@ -11928,10 +11936,10 @@ declare interface ReadFileTypes {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { flag?: string } & Abortable), | (ObjectEncodingOptions & { flag?: string } & Abortable),
callback: ( callback: (
@ -11957,10 +11965,10 @@ declare interface ReaddirFs {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| { | {
encoding: encoding:
@ -11972,10 +11980,10 @@ declare interface ReaddirFs {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
withFileTypes?: false; withFileTypes?: false;
recursive?: boolean; recursive?: boolean;
@ -12005,10 +12013,10 @@ declare interface ReaddirFs {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { | (ObjectEncodingOptions & {
withFileTypes?: false; withFileTypes?: false;
@ -12040,10 +12048,10 @@ declare interface ReaddirSync {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| { | {
encoding: encoding:
@ -12055,10 +12063,10 @@ declare interface ReaddirSync {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
withFileTypes?: false; withFileTypes?: false;
recursive?: boolean; recursive?: boolean;
@ -12081,10 +12089,10 @@ declare interface ReaddirSync {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean }) | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
): string[] | Buffer[]; ): string[] | Buffer[];
@ -12109,10 +12117,10 @@ declare interface ReaddirTypes {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| { | {
encoding: encoding:
@ -12124,10 +12132,10 @@ declare interface ReaddirTypes {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
withFileTypes?: false; withFileTypes?: false;
recursive?: boolean; recursive?: boolean;
@ -12157,10 +12165,10 @@ declare interface ReaddirTypes {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & { | (ObjectEncodingOptions & {
withFileTypes?: false; withFileTypes?: false;
@ -14087,10 +14095,6 @@ declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
context?: any context?: any
): DeserializedType | Promise<DeserializedType>; ): DeserializedType | Promise<DeserializedType>;
} }
type ServerOptionsHttps<
Request extends typeof IncomingMessage = typeof IncomingMessage,
Response extends typeof ServerResponse = typeof ServerResponse
> = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
declare class SharePlugin { declare class SharePlugin {
constructor(options: SharePluginOptions); constructor(options: SharePluginOptions);
@ -15938,10 +15942,10 @@ type WriteFileOptions =
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex" | "hex"
| (ObjectEncodingOptions & | (ObjectEncodingOptions &
Abortable & { mode?: string | number; flag?: string; flush?: boolean }); Abortable & { mode?: string | number; flag?: string; flush?: boolean });
@ -15959,10 +15963,10 @@ declare interface WriteStreamOptions {
| "utf-16le" | "utf-16le"
| "ucs2" | "ucs2"
| "ucs-2" | "ucs-2"
| "latin1"
| "binary"
| "base64" | "base64"
| "base64url" | "base64url"
| "latin1"
| "binary"
| "hex"; | "hex";
fd?: any; fd?: any;
mode?: number; mode?: number;

View File

@ -1303,12 +1303,12 @@
resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.4.tgz#93a1933e24fed4fb9e4adc5963a63efcbb3317a2" resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.4.tgz#93a1933e24fed4fb9e4adc5963a63efcbb3317a2"
integrity sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w== integrity sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==
"@types/node@*", "@types/node@^22.0.0": "@types/node@*", "@types/node@^22.13.10":
version "22.5.5" version "22.13.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.5.tgz#52f939dd0f65fc552a4ad0b392f3c466cc5d7a44" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.10.tgz#df9ea358c5ed991266becc3109dc2dc9125d77e4"
integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA== integrity sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==
dependencies: dependencies:
undici-types "~6.19.2" undici-types "~6.20.0"
"@types/normalize-package-data@^2.4.3": "@types/normalize-package-data@^2.4.3":
version "2.4.4" version "2.4.4"
@ -6112,6 +6112,11 @@ undici-types@~6.19.2:
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
undici-types@~6.20.0:
version "6.20.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433"
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
unicorn-magic@^0.1.0: unicorn-magic@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4" resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4"