///
import * as http from "node:http";
import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders } from "node:http";
import { Http2SecureServer } from "node:http2";
import * as fs from "node:fs";
import { EventEmitter } from "node:events";
import { Server as Server$1, ServerOptions as ServerOptions$1 } from "node:https";
import * as net from "node:net";
import { Duplex, DuplexOptions, Stream } from "node:stream";
import { SecureContextOptions } from "node:tls";
import { URL as URL$1 } from "node:url";
import { ZlibOptions } from "node:zlib";
import * as Terser from "terser";
import * as PostCSS from "postcss";
import DartSass from "sass";
import SassEmbedded from "sass-embedded";
import Less from "less";
import Stylus from "stylus";
import Lightningcss from "lightningcss";
//#region node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/lib/main.d.ts
type Platform = 'browser' | 'node' | 'neutral';
type Format = 'iife' | 'cjs' | 'esm';
type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx';
type LogLevel$2 = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
type Charset = 'ascii' | 'utf8';
type Drop = 'console' | 'debugger';
type AbsPaths = 'code' | 'log' | 'metafile';
interface CommonOptions {
/** Documentation: https://esbuild.github.io/api/#sourcemap */
sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
/** Documentation: https://esbuild.github.io/api/#legal-comments */
legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
/** Documentation: https://esbuild.github.io/api/#source-root */
sourceRoot?: string;
/** Documentation: https://esbuild.github.io/api/#sources-content */
sourcesContent?: boolean;
/** Documentation: https://esbuild.github.io/api/#format */
format?: Format;
/** Documentation: https://esbuild.github.io/api/#global-name */
globalName?: string;
/** Documentation: https://esbuild.github.io/api/#target */
target?: string | string[];
/** Documentation: https://esbuild.github.io/api/#supported */
supported?: Record;
/** Documentation: https://esbuild.github.io/api/#platform */
platform?: Platform;
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleProps?: RegExp;
/** Documentation: https://esbuild.github.io/api/#mangle-props */
reserveProps?: RegExp;
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleQuoted?: boolean;
/** Documentation: https://esbuild.github.io/api/#mangle-props */
mangleCache?: Record;
/** Documentation: https://esbuild.github.io/api/#drop */
drop?: Drop[];
/** Documentation: https://esbuild.github.io/api/#drop-labels */
dropLabels?: string[];
/** Documentation: https://esbuild.github.io/api/#minify */
minify?: boolean;
/** Documentation: https://esbuild.github.io/api/#minify */
minifyWhitespace?: boolean;
/** Documentation: https://esbuild.github.io/api/#minify */
minifyIdentifiers?: boolean;
/** Documentation: https://esbuild.github.io/api/#minify */
minifySyntax?: boolean;
/** Documentation: https://esbuild.github.io/api/#line-limit */
lineLimit?: number;
/** Documentation: https://esbuild.github.io/api/#charset */
charset?: Charset;
/** Documentation: https://esbuild.github.io/api/#tree-shaking */
treeShaking?: boolean;
/** Documentation: https://esbuild.github.io/api/#ignore-annotations */
ignoreAnnotations?: boolean;
/** Documentation: https://esbuild.github.io/api/#jsx */
jsx?: 'transform' | 'preserve' | 'automatic';
/** Documentation: https://esbuild.github.io/api/#jsx-factory */
jsxFactory?: string;
/** Documentation: https://esbuild.github.io/api/#jsx-fragment */
jsxFragment?: string;
/** Documentation: https://esbuild.github.io/api/#jsx-import-source */
jsxImportSource?: string;
/** Documentation: https://esbuild.github.io/api/#jsx-development */
jsxDev?: boolean;
/** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
jsxSideEffects?: boolean;
/** Documentation: https://esbuild.github.io/api/#define */
define?: {
[key: string]: string;
};
/** Documentation: https://esbuild.github.io/api/#pure */
pure?: string[];
/** Documentation: https://esbuild.github.io/api/#keep-names */
keepNames?: boolean;
/** Documentation: https://esbuild.github.io/api/#abs-paths */
absPaths?: AbsPaths[];
/** Documentation: https://esbuild.github.io/api/#color */
color?: boolean;
/** Documentation: https://esbuild.github.io/api/#log-level */
logLevel?: LogLevel$2;
/** Documentation: https://esbuild.github.io/api/#log-limit */
logLimit?: number;
/** Documentation: https://esbuild.github.io/api/#log-override */
logOverride?: Record;
/** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
tsconfigRaw?: string | TsconfigRaw;
}
interface TsconfigRaw {
compilerOptions?: {
alwaysStrict?: boolean;
baseUrl?: string;
experimentalDecorators?: boolean;
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error';
jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev';
jsxFactory?: string;
jsxFragmentFactory?: string;
jsxImportSource?: string;
paths?: Record;
preserveValueImports?: boolean;
strict?: boolean;
target?: string;
useDefineForClassFields?: boolean;
verbatimModuleSyntax?: boolean;
};
}
interface BuildOptions$1 extends CommonOptions {
/** Documentation: https://esbuild.github.io/api/#bundle */
bundle?: boolean;
/** Documentation: https://esbuild.github.io/api/#splitting */
splitting?: boolean;
/** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
preserveSymlinks?: boolean;
/** Documentation: https://esbuild.github.io/api/#outfile */
outfile?: string;
/** Documentation: https://esbuild.github.io/api/#metafile */
metafile?: boolean;
/** Documentation: https://esbuild.github.io/api/#outdir */
outdir?: string;
/** Documentation: https://esbuild.github.io/api/#outbase */
outbase?: string;
/** Documentation: https://esbuild.github.io/api/#external */
external?: string[];
/** Documentation: https://esbuild.github.io/api/#packages */
packages?: 'bundle' | 'external';
/** Documentation: https://esbuild.github.io/api/#alias */
alias?: Record;
/** Documentation: https://esbuild.github.io/api/#loader */
loader?: {
[ext: string]: Loader;
};
/** Documentation: https://esbuild.github.io/api/#resolve-extensions */
resolveExtensions?: string[];
/** Documentation: https://esbuild.github.io/api/#main-fields */
mainFields?: string[];
/** Documentation: https://esbuild.github.io/api/#conditions */
conditions?: string[];
/** Documentation: https://esbuild.github.io/api/#write */
write?: boolean;
/** Documentation: https://esbuild.github.io/api/#allow-overwrite */
allowOverwrite?: boolean;
/** Documentation: https://esbuild.github.io/api/#tsconfig */
tsconfig?: string;
/** Documentation: https://esbuild.github.io/api/#out-extension */
outExtension?: {
[ext: string]: string;
};
/** Documentation: https://esbuild.github.io/api/#public-path */
publicPath?: string;
/** Documentation: https://esbuild.github.io/api/#entry-names */
entryNames?: string;
/** Documentation: https://esbuild.github.io/api/#chunk-names */
chunkNames?: string;
/** Documentation: https://esbuild.github.io/api/#asset-names */
assetNames?: string;
/** Documentation: https://esbuild.github.io/api/#inject */
inject?: string[];
/** Documentation: https://esbuild.github.io/api/#banner */
banner?: {
[type: string]: string;
};
/** Documentation: https://esbuild.github.io/api/#footer */
footer?: {
[type: string]: string;
};
/** Documentation: https://esbuild.github.io/api/#entry-points */
entryPoints?: (string | {
in: string;
out: string;
})[] | Record;
/** Documentation: https://esbuild.github.io/api/#stdin */
stdin?: StdinOptions;
/** Documentation: https://esbuild.github.io/plugins/ */
plugins?: Plugin$2[];
/** Documentation: https://esbuild.github.io/api/#working-directory */
absWorkingDir?: string;
/** Documentation: https://esbuild.github.io/api/#node-paths */
nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
}
interface StdinOptions {
contents: string | Uint8Array;
resolveDir?: string;
sourcefile?: string;
loader?: Loader;
}
interface Message {
id: string;
pluginName: string;
text: string;
location: Location | null;
notes: Note[];
/**
* Optional user-specified data that is passed through unmodified. You can
* use this to stash the original error, for example.
*/
detail: any;
}
interface Note {
text: string;
location: Location | null;
}
interface Location {
file: string;
namespace: string;
/** 1-based */
line: number;
/** 0-based, in bytes */
column: number;
/** in bytes */
length: number;
lineText: string;
suggestion: string;
}
interface OutputFile {
path: string;
contents: Uint8Array;
hash: string;
/** "contents" as text (changes automatically with "contents") */
readonly text: string;
}
interface BuildResult {
errors: Message[];
warnings: Message[];
/** Only when "write: false" */
outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined);
/** Only when "metafile: true" */
metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined);
/** Only when "mangleCache" is present */
mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
}
/** Documentation: https://esbuild.github.io/api/#serve-arguments */
interface ServeOptions {
port?: number;
host?: string;
servedir?: string;
keyfile?: string;
certfile?: string;
fallback?: string;
cors?: CORSOptions;
onRequest?: (args: ServeOnRequestArgs) => void;
}
/** Documentation: https://esbuild.github.io/api/#cors */
interface CORSOptions {
origin?: string | string[];
}
interface ServeOnRequestArgs {
remoteAddress: string;
method: string;
path: string;
status: number;
/** The time to generate the response, not to send it */
timeInMS: number;
}
/** Documentation: https://esbuild.github.io/api/#serve-return-values */
interface ServeResult {
port: number;
hosts: string[];
}
interface TransformOptions$1 extends CommonOptions {
/** Documentation: https://esbuild.github.io/api/#sourcefile */
sourcefile?: string;
/** Documentation: https://esbuild.github.io/api/#loader */
loader?: Loader;
/** Documentation: https://esbuild.github.io/api/#banner */
banner?: string;
/** Documentation: https://esbuild.github.io/api/#footer */
footer?: string;
}
interface TransformResult$2 {
code: string;
map: string;
warnings: Message[];
/** Only when "mangleCache" is present */
mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
/** Only when "legalComments" is "external" */
legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined);
}
interface Plugin$2 {
name: string;
setup: (build: PluginBuild) => (void | Promise);
}
interface PluginBuild {
/** Documentation: https://esbuild.github.io/plugins/#build-options */
initialOptions: BuildOptions$1;
/** Documentation: https://esbuild.github.io/plugins/#resolve */
resolve(path: string, options?: ResolveOptions$1): Promise;
/** Documentation: https://esbuild.github.io/plugins/#on-start */
onStart(callback: () => (OnStartResult | null | void | Promise)): void;
/** Documentation: https://esbuild.github.io/plugins/#on-end */
onEnd(callback: (result: BuildResult) => (OnEndResult | null | void | Promise)): void;
/** Documentation: https://esbuild.github.io/plugins/#on-resolve */
onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => (OnResolveResult | null | undefined | Promise)): void;
/** Documentation: https://esbuild.github.io/plugins/#on-load */
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => (OnLoadResult | null | undefined | Promise)): void;
/** Documentation: https://esbuild.github.io/plugins/#on-dispose */
onDispose(callback: () => void): void; // This is a full copy of the esbuild library in case you need it
esbuild: {
context: typeof context;
build: typeof build;
buildSync: typeof buildSync;
transform: typeof transform;
transformSync: typeof transformSync;
formatMessages: typeof formatMessages;
formatMessagesSync: typeof formatMessagesSync;
analyzeMetafile: typeof analyzeMetafile;
analyzeMetafileSync: typeof analyzeMetafileSync;
initialize: typeof initialize;
version: typeof version;
};
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-options */
interface ResolveOptions$1 {
pluginName?: string;
importer?: string;
namespace?: string;
resolveDir?: string;
kind?: ImportKind;
pluginData?: any;
with?: Record;
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
interface ResolveResult {
errors: Message[];
warnings: Message[];
path: string;
external: boolean;
sideEffects: boolean;
namespace: string;
suffix: string;
pluginData: any;
}
interface OnStartResult {
errors?: PartialMessage[];
warnings?: PartialMessage[];
}
interface OnEndResult {
errors?: PartialMessage[];
warnings?: PartialMessage[];
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
interface OnResolveOptions {
filter: RegExp;
namespace?: string;
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
interface OnResolveArgs {
path: string;
importer: string;
namespace: string;
resolveDir: string;
kind: ImportKind;
pluginData: any;
with: Record;
}
type ImportKind = 'entry-point' // JS
| 'import-statement' | 'require-call' | 'dynamic-import' | 'require-resolve' // CSS
| 'import-rule' | 'composes-from' | 'url-token';
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
interface OnResolveResult {
pluginName?: string;
errors?: PartialMessage[];
warnings?: PartialMessage[];
path?: string;
external?: boolean;
sideEffects?: boolean;
namespace?: string;
suffix?: string;
pluginData?: any;
watchFiles?: string[];
watchDirs?: string[];
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-options */
interface OnLoadOptions {
filter: RegExp;
namespace?: string;
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
interface OnLoadArgs {
path: string;
namespace: string;
suffix: string;
pluginData: any;
with: Record;
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-results */
interface OnLoadResult {
pluginName?: string;
errors?: PartialMessage[];
warnings?: PartialMessage[];
contents?: string | Uint8Array;
resolveDir?: string;
loader?: Loader;
pluginData?: any;
watchFiles?: string[];
watchDirs?: string[];
}
interface PartialMessage {
id?: string;
pluginName?: string;
text?: string;
location?: Partial | null;
notes?: PartialNote[];
detail?: any;
}
interface PartialNote {
text?: string;
location?: Partial | null;
}
/** Documentation: https://esbuild.github.io/api/#metafile */
interface Metafile {
inputs: {
[path: string]: {
bytes: number;
imports: {
path: string;
kind: ImportKind;
external?: boolean;
original?: string;
with?: Record;
}[];
format?: 'cjs' | 'esm';
with?: Record;
};
};
outputs: {
[path: string]: {
bytes: number;
inputs: {
[path: string]: {
bytesInOutput: number;
};
};
imports: {
path: string;
kind: ImportKind | 'file-loader';
external?: boolean;
}[];
exports: string[];
entryPoint?: string;
cssBundle?: string;
};
};
}
interface FormatMessagesOptions {
kind: 'error' | 'warning';
color?: boolean;
terminalWidth?: number;
}
interface AnalyzeMetafileOptions {
color?: boolean;
verbose?: boolean;
}
/** Documentation: https://esbuild.github.io/api/#watch-arguments */
interface WatchOptions$1 {
delay?: number; // In milliseconds
}
interface BuildContext {
/** Documentation: https://esbuild.github.io/api/#rebuild */
rebuild(): Promise>;
/** Documentation: https://esbuild.github.io/api/#watch */
watch(options?: WatchOptions$1): Promise;
/** Documentation: https://esbuild.github.io/api/#serve */
serve(options?: ServeOptions): Promise;
cancel(): Promise;
dispose(): Promise;
}
// This is a TypeScript type-level function which replaces any keys in "In"
// that aren't in "Out" with "never". We use this to reject properties with
// typos in object literals. See: https://stackoverflow.com/questions/49580725
type SameShape = In & { [Key in Exclude]: never };
/**
* This function invokes the "esbuild" command-line tool for you. It returns a
* promise that either resolves with a "BuildResult" object or rejects with a
* "BuildFailure" object.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#build
*/
declare function build(options: SameShape): Promise>;
/**
* This is the advanced long-running form of "build" that supports additional
* features such as watch mode and a local development server.
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#build
*/
declare function context(options: SameShape): Promise>;
/**
* This function transforms a single JavaScript file. It can be used to minify
* JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
* to older JavaScript. It returns a promise that is either resolved with a
* "TransformResult" object or rejected with a "TransformFailure" object.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#transform
*/
declare function transform(input: string | Uint8Array, options?: SameShape): Promise>;
/**
* Converts log messages to formatted message strings suitable for printing in
* the terminal. This allows you to reuse the built-in behavior of esbuild's
* log message formatter. This is a batch-oriented API for efficiency.
*
* - Works in node: yes
* - Works in browser: yes
*/
declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise;
/**
* Pretty-prints an analysis of the metafile JSON to a string. This is just for
* convenience to be able to match esbuild's pretty-printing exactly. If you want
* to customize it, you can just inspect the data in the metafile yourself.
*
* - Works in node: yes
* - Works in browser: yes
*
* Documentation: https://esbuild.github.io/api/#analyze
*/
declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise;
/**
* A synchronous version of "build".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#build
*/
declare function buildSync(options: SameShape): BuildResult;
/**
* A synchronous version of "transform".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#transform
*/
declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult$2;
/**
* A synchronous version of "formatMessages".
*
* - Works in node: yes
* - Works in browser: no
*/
declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
/**
* A synchronous version of "analyzeMetafile".
*
* - Works in node: yes
* - Works in browser: no
*
* Documentation: https://esbuild.github.io/api/#analyze
*/
declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
/**
* This configures the browser-based version of esbuild. It is necessary to
* call this first and wait for the returned promise to be resolved before
* making other API calls when using esbuild in the browser.
*
* - Works in node: yes
* - Works in browser: yes ("options" is required)
*
* Documentation: https://esbuild.github.io/api/#browser
*/
declare function initialize(options: InitializeOptions): Promise;
interface InitializeOptions {
/**
* The URL of the "esbuild.wasm" file. This must be provided when running
* esbuild in the browser.
*/
wasmURL?: string | URL;
/**
* The result of calling "new WebAssembly.Module(buffer)" where "buffer"
* is a typed array or ArrayBuffer containing the binary code of the
* "esbuild.wasm" file.
*
* You can use this as an alternative to "wasmURL" for environments where it's
* not possible to download the WebAssembly module.
*/
wasmModule?: WebAssembly.Module;
/**
* By default esbuild runs the WebAssembly-based browser API in a web worker
* to avoid blocking the UI thread. This can be disabled by setting "worker"
* to false.
*/
worker?: boolean;
}
declare let version: string;
// Note: These declarations exist to avoid type errors when you omit "dom" from
// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
// with the browser DOM and is present in many non-browser JavaScript runtimes
// (e.g. node and deno). Declaring it here allows esbuild's API to be used in
// these scenarios.
//
// There's an open issue about getting this problem corrected (although these
// declarations will need to remain even if this is fixed for backward
// compatibility with older TypeScript versions):
//
// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
//
declare global {
namespace WebAssembly {
interface Module {}
}
interface URL {}
}
//#endregion
//#region node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
// This definition file follows a somewhat unusual format. ESTree allows
// runtime type checks based on the `type` parameter. In order to explain this
// to typescript we want to use discriminated union types:
// https://github.com/Microsoft/TypeScript/pull/9163
//
// For ESTree this is a bit tricky because the high level interfaces like
// Node or Function are pulling double duty. We want to pass common fields down
// to the interfaces that extend them (like Identifier or
// ArrowFunctionExpression), but you can't extend a type union or enforce
// common fields on them. So we've split the high level interfaces into two
// types, a base type which passes down inherited fields, and a type union of
// all types which extend the base type. Only the type union is exported, and
// the union is how other types refer to the collection of inheriting types.
//
// This makes the definitions file here somewhat more difficult to maintain,
// but it has the notable advantage of making ESTree much easier to use as
// an end user.
interface BaseNodeWithoutComments {
// Every leaf interface that extends BaseNode must specify a type property.
// The type property should be a string literal. For example, Identifier
// has: `type: "Identifier"`
type: string;
loc?: SourceLocation | null | undefined;
range?: [number, number] | undefined;
}
interface BaseNode extends BaseNodeWithoutComments {
leadingComments?: Comment[] | undefined;
trailingComments?: Comment[] | undefined;
}
interface NodeMap {
AssignmentProperty: AssignmentProperty;
CatchClause: CatchClause;
Class: Class;
ClassBody: ClassBody;
Expression: Expression;
Function: Function$1;
Identifier: Identifier;
Literal: Literal;
MethodDefinition: MethodDefinition;
ModuleDeclaration: ModuleDeclaration;
ModuleSpecifier: ModuleSpecifier;
Pattern: Pattern;
PrivateIdentifier: PrivateIdentifier;
Program: Program;
Property: Property;
PropertyDefinition: PropertyDefinition;
SpreadElement: SpreadElement;
Statement: Statement;
Super: Super;
SwitchCase: SwitchCase;
TemplateElement: TemplateElement;
VariableDeclarator: VariableDeclarator;
}
type Node = NodeMap[keyof NodeMap];
interface Comment extends BaseNodeWithoutComments {
type: "Line" | "Block";
value: string;
}
interface SourceLocation {
source?: string | null | undefined;
start: Position;
end: Position;
}
interface Position {
/** >= 1 */
line: number;
/** >= 0 */
column: number;
}
interface Program extends BaseNode {
type: "Program";
sourceType: "script" | "module";
body: Array;
comments?: Comment[] | undefined;
}
interface Directive extends BaseNode {
type: "ExpressionStatement";
expression: Literal;
directive: string;
}
interface BaseFunction extends BaseNode {
params: Pattern[];
generator?: boolean | undefined;
async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
// can have a body that's either. FunctionDeclarations and
// FunctionExpressions have only BlockStatement bodies.
body: BlockStatement | Expression;
}
type Function$1 = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
interface BaseStatement extends BaseNode {}
interface EmptyStatement extends BaseStatement {
type: "EmptyStatement";
}
interface BlockStatement extends BaseStatement {
type: "BlockStatement";
body: Statement[];
innerComments?: Comment[] | undefined;
}
interface StaticBlock extends Omit {
type: "StaticBlock";
}
interface ExpressionStatement extends BaseStatement {
type: "ExpressionStatement";
expression: Expression;
}
interface IfStatement extends BaseStatement {
type: "IfStatement";
test: Expression;
consequent: Statement;
alternate?: Statement | null | undefined;
}
interface LabeledStatement extends BaseStatement {
type: "LabeledStatement";
label: Identifier;
body: Statement;
}
interface BreakStatement extends BaseStatement {
type: "BreakStatement";
label?: Identifier | null | undefined;
}
interface ContinueStatement extends BaseStatement {
type: "ContinueStatement";
label?: Identifier | null | undefined;
}
interface WithStatement extends BaseStatement {
type: "WithStatement";
object: Expression;
body: Statement;
}
interface SwitchStatement extends BaseStatement {
type: "SwitchStatement";
discriminant: Expression;
cases: SwitchCase[];
}
interface ReturnStatement extends BaseStatement {
type: "ReturnStatement";
argument?: Expression | null | undefined;
}
interface ThrowStatement extends BaseStatement {
type: "ThrowStatement";
argument: Expression;
}
interface TryStatement extends BaseStatement {
type: "TryStatement";
block: BlockStatement;
handler?: CatchClause | null | undefined;
finalizer?: BlockStatement | null | undefined;
}
interface WhileStatement extends BaseStatement {
type: "WhileStatement";
test: Expression;
body: Statement;
}
interface DoWhileStatement extends BaseStatement {
type: "DoWhileStatement";
body: Statement;
test: Expression;
}
interface ForStatement extends BaseStatement {
type: "ForStatement";
init?: VariableDeclaration | Expression | null | undefined;
test?: Expression | null | undefined;
update?: Expression | null | undefined;
body: Statement;
}
interface BaseForXStatement extends BaseStatement {
left: VariableDeclaration | Pattern;
right: Expression;
body: Statement;
}
interface ForInStatement extends BaseForXStatement {
type: "ForInStatement";
}
interface DebuggerStatement extends BaseStatement {
type: "DebuggerStatement";
}
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
interface BaseDeclaration extends BaseStatement {}
interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
type: "FunctionDeclaration";
/** It is null when a function declaration is a part of the `export default function` statement */
id: Identifier | null;
body: BlockStatement;
}
interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
id: Identifier;
}
interface VariableDeclaration extends BaseDeclaration {
type: "VariableDeclaration";
declarations: VariableDeclarator[];
kind: "var" | "let" | "const" | "using" | "await using";
}
interface VariableDeclarator extends BaseNode {
type: "VariableDeclarator";
id: Pattern;
init?: Expression | null | undefined;
}
interface ExpressionMap {
ArrayExpression: ArrayExpression;
ArrowFunctionExpression: ArrowFunctionExpression;
AssignmentExpression: AssignmentExpression;
AwaitExpression: AwaitExpression;
BinaryExpression: BinaryExpression;
CallExpression: CallExpression;
ChainExpression: ChainExpression;
ClassExpression: ClassExpression;
ConditionalExpression: ConditionalExpression;
FunctionExpression: FunctionExpression;
Identifier: Identifier;
ImportExpression: ImportExpression;
Literal: Literal;
LogicalExpression: LogicalExpression;
MemberExpression: MemberExpression;
MetaProperty: MetaProperty;
NewExpression: NewExpression;
ObjectExpression: ObjectExpression;
SequenceExpression: SequenceExpression;
TaggedTemplateExpression: TaggedTemplateExpression;
TemplateLiteral: TemplateLiteral;
ThisExpression: ThisExpression;
UnaryExpression: UnaryExpression;
UpdateExpression: UpdateExpression;
YieldExpression: YieldExpression;
}
type Expression = ExpressionMap[keyof ExpressionMap];
interface BaseExpression extends BaseNode {}
type ChainElement = SimpleCallExpression | MemberExpression;
interface ChainExpression extends BaseExpression {
type: "ChainExpression";
expression: ChainElement;
}
interface ThisExpression extends BaseExpression {
type: "ThisExpression";
}
interface ArrayExpression extends BaseExpression {
type: "ArrayExpression";
elements: Array;
}
interface ObjectExpression extends BaseExpression {
type: "ObjectExpression";
properties: Array;
}
interface PrivateIdentifier extends BaseNode {
type: "PrivateIdentifier";
name: string;
}
interface Property extends BaseNode {
type: "Property";
key: Expression;
value: Expression | Pattern; // Could be an AssignmentProperty
kind: "init" | "get" | "set";
method: boolean;
shorthand: boolean;
computed: boolean;
}
interface PropertyDefinition extends BaseNode {
type: "PropertyDefinition";
key: Expression | PrivateIdentifier;
value?: Expression | null | undefined;
computed: boolean;
static: boolean;
}
interface FunctionExpression extends BaseFunction, BaseExpression {
id?: Identifier | null | undefined;
type: "FunctionExpression";
body: BlockStatement;
}
interface SequenceExpression extends BaseExpression {
type: "SequenceExpression";
expressions: Expression[];
}
interface UnaryExpression extends BaseExpression {
type: "UnaryExpression";
operator: UnaryOperator;
prefix: true;
argument: Expression;
}
interface BinaryExpression extends BaseExpression {
type: "BinaryExpression";
operator: BinaryOperator;
left: Expression | PrivateIdentifier;
right: Expression;
}
interface AssignmentExpression extends BaseExpression {
type: "AssignmentExpression";
operator: AssignmentOperator;
left: Pattern | MemberExpression;
right: Expression;
}
interface UpdateExpression extends BaseExpression {
type: "UpdateExpression";
operator: UpdateOperator;
argument: Expression;
prefix: boolean;
}
interface LogicalExpression extends BaseExpression {
type: "LogicalExpression";
operator: LogicalOperator;
left: Expression;
right: Expression;
}
interface ConditionalExpression extends BaseExpression {
type: "ConditionalExpression";
test: Expression;
alternate: Expression;
consequent: Expression;
}
interface BaseCallExpression extends BaseExpression {
callee: Expression | Super;
arguments: Array;
}
type CallExpression = SimpleCallExpression | NewExpression;
interface SimpleCallExpression extends BaseCallExpression {
type: "CallExpression";
optional: boolean;
}
interface NewExpression extends BaseCallExpression {
type: "NewExpression";
}
interface MemberExpression extends BaseExpression, BasePattern {
type: "MemberExpression";
object: Expression | Super;
property: Expression | PrivateIdentifier;
computed: boolean;
optional: boolean;
}
type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
interface BasePattern extends BaseNode {}
interface SwitchCase extends BaseNode {
type: "SwitchCase";
test?: Expression | null | undefined;
consequent: Statement[];
}
interface CatchClause extends BaseNode {
type: "CatchClause";
param: Pattern | null;
body: BlockStatement;
}
interface Identifier extends BaseNode, BaseExpression, BasePattern {
type: "Identifier";
name: string;
}
type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
interface SimpleLiteral extends BaseNode, BaseExpression {
type: "Literal";
value: string | boolean | number | null;
raw?: string | undefined;
}
interface RegExpLiteral extends BaseNode, BaseExpression {
type: "Literal";
value?: RegExp | null | undefined;
regex: {
pattern: string;
flags: string;
};
raw?: string | undefined;
}
interface BigIntLiteral extends BaseNode, BaseExpression {
type: "Literal";
value?: bigint | null | undefined;
bigint: string;
raw?: string | undefined;
}
type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
type LogicalOperator = "||" | "&&" | "??";
type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
type UpdateOperator = "++" | "--";
interface ForOfStatement extends BaseForXStatement {
type: "ForOfStatement";
await: boolean;
}
interface Super extends BaseNode {
type: "Super";
}
interface SpreadElement extends BaseNode {
type: "SpreadElement";
argument: Expression;
}
interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
type: "ArrowFunctionExpression";
expression: boolean;
body: BlockStatement | Expression;
}
interface YieldExpression extends BaseExpression {
type: "YieldExpression";
argument?: Expression | null | undefined;
delegate: boolean;
}
interface TemplateLiteral extends BaseExpression {
type: "TemplateLiteral";
quasis: TemplateElement[];
expressions: Expression[];
}
interface TaggedTemplateExpression extends BaseExpression {
type: "TaggedTemplateExpression";
tag: Expression;
quasi: TemplateLiteral;
}
interface TemplateElement extends BaseNode {
type: "TemplateElement";
tail: boolean;
value: {
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
raw: string;
};
}
interface AssignmentProperty extends Property {
value: Pattern;
kind: "init";
method: boolean; // false
}
interface ObjectPattern extends BasePattern {
type: "ObjectPattern";
properties: Array;
}
interface ArrayPattern extends BasePattern {
type: "ArrayPattern";
elements: Array;
}
interface RestElement extends BasePattern {
type: "RestElement";
argument: Pattern;
}
interface AssignmentPattern extends BasePattern {
type: "AssignmentPattern";
left: Pattern;
right: Expression;
}
type Class = ClassDeclaration | ClassExpression;
interface BaseClass extends BaseNode {
superClass?: Expression | null | undefined;
body: ClassBody;
}
interface ClassBody extends BaseNode {
type: "ClassBody";
body: Array;
}
interface MethodDefinition extends BaseNode {
type: "MethodDefinition";
key: Expression | PrivateIdentifier;
value: FunctionExpression;
kind: "constructor" | "method" | "get" | "set";
computed: boolean;
static: boolean;
}
interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
type: "ClassDeclaration";
/** It is null when a class declaration is a part of the `export default class` statement */
id: Identifier | null;
}
interface ClassDeclaration extends MaybeNamedClassDeclaration {
id: Identifier;
}
interface ClassExpression extends BaseClass, BaseExpression {
type: "ClassExpression";
id?: Identifier | null | undefined;
}
interface MetaProperty extends BaseExpression {
type: "MetaProperty";
meta: Identifier;
property: Identifier;
}
type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
interface BaseModuleDeclaration extends BaseNode {}
type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
interface BaseModuleSpecifier extends BaseNode {
local: Identifier;
}
interface ImportDeclaration extends BaseModuleDeclaration {
type: "ImportDeclaration";
specifiers: Array;
attributes: ImportAttribute[];
source: Literal;
}
interface ImportSpecifier extends BaseModuleSpecifier {
type: "ImportSpecifier";
imported: Identifier | Literal;
}
interface ImportAttribute extends BaseNode {
type: "ImportAttribute";
key: Identifier | Literal;
value: Literal;
}
interface ImportExpression extends BaseExpression {
type: "ImportExpression";
source: Expression;
options?: Expression | null | undefined;
}
interface ImportDefaultSpecifier extends BaseModuleSpecifier {
type: "ImportDefaultSpecifier";
}
interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
type: "ImportNamespaceSpecifier";
}
interface ExportNamedDeclaration extends BaseModuleDeclaration {
type: "ExportNamedDeclaration";
declaration?: Declaration | null | undefined;
specifiers: ExportSpecifier[];
attributes: ImportAttribute[];
source?: Literal | null | undefined;
}
interface ExportSpecifier extends Omit {
type: "ExportSpecifier";
local: Identifier | Literal;
exported: Identifier | Literal;
}
interface ExportDefaultDeclaration extends BaseModuleDeclaration {
type: "ExportDefaultDeclaration";
declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
}
interface ExportAllDeclaration extends BaseModuleDeclaration {
type: "ExportAllDeclaration";
exported: Identifier | Literal | null;
attributes: ImportAttribute[];
source: Literal;
}
interface AwaitExpression extends BaseExpression {
type: "AwaitExpression";
argument: Expression;
}
//#endregion
//#region node_modules/.pnpm/rollup@4.61.1/node_modules/rollup/dist/rollup.d.ts
declare module 'estree' {
export interface Decorator extends BaseNode {
type: 'Decorator';
expression: Expression;
}
interface PropertyDefinition {
decorators: undefined[];
}
interface MethodDefinition {
decorators: undefined[];
}
interface BaseClass {
decorators: undefined[];
}
}
// utils
type NullValue = null | undefined | void;
type MaybeArray = T | T[];
type MaybePromise = T | Promise;
type PartialNull = { [P in keyof T]: T[P] | null };
interface RollupError extends RollupLog {
name?: string | undefined;
stack?: string | undefined;
watchFiles?: string[] | undefined;
}
interface RollupLog {
binding?: string | undefined;
cause?: unknown | undefined;
code?: string | undefined;
exporter?: string | undefined;
frame?: string | undefined;
hook?: string | undefined;
id?: string | undefined;
ids?: string[] | undefined;
loc?: {
column: number;
file?: string | undefined;
line: number;
};
message: string;
meta?: any | undefined;
names?: string[] | undefined;
plugin?: string | undefined;
pluginCode?: unknown | undefined;
pos?: number | undefined;
reexporter?: string | undefined;
stack?: string | undefined;
url?: string | undefined;
}
type LogLevel$1 = 'warn' | 'info' | 'debug';
type LogLevelOption = LogLevel$1 | 'silent';
type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number];
interface ExistingDecodedSourceMap {
file?: string | undefined;
readonly mappings: SourceMapSegment[][];
names: string[];
sourceRoot?: string | undefined;
sources: string[];
sourcesContent?: string[] | undefined;
version: number;
x_google_ignoreList?: number[] | undefined;
}
interface ExistingRawSourceMap {
file?: string | undefined;
mappings: string;
names: string[];
sourceRoot?: string | undefined;
sources: string[];
sourcesContent?: string[] | undefined;
version: number;
x_google_ignoreList?: number[] | undefined;
}
type DecodedSourceMapOrMissing = {
missing: true;
plugin: string;
} | (ExistingDecodedSourceMap & {
missing?: false | undefined;
});
interface SourceMap {
file: string;
mappings: string;
names: string[];
sources: string[];
sourcesContent?: string[] | undefined;
version: number;
debugId?: string | undefined;
toString(): string;
toUrl(): string;
}
type SourceMapInput = ExistingRawSourceMap | string | null | {
mappings: '';
};
interface ModuleOptions {
attributes: Record;
meta: CustomPluginOptions;
moduleSideEffects: boolean | 'no-treeshake';
syntheticNamedExports: boolean | string;
}
interface SourceDescription extends Partial> {
ast?: ProgramNode | undefined;
code: string;
map?: SourceMapInput | undefined;
}
interface TransformModuleJSON {
ast?: ProgramNode | undefined;
code: string;
safeVariableNames: Record | null; // note if plugins use new this.cache to opt-out auto transform cache
customTransformCache: boolean;
originalCode: string;
originalSourcemap: ExistingDecodedSourceMap | null;
sourcemapChain: DecodedSourceMapOrMissing[];
transformDependencies: string[];
}
interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
safeVariableNames: Record | null;
ast: ProgramNode;
dependencies: string[];
id: string;
resolvedIds: ResolvedIdMap;
transformFiles: EmittedFile[] | undefined;
}
interface PluginCache {
delete(id: string): boolean;
get(id: string): T;
has(id: string): boolean;
set(id: string, value: T): void;
}
type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
interface MinimalPluginContext {
debug: LoggingFunction;
error: (error: RollupError | string) => never;
info: LoggingFunction;
meta: PluginContextMeta;
warn: LoggingFunction;
}
interface EmittedAsset {
fileName?: string | undefined;
name?: string | undefined;
needsCodeReference?: boolean | undefined;
originalFileName?: string | null | undefined;
source?: string | Uint8Array | undefined;
type: 'asset';
}
interface EmittedChunk {
fileName?: string | undefined;
id: string;
implicitlyLoadedAfterOneOf?: string[] | undefined;
importer?: string | undefined;
name?: string | undefined;
preserveSignature?: PreserveEntrySignaturesOption | undefined;
type: 'chunk';
}
interface EmittedPrebuiltChunk {
code: string;
exports?: string[] | undefined;
fileName: string;
map?: SourceMap | undefined;
sourcemapFileName?: string | undefined;
type: 'prebuilt-chunk';
}
type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
type EmitFile = (emittedFile: EmittedFile) => string;
interface ModuleInfo extends ModuleOptions {
ast: ProgramNode | null;
code: string | null;
dynamicImporters: readonly string[];
dynamicallyImportedIdResolutions: readonly ResolvedId[];
dynamicallyImportedIds: readonly string[];
exportedBindings: Record | null;
exports: string[] | null;
safeVariableNames: Record | null;
hasDefaultExport: boolean | null;
id: string;
implicitlyLoadedAfterOneOf: readonly string[];
implicitlyLoadedBefore: readonly string[];
importedIdResolutions: readonly ResolvedId[];
importedIds: readonly string[];
importers: readonly string[];
isEntry: boolean;
isExternal: boolean;
isIncluded: boolean | null;
}
type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style -- this is an interface so that it can be extended by plugins
interface CustomPluginOptions {
[plugin: string]: any;
}
type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
column: number;
line: number;
}) => void;
type ParseAst = (input: string, options?: {
allowReturnOutsideFunction?: boolean;
jsx?: boolean;
}) => ProgramNode;
// declare AbortSignal here for environments without DOM lib or @types/node
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface AbortSignal {}
}
interface PluginContext extends MinimalPluginContext {
addWatchFile: (id: string) => void;
cache: PluginCache;
debug: LoggingFunction;
emitFile: EmitFile;
error: (error: RollupError | string) => never;
fs: RollupFsModule;
getFileName: (fileReferenceId: string) => string;
getModuleIds: () => IterableIterator;
getModuleInfo: GetModuleInfo;
getWatchFiles: () => string[];
info: LoggingFunction;
load: (options: {
id: string;
resolveDependencies?: boolean;
} & Partial>) => Promise;
parse: ParseAst;
resolve: (source: string, importer?: string, options?: {
importerAttributes?: Record;
attributes?: Record;
custom?: CustomPluginOptions;
isEntry?: boolean;
skipSelf?: boolean;
}) => Promise;
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
warn: LoggingFunction;
}
interface PluginContextMeta {
rollupVersion: string;
watchMode: boolean;
}
type StringOrRegExp = string | RegExp;
type StringFilter$1 = MaybeArray | {
include?: MaybeArray | undefined;
exclude?: MaybeArray | undefined;
};
interface HookFilter {
id?: StringFilter$1 | undefined;
code?: StringFilter$1 | undefined;
}
interface ResolvedId extends ModuleOptions {
external: boolean | 'absolute';
id: string;
resolvedBy: string;
}
type ResolvedIdMap = Record;
interface PartialResolvedId extends Partial> {
external?: boolean | 'absolute' | 'relative' | undefined;
id: string;
resolvedBy?: string | undefined;
}
type ResolveIdResult = string | NullValue | false | PartialResolvedId;
type ResolveIdHook = (this: PluginContext, source: string, importer: string | undefined, options: {
attributes: Record;
custom?: CustomPluginOptions;
importerAttributes?: Record | undefined;
isEntry: boolean;
}) => ResolveIdResult;
type ShouldTransformCachedModuleHook = (this: PluginContext, options: {
ast: ProgramNode;
attributes: Record;
code: string;
id: string;
meta: CustomPluginOptions;
moduleSideEffects: boolean | 'no-treeshake';
resolvedSources: ResolvedIdMap;
syntheticNamedExports: boolean | string;
}) => boolean | NullValue;
type IsExternal = (source: string, importer: string | undefined, isResolved: boolean) => boolean;
type HasModuleSideEffects = (id: string, external: boolean) => boolean;
type LoadResult = SourceDescription | string | NullValue;
type LoadHook = (this: PluginContext, id: string, // temporarily marked as optional for better Vite type-compatibility
options?: {
// unused, temporarily added for better Vite type-compatibility
ssr?: boolean | undefined; // temporarily marked as optional for better Vite type-compatibility
attributes?: Record;
} | undefined) => LoadResult;
interface TransformPluginContext extends PluginContext {
debug: LoggingFunctionWithPosition;
error: (error: RollupError | string, pos?: number | {
column: number;
line: number;
}) => never;
getCombinedSourcemap: () => SourceMap;
info: LoggingFunctionWithPosition;
warn: LoggingFunctionWithPosition;
}
type TransformResult$1 = string | NullValue | Partial;
type TransformHook = (this: TransformPluginContext, code: string, id: string, // temporarily marked as optional for better Vite type-compatibility
options?: {
// unused, temporarily added for better Vite type-compatibility
ssr?: boolean | undefined; // temporarily marked as optional for better Vite type-compatibility
attributes?: Record;
} | undefined) => TransformResult$1;
type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
type RenderChunkHook = (this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: {
chunks: Record;
}) => {
code: string;
map?: SourceMapInput;
} | string | NullValue;
type ResolveDynamicImportHook = (this: PluginContext, specifier: string | AstNode, importer: string, options: {
attributes: Record;
importerAttributes: Record;
}) => ResolveIdResult;
type ResolveImportMetaHook = (this: PluginContext, property: string | null, options: {
attributes: Record;
chunkId: string;
format: InternalModuleFormat;
moduleId: string;
}) => string | NullValue;
type ResolveFileUrlHook = (this: PluginContext, options: {
attributes: Record;
chunkId: string;
fileName: string;
format: InternalModuleFormat;
moduleId: string;
referenceId: string;
relativePath: string;
}) => string | NullValue;
type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise;
type AddonHook = string | AddonHookFunction;
type ChangeEvent = 'create' | 'update' | 'delete';
type WatchChangeHook = (this: PluginContext, id: string, change: {
event: ChangeEvent;
}) => void;
type OutputBundle = Record;
type PreRenderedChunkWithFileName = PreRenderedChunk & {
fileName: string;
};
interface ImportedInternalChunk {
type: 'internal';
fileName: string;
resolvedImportPath: string;
chunk: PreRenderedChunk;
}
interface ImportedExternalChunk {
type: 'external';
fileName: string;
resolvedImportPath: string;
}
type DynamicImportTargetChunk = ImportedInternalChunk | ImportedExternalChunk;
interface FunctionPluginHooks {
augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
buildEnd: (this: PluginContext, error?: Error) => void;
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
closeBundle: (this: PluginContext, error?: Error) => void;
closeWatcher: (this: PluginContext) => void;
generateBundle: (this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
load: LoadHook;
moduleParsed: ModuleParsedHook;
onLog: (this: MinimalPluginContext, level: LogLevel$1, log: RollupLog) => boolean | NullValue;
options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
renderChunk: RenderChunkHook;
renderDynamicImport: (this: PluginContext, options: {
customResolution: string | null;
format: InternalModuleFormat;
moduleId: string;
targetModuleId: string | null;
chunk: PreRenderedChunkWithFileName;
targetChunk: PreRenderedChunkWithFileName | null;
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
targetModuleAttributes: Record;
}) => {
left: string;
right: string;
} | NullValue;
renderError: (this: PluginContext, error?: Error) => void;
renderStart: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
resolveDynamicImport: ResolveDynamicImportHook;
resolveFileUrl: ResolveFileUrlHook;
resolveId: ResolveIdHook;
resolveImportMeta: ResolveImportMetaHook;
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
transform: TransformHook;
watchChange: WatchChangeHook;
writeBundle: (this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle) => void;
}
type OutputPluginHooks = 'augmentChunkHash' | 'generateBundle' | 'outputOptions' | 'renderChunk' | 'renderDynamicImport' | 'renderError' | 'renderStart' | 'resolveFileUrl' | 'resolveImportMeta' | 'writeBundle';
type SyncPluginHooks = 'augmentChunkHash' | 'onLog' | 'outputOptions' | 'renderDynamicImport' | 'resolveFileUrl' | 'resolveImportMeta';
type AsyncPluginHooks = Exclude;
type FirstPluginHooks = 'load' | 'renderDynamicImport' | 'resolveDynamicImport' | 'resolveFileUrl' | 'resolveId' | 'resolveImportMeta' | 'shouldTransformCachedModule';
type SequentialPluginHooks = 'augmentChunkHash' | 'generateBundle' | 'onLog' | 'options' | 'outputOptions' | 'renderChunk' | 'transform';
type ParallelPluginHooks = Exclude;
type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
type MakeAsync = Function_ extends ((this: infer This, ...parameters: infer Arguments) => infer Return) ? (this: This, ...parameters: Arguments) => Return | Promise : never; // eslint-disable-next-line @typescript-eslint/no-empty-object-type
type ObjectHook = T | ({
handler: T;
order?: 'pre' | 'post' | null;
} & O);
type HookFilterExtension = K extends 'transform' ? {
filter?: HookFilter | undefined;
} : K extends 'load' ? {
filter?: Pick | undefined;
} : K extends 'resolveId' ? {
filter?: {
id?: StringFilter$1 | undefined;
};
} | undefined : // eslint-disable-next-line @typescript-eslint/no-empty-object-type
{};
type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook : FunctionPluginHooks[K], // eslint-disable-next-line @typescript-eslint/no-empty-object-type
HookFilterExtension & (K extends ParallelPluginHooks ? {
sequential?: boolean;
} : {})> };
interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial>> {
cacheKey?: string | undefined;
name: string;
version?: string | undefined;
}
interface Plugin$1 extends OutputPlugin, Partial {
// for inter-plugin communication
api?: A | undefined;
}
type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
type NormalizedJsxOptions = NormalizedJsxPreserveOptions | NormalizedJsxClassicOptions | NormalizedJsxAutomaticOptions;
interface NormalizedJsxPreserveOptions {
factory: string | null;
fragment: string | null;
importSource: string | null;
mode: 'preserve';
}
interface NormalizedJsxClassicOptions {
factory: string;
fragment: string;
importSource: string | null;
mode: 'classic';
}
interface NormalizedJsxAutomaticOptions {
factory: string;
importSource: string | null;
jsxImportSource: string;
mode: 'automatic';
}
type JsxOptions = Partial & {
preset?: JsxPreset | undefined;
};
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
interface NormalizedTreeshakingOptions {
annotations: boolean;
correctVarValueBeforeDeclaration: boolean;
manualPureFunctions: readonly string[];
moduleSideEffects: HasModuleSideEffects;
propertyReadSideEffects: boolean | 'always';
tryCatchDeoptimization: boolean;
unknownGlobalSideEffects: boolean;
}
interface TreeshakingOptions extends Partial> {
moduleSideEffects?: ModuleSideEffectsOption | undefined;
preset?: TreeshakingPreset | undefined;
}
interface ManualChunkMeta {
getModuleIds: () => IterableIterator;
getModuleInfo: GetModuleInfo;
}
type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
type ExternalOption = (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
type GlobalsOption = Record | ((name: string) => string);
type InputOption = string | string[] | Record;
type ManualChunksOption = Record | GetManualChunk;
type LogHandlerWithDefault = (level: LogLevel$1, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
type LogOrStringHandler = (level: LogLevel$1 | 'error', log: RollupLog | string) => void;
type LogHandler = (level: LogLevel$1, log: RollupLog) => void;
type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
type InputPluginOption = MaybePromise;
interface InputOptions {
cache?: boolean | RollupCache | undefined;
context?: string | undefined;
experimentalCacheExpiry?: number | undefined;
experimentalLogSideEffects?: boolean | undefined;
external?: ExternalOption | undefined;
fs?: RollupFsModule | undefined;
input?: InputOption | undefined;
jsx?: false | JsxPreset | JsxOptions | undefined;
logLevel?: LogLevelOption | undefined;
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource' | undefined;
maxParallelFileOps?: number | undefined;
moduleContext?: ((id: string) => string | NullValue) | Record | undefined;
onLog?: LogHandlerWithDefault | undefined;
onwarn?: WarningHandlerWithDefault | undefined;
perf?: boolean | undefined;
plugins?: InputPluginOption | undefined;
preserveEntrySignatures?: PreserveEntrySignaturesOption | undefined;
preserveSymlinks?: boolean | undefined;
shimMissingExports?: boolean | undefined;
strictDeprecations?: boolean | undefined;
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions | undefined;
watch?: WatcherOptions | false | undefined;
}
interface NormalizedInputOptions {
cache: false | undefined | RollupCache;
context: string;
experimentalCacheExpiry: number;
experimentalLogSideEffects: boolean;
external: IsExternal;
fs: RollupFsModule;
input: string[] | Record;
jsx: false | NormalizedJsxOptions;
logLevel: LogLevelOption;
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
maxParallelFileOps: number;
moduleContext: (id: string) => string;
onLog: LogHandler;
perf: boolean;
plugins: Plugin$1[];
preserveEntrySignatures: PreserveEntrySignaturesOption;
preserveSymlinks: boolean;
shimMissingExports: boolean;
strictDeprecations: boolean;
treeshake: false | NormalizedTreeshakingOptions;
}
type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
type ImportAttributesKey = 'with' | 'assert';
type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
type GeneratedCodePreset = 'es5' | 'es2015';
interface NormalizedGeneratedCodeOptions {
arrowFunctions: boolean;
constBindings: boolean;
objectShorthand: boolean;
reservedNamesAsProps: boolean;
symbols: boolean;
}
interface GeneratedCodeOptions extends Partial {
preset?: GeneratedCodePreset | undefined;
}
type OptionsPaths = Record | ((id: string) => string);
type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
type GetInterop = (id: string | null) => InteropType;
type AmdOptions = ({
autoId?: false | undefined;
id: string;
} | {
autoId: true;
basePath?: string | undefined;
id?: undefined | undefined;
} | {
autoId?: false | undefined;
id?: undefined | undefined;
}) & {
define?: string | undefined;
forceJsExtensionForImports?: boolean | undefined;
};
type NormalizedAmdOptions = ({
autoId: false;
id?: string | undefined;
} | {
autoId: true;
basePath: string;
}) & {
define: string;
forceJsExtensionForImports: boolean;
};
type AddonFunction = (chunk: RenderedChunk) => string | Promise;
type OutputPluginOption = MaybePromise;
type HashCharacters = 'base64' | 'base36' | 'hex';
interface OutputOptions {
amd?: AmdOptions | undefined;
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string) | undefined;
banner?: string | AddonFunction | undefined;
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
compact?: boolean | undefined; // only required for bundle.write
dir?: string | undefined;
dynamicImportInCjs?: boolean | undefined;
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
esModule?: boolean | 'if-default-prop' | undefined;
experimentalMinChunkSize?: number | undefined;
exports?: 'default' | 'named' | 'none' | 'auto' | undefined;
extend?: boolean | undefined;
/** @deprecated Use "externalImportAttributes" instead. */
externalImportAssertions?: boolean | undefined;
externalImportAttributes?: boolean | undefined;
externalLiveBindings?: boolean | undefined; // only required for bundle.write
file?: string | undefined;
footer?: string | AddonFunction | undefined;
format?: ModuleFormat | undefined;
freeze?: boolean | undefined;
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions | undefined;
globals?: GlobalsOption | undefined;
hashCharacters?: HashCharacters | undefined;
hoistTransitiveImports?: boolean | undefined;
importAttributesKey?: ImportAttributesKey | undefined;
indent?: string | boolean | undefined;
inlineDynamicImports?: boolean | undefined;
interop?: InteropType | GetInterop | undefined;
intro?: string | AddonFunction | undefined;
manualChunks?: ManualChunksOption | undefined;
minifyInternalExports?: boolean | undefined;
name?: string | undefined;
noConflict?: boolean | undefined;
/** @deprecated This will be the new default in Rollup 5. */
onlyExplicitManualChunks?: boolean | undefined;
outro?: string | AddonFunction | undefined;
paths?: OptionsPaths | undefined;
plugins?: OutputPluginOption | undefined;
preserveModules?: boolean | undefined;
preserveModulesRoot?: string | undefined;
reexportProtoFromExternal?: boolean | undefined;
sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
sourcemap?: boolean | 'inline' | 'hidden' | undefined;
sourcemapBaseUrl?: string | undefined;
sourcemapExcludeSources?: boolean | undefined;
sourcemapFile?: string | undefined;
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined;
sourcemapPathTransform?: SourcemapPathTransformOption | undefined;
sourcemapDebugIds?: boolean | undefined;
strict?: boolean | undefined;
systemNullSetters?: boolean | undefined;
validate?: boolean | undefined;
virtualDirname?: string | undefined;
}
interface NormalizedOutputOptions {
amd: NormalizedAmdOptions;
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
banner: AddonFunction;
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
compact: boolean;
dir: string | undefined;
dynamicImportInCjs: boolean;
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
esModule: boolean | 'if-default-prop';
experimentalMinChunkSize: number;
exports: 'default' | 'named' | 'none' | 'auto';
extend: boolean;
/** @deprecated Use "externalImportAttributes" instead. */
externalImportAssertions: boolean;
externalImportAttributes: boolean;
externalLiveBindings: boolean;
file: string | undefined;
footer: AddonFunction;
format: InternalModuleFormat;
freeze: boolean;
generatedCode: NormalizedGeneratedCodeOptions;
globals: GlobalsOption;
hashCharacters: HashCharacters;
hoistTransitiveImports: boolean;
importAttributesKey: ImportAttributesKey;
indent: true | string;
inlineDynamicImports: boolean;
interop: GetInterop;
intro: AddonFunction;
manualChunks: ManualChunksOption;
minifyInternalExports: boolean;
name: string | undefined;
noConflict: boolean;
onlyExplicitManualChunks: boolean;
outro: AddonFunction;
paths: OptionsPaths;
plugins: OutputPlugin[];
preserveModules: boolean;
preserveModulesRoot: string | undefined;
reexportProtoFromExternal: boolean;
sanitizeFileName: (fileName: string) => string;
sourcemap: boolean | 'inline' | 'hidden';
sourcemapBaseUrl: string | undefined;
sourcemapExcludeSources: boolean;
sourcemapFile: string | undefined;
sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
sourcemapIgnoreList: SourcemapIgnoreListOption;
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
sourcemapDebugIds: boolean;
strict: boolean;
systemNullSetters: boolean;
validate: boolean;
virtualDirname: string;
}
type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
type SerializedTimings = Record;
interface PreRenderedAsset {
/** @deprecated Use "names" instead. */
name: string | undefined;
names: string[];
/** @deprecated Use "originalFileNames" instead. */
originalFileName: string | null;
originalFileNames: string[];
source: string | Uint8Array;
type: 'asset';
}
interface OutputAsset extends PreRenderedAsset {
fileName: string;
needsCodeReference: boolean;
}
interface RenderedModule {
readonly code: string | null;
originalLength: number;
removedExports: string[];
renderedExports: string[];
renderedLength: number;
}
interface PreRenderedChunk {
exports: string[];
facadeModuleId: string | null;
isDynamicEntry: boolean;
isEntry: boolean;
isImplicitEntry: boolean;
moduleIds: string[];
name: string;
type: 'chunk';
}
interface RenderedChunk extends PreRenderedChunk {
dynamicImports: string[];
fileName: string;
implicitlyLoadedBefore: string[];
importedBindings: Record;
imports: string[];
modules: Record;
referencedFiles: string[];
}
interface OutputChunk extends RenderedChunk {
code: string;
map: SourceMap | null;
sourcemapFileName: string | null;
preliminaryFileName: string;
}
type SerializablePluginCache = Record;
interface RollupCache {
modules: ModuleJSON[];
plugins?: Record;
}
interface RollupOutput {
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
}
interface RollupBuild {
cache: RollupCache | undefined;
close: () => Promise;
closed: boolean;
[Symbol.asyncDispose](): Promise;
generate: (outputOptions: OutputOptions) => Promise;
getTimings?: (() => SerializedTimings) | undefined;
watchFiles: string[];
write: (options: OutputOptions) => Promise;
}
interface RollupOptions extends InputOptions {
// This is included for compatibility with config files but ignored by rollup.rollup
output?: OutputOptions | OutputOptions[] | undefined;
}
interface ChokidarOptions {
alwaysStat?: boolean | undefined;
atomic?: boolean | number | undefined;
awaitWriteFinish?: {
pollInterval?: number | undefined;
stabilityThreshold?: number | undefined;
} | boolean | undefined;
binaryInterval?: number | undefined;
cwd?: string | undefined;
depth?: number | undefined;
disableGlobbing?: boolean | undefined;
followSymlinks?: boolean | undefined;
ignoreInitial?: boolean | undefined;
ignorePermissionErrors?: boolean | undefined;
ignored?: any | undefined;
interval?: number | undefined;
persistent?: boolean | undefined;
useFsEvents?: boolean | undefined;
usePolling?: boolean | undefined;
}
interface WatcherOptions {
allowInputInsideOutputPath?: boolean | undefined;
buildDelay?: number | undefined;
chokidar?: ChokidarOptions | undefined;
clearScreen?: boolean | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
skipWrite?: boolean | undefined;
onInvalidate?: ((id: string) => void) | undefined;
}
type AwaitedEventListener any>, K extends keyof T> = (...parameters: Parameters) => void | Promise;
interface AwaitingEventEmitter any>> {
close(): Promise;
emit(event: K, ...parameters: Parameters): Promise;
/**
* Removes an event listener.
*/
off(event: K, listener: AwaitedEventListener): this;
/**
* Registers an event listener that will be awaited before Rollup continues.
* All listeners will be awaited in parallel while rejections are tracked via
* Promise.all.
*/
on(event: K, listener: AwaitedEventListener): this;
/**
* Registers an event listener that will be awaited before Rollup continues.
* All listeners will be awaited in parallel while rejections are tracked via
* Promise.all.
* Listeners are removed automatically when removeListenersForCurrentRun is
* called, which happens automatically after each run.
*/
onCurrentRun(event: K, listener: (...parameters: Parameters) => Promise>): this;
removeAllListeners(): this;
removeListenersForCurrentRun(): this;
}
type RollupWatcherEvent = {
code: 'START';
} | {
code: 'BUNDLE_START';
input?: InputOption | undefined;
output: readonly string[];
} | {
code: 'BUNDLE_END';
duration: number;
input?: InputOption | undefined;
output: readonly string[];
result: RollupBuild;
} | {
code: 'END';
} | {
code: 'ERROR';
error: RollupError;
result: RollupBuild | null;
};
type RollupWatcher = AwaitingEventEmitter<{
change: (id: string, change: {
event: ChangeEvent;
}) => void;
close: () => void;
event: (event: RollupWatcherEvent) => void;
restart: () => void;
}>;
interface AstNodeLocation {
end: number;
start: number;
}
type OmittedEstreeKeys = 'loc' | 'range' | 'leadingComments' | 'trailingComments' | 'innerComments' | 'comments';
type RollupAstNode = Omit & AstNodeLocation;
type ProgramNode = RollupAstNode;
type AstNode = RollupAstNode;
interface RollupFsModule {
appendFile(path: string, data: string | Uint8Array, options?: {
encoding?: BufferEncoding | null;
mode?: string | number;
flag?: string | number;
}): Promise;
copyFile(source: string, destination: string, mode?: string | number): Promise;
mkdir(path: string, options?: {
recursive?: boolean;
mode?: string | number;
}): Promise;
mkdtemp(prefix: string): Promise;
readdir(path: string, options?: {
withFileTypes?: false;
}): Promise;
readdir(path: string, options?: {
withFileTypes: true;
}): Promise;
readFile(path: string, options?: {
encoding?: null;
flag?: string | number;
signal?: AbortSignal;
}): Promise;
readFile(path: string, options?: {
encoding: BufferEncoding;
flag?: string | number;
signal?: AbortSignal;
}): Promise;
realpath(path: string): Promise;
rename(oldPath: string, newPath: string): Promise;
rmdir(path: string, options?: {
recursive?: boolean;
}): Promise;
stat(path: string): Promise;
lstat(path: string): Promise;
unlink(path: string): Promise;
writeFile(path: string, data: string | Uint8Array, options?: {
encoding?: BufferEncoding | null;
mode?: string | number;
flag?: string | number;
}): Promise;
}
type BufferEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
interface RollupDirectoryEntry {
isFile(): boolean;
isDirectory(): boolean;
isSymbolicLink(): boolean;
name: string;
}
interface RollupFileStats {
isFile(): boolean;
isDirectory(): boolean;
isSymbolicLink(): boolean;
size: number;
mtime: Date;
ctime: Date;
atime: Date;
birthtime: Date;
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/hmrPayload.d.ts
type HotPayload = ConnectedPayload | PingPayload | UpdatePayload | FullReloadPayload | CustomPayload | ErrorPayload | PrunePayload;
interface ConnectedPayload {
type: 'connected';
}
interface PingPayload {
type: 'ping';
}
interface UpdatePayload {
type: 'update';
updates: Update[];
}
interface Update {
type: 'js-update' | 'css-update';
path: string;
acceptedPath: string;
timestamp: number;
/** @internal */
explicitImportRequired?: boolean;
/** @internal */
isWithinCircularImport?: boolean;
/** @internal */
firstInvalidatedBy?: string;
/** @internal */
invalidates?: string[];
}
interface PrunePayload {
type: 'prune';
paths: string[];
}
interface FullReloadPayload {
type: 'full-reload';
path?: string;
/** @internal */
triggeredBy?: string;
}
interface CustomPayload {
type: 'custom';
event: string;
data?: any;
}
interface ErrorPayload {
type: 'error';
err: {
[name: string]: any;
message: string;
stack: string;
id?: string;
frame?: string;
plugin?: string;
pluginCode?: string;
loc?: {
file?: string;
line: number;
column: number;
};
};
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts
//#region src/shared/invokeMethods.d.ts
interface FetchFunctionOptions {
cached?: boolean;
startOffset?: number;
}
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
interface CachedFetchResult {
/**
* If module cached in the runner, we can just confirm
* it wasn't invalidated on the server side.
*/
cache: true;
}
interface ExternalFetchResult {
/**
* The path to the externalized module starting with file://,
* by default this will be imported via a dynamic "import"
* instead of being transformed by vite and loaded with vite runner
*/
externalize: string;
/**
* Type of the module. Will be used to determine if import statement is correct.
* For example, if Vite needs to throw an error if variable is not actually exported
*/
type: "module" | "commonjs" | "builtin" | "network";
}
interface ViteFetchResult {
/**
* Code that will be evaluated by vite runner
* by default this will be wrapped in an async function
*/
code: string;
/**
* File path of the module on disk.
* This will be resolved as import.meta.url/filename
* Will be equal to `null` for virtual modules
*/
file: string | null;
/**
* Module ID in the server module graph.
*/
id: string;
/**
* Module URL used in the import.
*/
url: string;
/**
* Invalidate module on the client side.
*/
invalidate: boolean;
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/customEvent.d.ts
interface CustomEventMap {
// client events
'vite:beforeUpdate': UpdatePayload;
'vite:afterUpdate': UpdatePayload;
'vite:beforePrune': PrunePayload;
'vite:beforeFullReload': FullReloadPayload;
'vite:error': ErrorPayload;
'vite:invalidate': InvalidatePayload;
'vite:ws:connect': WebSocketConnectionPayload;
'vite:ws:disconnect': WebSocketConnectionPayload; // server events
'vite:client:connect': undefined;
'vite:client:disconnect': undefined;
}
interface WebSocketConnectionPayload {
/**
* @experimental
* We expose this instance experimentally to see potential usage.
* This might be removed in the future if we didn't find reasonable use cases.
* If you find this useful, please open an issue with details so we can discuss and make it stable API.
*/
// eslint-disable-next-line n/no-unsupported-features/node-builtins
webSocket: WebSocket;
}
interface InvalidatePayload {
path: string;
message: string | undefined;
firstInvalidatedBy: string;
}
/**
* provides types for payloads of built-in Vite events
*/
type InferCustomEventPayload = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/internal/terserOptions.d.ts
/* eslint-enable @typescript-eslint/ban-ts-comment */
type TerserMinifyOptions = Terser.MinifyOptions;
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
/* eslint-enable @typescript-eslint/ban-ts-comment */
// https://github.com/type-challenges/type-challenges/issues/29285
type IsAny = boolean extends (T extends never ? true : false) ? true : false;
type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>;
type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>;
type SassStringOptionsAsync = IsAny extends false ? SassEmbeddedStringOptionsAsync : DartSassStringOptionsAsync;
type SassModernPreprocessBaseOptions = Omit;
type LessPreprocessorBaseOptions = Omit;
type StylusPreprocessorBaseOptions = Omit & {
define?: Record;
};
declare global {
// LESS' types somewhat references this which doesn't make sense in Node,
// so we have to shim it
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface HTMLLinkElement {}
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/internal/lightningcssOptions.d.ts
/* eslint-enable @typescript-eslint/ban-ts-comment */
type LightningCSSOptions = Omit, 'filename' | 'resolver' | 'minify' | 'sourceMap' | 'analyzeDependencies' // properties not overridden by Vite, but does not make sense to set by end users
| 'inputSourceMap' | 'projectRoot'>;
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/importGlob.d.ts
/**
* Declare Worker in case DOM is not added to the tsconfig lib causing
* Worker interface is not defined. For developers with DOM lib added,
* the Worker interface will be merged correctly.
*/
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface Worker {}
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/types/metadata.d.ts
interface ChunkMetadata {
importedAssets: Set;
importedCss: Set;
}
interface CustomPluginOptionsVite {
/**
* If this is a CSS Rollup module, you can scope to its importer's exports
* so that if those exports are treeshaken away, the CSS module will also
* be treeshaken.
*
* The "importerId" must import the CSS Rollup module statically.
*
* Example config if the CSS id is `/src/App.vue?vue&type=style&lang.css`:
* ```js
* cssScopeTo: ['/src/App.vue', 'default']
* ```
*/
cssScopeTo?: readonly [importerId: string, exportName: string | undefined];
/** @deprecated no-op since Vite 6.1 */
lang?: string;
}
declare module 'rollup' {
export interface RenderedChunk {
viteMetadata?: ChunkMetadata;
}
export interface CustomPluginOptions {
vite?: CustomPluginOptionsVite;
}
}
//#endregion
//#region node_modules/.pnpm/vite@7.3.1_@types+node@25.9.2/node_modules/vite/dist/node/index.d.ts
//#region rolldown:runtime
//#endregion
//#region src/types/alias.d.ts
interface Alias {
find: string | RegExp;
replacement: string;
/**
* Instructs the plugin to use an alternative resolving algorithm,
* rather than the Rollup's resolver.
* @default null
*/
customResolver?: ResolverFunction | ResolverObject | null;
}
type MapToFunction = T$1 extends Function ? T$1 : never;
type ResolverFunction = MapToFunction;
interface ResolverObject {
buildStart?: PluginHooks['buildStart'];
resolveId: ResolverFunction;
}
/**
* Specifies an `Object`, or an `Array` of `Object`,
* which defines aliases used to replace values in `import` or `require` statements.
* With either format, the order of the entries is important,
* in that the first defined rules are applied first.
*
* This is passed to \@rollup/plugin-alias as the "entries" field
* https://github.com/rollup/plugins/tree/master/packages/alias#entries
*/
type AliasOptions = readonly Alias[] | {
[find: string]: string;
}; //#endregion
//#region src/types/anymatch.d.ts
type AnymatchFn = (testString: string) => boolean;
type AnymatchPattern = string | RegExp | AnymatchFn;
type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]; //#endregion
//#region src/types/chokidar.d.ts
declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
options: WatchOptions;
/**
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
*/
constructor(options?: WatchOptions);
/**
* When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
* Calling watcher.ref() multiple times will have no effect.
*/
ref(): this;
/**
* When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
* If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
* Calling watcher.unref() multiple times will have no effect.
*/
unref(): this;
/**
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
* string.
*/
add(paths: string | ReadonlyArray): this;
/**
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
* string.
*/
unwatch(paths: string | ReadonlyArray): this;
/**
* Returns an object representing all the paths on the file system being watched by this
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
* the `cwd` option was used), and the values are arrays of the names of the items contained in
* each directory.
*/
getWatched(): {
[directory: string]: string[];
};
/**
* Removes all listeners from watched files.
*/
close(): Promise;
on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
/**
* Error occurred
*/
on(event: 'error', listener: (error: Error) => void): this;
/**
* Exposes the native Node `fs.FSWatcher events`
*/
on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
/**
* Fires when the initial scan is complete
*/
on(event: 'ready', listener: () => void): this;
on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
}
interface WatchOptions {
/**
* Indicates whether the process should continue to run as long as files are being watched. If
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
* even if the process continues to run.
*/
persistent?: boolean;
/**
* ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
* be ignored. The whole relative or absolute path is tested, not just filename. If a function
* with two arguments is provided, it gets called twice per path - once with a single argument
* (the path), second time with two arguments (the path and the
* [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
*/
ignored?: AnymatchMatcher;
/**
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
* instantiating the watching as chokidar discovers these file paths (before the `ready` event).
*/
ignoreInitial?: boolean;
/**
* When `false`, only the symlinks themselves will be watched for changes instead of following
* the link references and bubbling events through the link's path.
*/
followSymlinks?: boolean;
/**
* The base directory from which watch `paths` are to be derived. Paths emitted with events will
* be relative to this.
*/
cwd?: string;
/**
* If set to true then the strings passed to .watch() and .add() are treated as literal path
* names, even if they look like globs.
*
* @default false
*/
disableGlobbing?: boolean;
/**
* Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
* utilization, consider setting this to `false`. It is typically necessary to **set this to
* `true` to successfully watch files over a network**, and it may be necessary to successfully
* watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
* the `useFsEvents` default.
*/
usePolling?: boolean;
/**
* Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
* and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
* OS X, `usePolling: true` becomes the default.
*/
useFsEvents?: boolean;
/**
* If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
* may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
* provided even in cases where it wasn't already available from the underlying watch events.
*/
alwaysStat?: boolean;
/**
* If set, limits how many levels of subdirectories will be traversed.
*/
depth?: number;
/**
* Interval of file system polling.
*/
interval?: number;
/**
* Interval of file system polling for binary files. ([see list of binary extensions](https://gi
* thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
*/
binaryInterval?: number;
/**
* Indicates whether to watch files that don't have read permissions if possible. If watching
* fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
* silently.
*/
ignorePermissionErrors?: boolean;
/**
* `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
* that occur when using editors that use "atomic writes" instead of writing directly to the
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
* you can override it by setting `atomic` to a custom value, in milliseconds.
*/
atomic?: boolean | number;
/**
* can be set to an object in order to adjust timing params:
*/
awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
}
interface AwaitWriteFinishOptions {
/**
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
*/
stabilityThreshold?: number;
/**
* File size polling interval.
*/
pollInterval?: number;
} //#endregion
//#region src/types/connect.d.ts
declare namespace Connect {
export type ServerHandle = HandleFunction | http.Server;
export class IncomingMessage extends http.IncomingMessage {
originalUrl?: http.IncomingMessage['url'] | undefined;
}
export type NextFunction = (err?: any) => void;
export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
export interface ServerStackItem {
route: string;
handle: ServerHandle;
}
export interface Server extends NodeJS.EventEmitter {
(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
route: string;
stack: ServerStackItem[];
/**
* Utilize the given middleware `handle` to the given `route`,
* defaulting to _/_. This "route" is the mount-point for the
* middleware, when given a value other than _/_ the middleware
* is only effective when that segment is present in the request's
* pathname.
*
* For example if we were to mount a function at _/admin_, it would
* be invoked on _/admin_, and _/admin/settings_, however it would
* not be invoked for _/_, or _/posts_.
*/
use(fn: NextHandleFunction): Server;
use(fn: HandleFunction): Server;
use(route: string, fn: NextHandleFunction): Server;
use(route: string, fn: HandleFunction): Server;
/**
* Handle server requests, punting them down
* the middleware stack.
*/
handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
/**
* Listen for connections.
*
* This method takes the same arguments
* as node's `http.Server#listen()`.
*
* HTTP and HTTPS:
*
* If you run your application both as HTTP
* and HTTPS you may wrap them individually,
* since your Connect "server" is really just
* a JavaScript `Function`.
*
* var connect = require('connect')
* , http = require('http')
* , https = require('https');
*
* var app = connect();
*
* http.createServer(app).listen(80);
* https.createServer(options, app).listen(443);
*/
listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
listen(port: number, hostname?: string, callback?: Function): http.Server;
listen(path: string, callback?: Function): http.Server;
listen(handle: any, listeningListener?: Function): http.Server;
}
} //#endregion
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0_patch_hash=d89dff5a0afc2cb277080ad056a3baf7feeeeac19144878abc17f4c91ad89095_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/index.d.ts
interface ProxyTargetDetailed {
host: string;
port: number;
protocol?: string;
hostname?: string;
socketPath?: string;
key?: string;
passphrase?: string;
pfx?: Buffer | string;
cert?: string;
ca?: string;
ciphers?: string;
secureProtocol?: string;
}
type ProxyType = "ws" | "web";
type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
type ProxyTargetUrl = URL | string | {
port: number;
host: string;
protocol?: string;
};
type NormalizeProxyTarget = Exclude | URL;
interface ServerOptions$3 {
/** URL string to be parsed with the url module. */
target?: ProxyTarget;
/** URL string to be parsed with the url module or a URL object. */
forward?: ProxyTargetUrl;
/** Object to be passed to http(s).request. */
agent?: any;
/** Object to be passed to https.createServer(). */
ssl?: any;
/** If you want to proxy websockets. */
ws?: boolean;
/** Adds x- forward headers. */
xfwd?: boolean;
/** Verify SSL certificate. */
secure?: boolean;
/** Explicitly specify if we are proxying to another proxy. */
toProxy?: boolean;
/** Specify whether you want to prepend the target's path to the proxy path. */
prependPath?: boolean;
/** Specify whether you want to ignore the proxy path of the incoming request. */
ignorePath?: boolean;
/** Local interface string to bind for outgoing connections. */
localAddress?: string;
/** Changes the origin of the host header to the target URL. */
changeOrigin?: boolean;
/** specify whether you want to keep letter case of response header key */
preserveHeaderKeyCase?: boolean;
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
auth?: string;
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
hostRewrite?: string;
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
autoRewrite?: boolean;
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
protocolRewrite?: string;
/** rewrites domain of set-cookie headers. */
cookieDomainRewrite?: false | string | {
[oldDomain: string]: string;
};
/** rewrites path of set-cookie headers. Default: false */
cookiePathRewrite?: false | string | {
[oldPath: string]: string;
};
/** object with extra headers to be added to target requests. */
headers?: {
[header: string]: string | string[] | undefined;
};
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
proxyTimeout?: number;
/** Timeout (in milliseconds) for incoming requests */
timeout?: number;
/** Specify whether you want to follow redirects. Default: false */
followRedirects?: boolean;
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
selfHandleResponse?: boolean;
/** Buffer */
buffer?: Stream;
/** Explicitly set the method type of the ProxyReq */
method?: string;
/**
* Optionally override the trusted CA certificates.
* This is passed to https.request.
*/
ca?: string;
}
interface NormalizedServerOptions extends ServerOptions$3 {
target?: NormalizeProxyTarget;
forward?: NormalizeProxyTarget;
}
type ErrorCallback = (err: TError, req: InstanceType, res: InstanceType | net.Socket, target?: ProxyTargetUrl) => void;
type ProxyServerEventMap = {
error: Parameters>;
start: [req: InstanceType, res: InstanceType, target: ProxyTargetUrl];
open: [socket: net.Socket];
proxyReq: [proxyReq: http.ClientRequest, req: InstanceType, res: InstanceType, options: ServerOptions$3, socket: net.Socket];
proxyRes: [proxyRes: InstanceType, req: InstanceType, res: InstanceType];
proxyReqWs: [proxyReq: http.ClientRequest, req: InstanceType, socket: net.Socket, options: ServerOptions$3, head: any];
econnreset: [err: Error, req: InstanceType, res: InstanceType, target: ProxyTargetUrl];
end: [req: InstanceType, res: InstanceType, proxyRes: InstanceType];
close: [proxyRes: InstanceType, proxySocket: net.Socket, proxyHead: any];
};
type ProxyMethodArgs = {
ws: [req: InstanceType, socket: any, head: any, ...args: [options?: ServerOptions$3, callback?: ErrorCallback] | [callback?: ErrorCallback]];
web: [req: InstanceType, res: InstanceType, ...args: [options: ServerOptions$3, callback?: ErrorCallback] | [callback?: ErrorCallback]];
};
type PassFunctions = {
ws: (req: InstanceType, socket: net.Socket, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer, cb?: ErrorCallback) => unknown;
web: (req: InstanceType, res: InstanceType, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer, cb?: ErrorCallback) => unknown;
};
declare class ProxyServer extends EventEmitter> {
/**
* Used for proxying WS(S) requests
* @param req - Client request.
* @param socket - Client socket.
* @param head - Client head.
* @param options - Additional options.
*/
readonly ws: (...args: ProxyMethodArgs["ws"]) => void;
/**
* Used for proxying regular HTTP(S) requests
* @param req - Client request.
* @param res - Client response.
* @param options - Additional options.
*/
readonly web: (...args: ProxyMethodArgs["web"]) => void;
private options;
private webPasses;
private wsPasses;
private _server?;
/**
* Creates the proxy server with specified options.
* @param options - Config object passed to the proxy
*/
constructor(options?: ServerOptions$3);
/**
* Creates the proxy server with specified options.
* @param options Config object passed to the proxy
* @returns Proxy object with handlers for `ws` and `web` requests
*/
static createProxyServer(options?: ServerOptions$3): ProxyServer;
/**
* Creates the proxy server with specified options.
* @param options Config object passed to the proxy
* @returns Proxy object with handlers for `ws` and `web` requests
*/
static createServer(options?: ServerOptions$3): ProxyServer;
/**
* Creates the proxy server with specified options.
* @param options Config object passed to the proxy
* @returns Proxy object with handlers for `ws` and `web` requests
*/
static createProxy(options?: ServerOptions$3): ProxyServer;
createRightProxy: (type: PT) => Function;
onError: (err: TError) => void;
/**
* A function that wraps the object in a webserver, for your convenience
* @param port - Port to listen on
* @param hostname - The hostname to listen on
*/
listen: (port: number, hostname?: string) => this;
address: () => string | net.AddressInfo | null | undefined;
/**
* A function that closes the inner webserver and stops listening on given port
*/
close: (cb?: Function) => void;
before: (type: PT, passName: string, cb: PassFunctions[PT]) => void;
after: (type: PT, passName: string, cb: PassFunctions[PT]) => void;
} //#endregion
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0_patch_hash=d89dff5a0afc2cb277080ad056a3baf7feeeeac19144878abc17f4c91ad89095_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.d.ts
//#endregion
//#region src/node/server/middlewares/proxy.d.ts
interface ProxyOptions extends ServerOptions$3 {
/**
* rewrite path
*/
rewrite?: (path: string) => string;
/**
* configure the proxy server (e.g. listen to events)
*/
configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
/**
* webpack-dev-server style bypass function
*/
bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise;
/**
* rewrite the Origin header of a WebSocket request to match the target
*
* **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
*/
rewriteWsOrigin?: boolean | undefined;
} //#endregion
//#region src/node/logger.d.ts
type LogType = "error" | "warn" | "info";
type LogLevel = LogType | "silent";
interface Logger {
info(msg: string, options?: LogOptions): void;
warn(msg: string, options?: LogOptions): void;
warnOnce(msg: string, options?: LogOptions): void;
error(msg: string, options?: LogErrorOptions): void;
clearScreen(type: LogType): void;
hasErrorLogged(error: Error | RollupError): boolean;
hasWarned: boolean;
}
interface LogOptions {
clear?: boolean;
timestamp?: boolean;
environment?: string;
}
interface LogErrorOptions extends LogOptions {
error?: Error | RollupError | null;
}
//#endregion
//#region src/node/http.d.ts
interface CommonServerOptions {
/**
* Specify server port. Note if the port is already being used, Vite will
* automatically try the next available port so this may not be the actual
* port the server ends up listening on.
*/
port?: number;
/**
* If enabled, vite will exit if specified port is already in use
*/
strictPort?: boolean;
/**
* Specify which IP addresses the server should listen on.
* Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
*/
host?: string | boolean;
/**
* The hostnames that Vite is allowed to respond to.
* `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
* When using HTTPS, this check is skipped.
*
* If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
* For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
*
* If set to `true`, the server is allowed to respond to requests for any hosts.
* This is not recommended as it will be vulnerable to DNS rebinding attacks.
*/
allowedHosts?: string[] | true;
/**
* Enable TLS + HTTP/2.
* Note: this downgrades to TLS only when the proxy option is also used.
*/
https?: ServerOptions$1;
/**
* Open browser window on startup
*/
open?: boolean | string;
/**
* Configure custom proxy rules for the dev server. Expects an object
* of `{ key: options }` pairs.
* Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
* Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
*
* Example `vite.config.js`:
* ``` js
* module.exports = {
* proxy: {
* // string shorthand: /foo -> http://localhost:4567/foo
* '/foo': 'http://localhost:4567',
* // with options
* '/api': {
* target: 'http://jsonplaceholder.typicode.com',
* changeOrigin: true,
* rewrite: path => path.replace(/^\/api/, '')
* }
* }
* }
* ```
*/
proxy?: Record;
/**
* Configure CORS for the dev server.
* Uses https://github.com/expressjs/cors.
*
* When enabling this option, **we recommend setting a specific value
* rather than `true`** to avoid exposing the source code to untrusted origins.
*
* Set to `true` to allow all methods from any origin, or configure separately
* using an object.
*
* @default false
*/
cors?: CorsOptions | boolean;
/**
* Specify server response headers.
*/
headers?: OutgoingHttpHeaders;
}
/**
* https://github.com/expressjs/cors#configuration-options
*/
interface CorsOptions {
/**
* Configures the Access-Control-Allow-Origin CORS header.
*
* **We recommend setting a specific value rather than
* `true`** to avoid exposing the source code to untrusted origins.
*/
origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
methods?: string | string[];
allowedHeaders?: string | string[];
exposedHeaders?: string | string[];
credentials?: boolean;
maxAge?: number;
preflightContinue?: boolean;
optionsSuccessStatus?: number;
}
type CorsOrigin = boolean | string | RegExp | (string | RegExp)[]; //#endregion
//#region src/node/typeUtils.d.ts
type RequiredExceptFor = Pick & Required>; //#endregion
//#region src/node/preview.d.ts
interface PreviewOptions extends CommonServerOptions {}
interface ResolvedPreviewOptions extends RequiredExceptFor {}
interface PreviewServer {
/**
* The resolved vite config object
*/
config: ResolvedConfig;
/**
* Stop the server.
*/
close(): Promise;
/**
* A connect app instance.
* - Can be used to attach custom middlewares to the preview server.
* - Can also be used as the handler function of a custom http server
* or as a middleware in any connect-style Node.js frameworks
*
* https://github.com/senchalabs/connect#use-middleware
*/
middlewares: Connect.Server;
/**
* native Node http server instance
*/
httpServer: HttpServer;
/**
* The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
* if the server is not listening on any port.
*/
resolvedUrls: ResolvedServerUrls | null;
/**
* Print server urls
*/
printUrls(): void;
/**
* Bind CLI shortcuts
*/
bindCLIShortcuts(options?: BindCLIShortcutsOptions): void;
}
type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
/**
* Starts the Vite server in preview mode, to simulate a production deployment
*/
//#endregion
//#region src/node/shortcuts.d.ts
type BindCLIShortcutsOptions = {
/**
* Print a one-line shortcuts "help" hint to the terminal
*/
print?: boolean;
/**
* Custom shortcuts to run when a key is pressed. These shortcuts take priority
* over the default shortcuts if they have the same keys (except the `h` key).
* To disable a default shortcut, define the same key but with `action: undefined`.
*/
customShortcuts?: CLIShortcut[];
};
type CLIShortcut = {
key: string;
description: string;
action?(server: Server$3): void | Promise;
}; //#endregion
//#region src/node/baseEnvironment.d.ts
declare class PartialEnvironment {
name: string;
getTopLevelConfig(): ResolvedConfig;
config: ResolvedConfig & ResolvedEnvironmentOptions;
logger: Logger;
constructor(name: string, topLevelConfig: ResolvedConfig, options?: ResolvedEnvironmentOptions);
}
declare class BaseEnvironment extends PartialEnvironment {
get plugins(): readonly Plugin[];
constructor(name: string, config: ResolvedConfig, options?: ResolvedEnvironmentOptions);
}
/**
* This class discourages users from inversely checking the `mode`
* to determine the type of environment, e.g.
*
* ```js
* const isDev = environment.mode !== 'build' // bad
* const isDev = environment.mode === 'dev' // good
* ```
*
* You should also not check against `"unknown"` specifically. It's
* a placeholder for more possible environment types.
*/
declare class UnknownEnvironment extends BaseEnvironment {
mode: "unknown";
} //#endregion
//#region src/node/optimizer/scan.d.ts
declare class ScanEnvironment extends BaseEnvironment {
mode: "scan";
get pluginContainer(): EnvironmentPluginContainer;
init(): Promise;
} //#endregion
//#region src/node/optimizer/index.d.ts
type ExportsData = {
hasModuleSyntax: boolean;
exports: readonly string[];
jsxLoader?: boolean;
};
interface DepsOptimizer {
init: () => Promise;
metadata: DepOptimizationMetadata;
scanProcessing?: Promise;
registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
run: () => void;
isOptimizedDepFile: (id: string) => boolean;
isOptimizedDepUrl: (url: string) => boolean;
getOptimizedDepId: (depInfo: OptimizedDepInfo) => string;
close: () => Promise;
options: DepOptimizationOptions;
}
interface DepOptimizationConfig {
/**
* Force optimize listed dependencies (must be resolvable import paths,
* cannot be globs).
*/
include?: string[];
/**
* Do not optimize these dependencies (must be resolvable import paths,
* cannot be globs).
*/
exclude?: string[];
/**
* Forces ESM interop when importing these dependencies. Some legacy
* packages advertise themselves as ESM but use `require` internally
* @experimental
*/
needsInterop?: string[];
/**
* Options to pass to esbuild during the dep scanning and optimization
*
* Certain options are omitted since changing them would not be compatible
* with Vite's dep optimization.
*
* - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
* - `plugins` are merged with Vite's dep plugin
*
* https://esbuild.github.io/api
*/
esbuildOptions?: Omit;
/**
* List of file extensions that can be optimized. A corresponding esbuild
* plugin must exist to handle the specific extension.
*
* By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
* allows specifying additional extensions.
*
* @experimental
*/
extensions?: string[];
/**
* Deps optimization during build was removed in Vite 5.1. This option is
* now redundant and will be removed in a future version. Switch to using
* `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
* true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
* @default 'build'
* @deprecated
* @experimental
*/
disabled?: boolean | "build" | "dev";
/**
* Automatic dependency discovery. When `noDiscovery` is true, only dependencies
* listed in `include` will be optimized. The scanner isn't run for cold start
* in this case. CJS-only dependencies must be present in `include` during dev.
* @default false
*/
noDiscovery?: boolean;
/**
* When enabled, it will hold the first optimized deps results until all static
* imports are crawled on cold start. This avoids the need for full-page reloads
* when new dependencies are discovered and they trigger the generation of new
* common chunks. If all dependencies are found by the scanner plus the explicitly
* defined ones in `include`, it is better to disable this option to let the
* browser process more requests in parallel.
* @default true
* @experimental
*/
holdUntilCrawlEnd?: boolean;
/**
* When enabled, Vite will not throw an error when an outdated optimized
* dependency is requested. Enabling this option may cause a single module
* to have a multiple reference.
* @default false
* @experimental
*/
ignoreOutdatedRequests?: boolean;
}
type DepOptimizationOptions = DepOptimizationConfig & {
/**
* By default, Vite will crawl your `index.html` to detect dependencies that
* need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
* will crawl those entry points instead.
*
* If neither of these fit your needs, you can specify custom entries using
* this option - the value should be a tinyglobby pattern or array of patterns
* (https://github.com/SuperchupuDev/tinyglobby) that are relative from
* vite project root. This will overwrite default entries inference.
*/
entries?: string | string[];
/**
* Force dep pre-optimization regardless of whether deps have changed.
* @experimental
*/
force?: boolean;
};
interface OptimizedDepInfo {
id: string;
file: string;
src?: string;
needsInterop?: boolean;
browserHash?: string;
fileHash?: string;
/**
* During optimization, ids can still be resolved to their final location
* but the bundles may not yet be saved to disk
*/
processing?: Promise;
/**
* ExportData cache, discovered deps will parse the src entry to get exports
* data used both to define if interop is needed and when pre-bundling
*/
exportsData?: Promise;
}
interface DepOptimizationMetadata {
/**
* The main hash is determined by user config and dependency lockfiles.
* This is checked on server startup to avoid unnecessary re-bundles.
*/
hash: string;
/**
* This hash is determined by dependency lockfiles.
* This is checked on server startup to avoid unnecessary re-bundles.
*/
lockfileHash: string;
/**
* This hash is determined by user config.
* This is checked on server startup to avoid unnecessary re-bundles.
*/
configHash: string;
/**
* The browser hash is determined by the main hash plus additional dependencies
* discovered at runtime. This is used to invalidate browser requests to
* optimized deps.
*/
browserHash: string;
/**
* Metadata for each already optimized dependency
*/
optimized: Record