Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

45
node_modules/@rspack/core/dist/util/ArrayQueue.d.ts generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/ArrayQueue.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
/**
* @template T
*/
declare class ArrayQueue<T> {
_list: T[];
_listReversed: T[];
constructor(items?: T[]);
/**
* Returns the number of elements in this queue.
* @returns {number} The number of elements in this queue.
*/
get length(): number;
/**
* Empties the queue.
*/
clear(): void;
/**
* Appends the specified element to this queue.
* @param {T} item The element to add.
* @returns {void}
*/
enqueue(item: T): void;
/**
* Retrieves and removes the head of this queue.
* @returns {T | undefined} The head of the queue of `undefined` if this queue is empty.
*/
dequeue(): T | undefined;
/**
* Finds and removes an item
* @param {T} item the item
* @returns {void}
*/
delete(item: T): void;
[Symbol.iterator](): Generator<T, void, unknown>;
}
export default ArrayQueue;

7
node_modules/@rspack/core/dist/util/AsyncTask.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
type TaskCallback<Ret> = (err: Error | null, ret: Ret | null) => void;
export declare class AsyncTask<Param, Ret> {
#private;
constructor(task: (param: Param[], callback: (results: [Error | null, Ret | null][]) => void) => void);
exec(param: Param, callback: TaskCallback<Ret>): void;
}
export {};

10
node_modules/@rspack/core/dist/util/MergeCaller.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
type CallFn<D> = (args: D[]) => void;
export default class MergeCaller<D> {
private callArgs;
private callFn;
constructor(fn: CallFn<D>);
private finalCall;
pendingData(): D[];
push(...data: D[]): void;
}
export {};

View File

@@ -0,0 +1,10 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
export declare const formatSize: (size: unknown) => string;

View File

@@ -0,0 +1,5 @@
import type { RawSplitChunkSizes } from "@rspack/binding";
declare class JsSplitChunkSizes {
static __to_binding(sizes?: number | Record<string, number>): number | RawSplitChunkSizes | undefined;
}
export { JsSplitChunkSizes };

View File

@@ -0,0 +1 @@
export declare function assertNotNill(value: unknown): asserts value;

View File

@@ -0,0 +1,2 @@
export type AssetCondition = string | RegExp;
export type AssetConditions = AssetCondition | AssetCondition[];

54
node_modules/@rspack/core/dist/util/asyncLib.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
/**
* The following code is modified based on
* https://github.com/suguru03/neo-async/blob/master/lib/async.js
*
* MIT Licensed
* Author Suguru Motegi
* Copyright (c) 2014-2018 Suguru Motegi
* https://github.com/suguru03/neo-async/blob/master/LICENSE
*/
export interface Dictionary<T> {
[key: string]: T;
}
export type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
export type ErrorCallback<E = Error> = (err?: E | null) => void;
export type AsyncIterator<T, E = Error> = (item: T, callback: ErrorCallback<E>) => void;
/**
* @example
*
* // array
* var order = [];
* var array = [1, 3, 2];
* var iterator = function(num, done) {
* setTimeout(function() {
* order.push(num);
* done();
* }, num * 10);
* };
* asyncLib.each(array, iterator, function(err, res) {
* console.log(res); // undefined
* console.log(order); // [1, 2, 3]
* });
*
* @example
*
* // break
* var order = [];
* var array = [1, 3, 2];
* var iterator = function(num, done) {
* setTimeout(function() {
* order.push(num);
* done(null, num !== 2);
* }, num * 10);
* };
* asyncLib.each(array, iterator, function(err, res) {
* console.log(res); // undefined
* console.log(order); // [1, 2]
* });
*
*/
declare function each<T, E = Error>(collection: IterableCollection<T>, iterator: AsyncIterator<T, E>, originalCallback: ErrorCallback<E>): void;
declare const _default: {
each: typeof each;
};
export default _default;

View File

@@ -0,0 +1,5 @@
/**
* Check if these version matches:
* `@rspack/core`, Binding version
*/
export declare const checkVersion: () => Error | null | undefined;

24
node_modules/@rspack/core/dist/util/cleverMerge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
export declare const DELETE: unique symbol;
/**
* Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
* @example
* // performs cleverMerge(first, second), stores the result in WeakMap and returns result
* cachedCleverMerge({a: 1}, {a: 2})
* {a: 2}
* // when same arguments passed, gets the result from WeakMap and returns it.
* cachedCleverMerge({a: 1}, {a: 2})
* {a: 2}
* @param first first object
* @param second second object
* @returns merged object of first and second object
*/
export declare const cachedCleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
/**
* Merges two objects. Objects are deeply clever merged.
* Arrays might reference the old value with "...".
* Non-object values take preference over object values.
* @param first first object
* @param second second object
* @returns merged object of first and second object
*/
export declare const cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);

16
node_modules/@rspack/core/dist/util/comparators.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
export type Comparator = <T>(arg0: T, arg1: T) => -1 | 0 | 1;
type Selector<A, B> = (input: A) => B;
export declare const concatComparators: (...comps: Comparator[]) => Comparator;
export declare const compareIds: <T = string | number>(a: T, b: T) => -1 | 0 | 1;
export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
export declare const compareNumbers: (a: number, b: number) => 0 | 1 | -1;
export {};

16
node_modules/@rspack/core/dist/util/createHash.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/createHash.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import Hash from "./hash";
/**
* Creates a hash by name or function
* @param algorithm the algorithm name or a constructor creating a hash
* @returns the hash
*/
export declare const createHash: (algorithm: "debug" | "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;

View File

@@ -0,0 +1 @@
export declare function createReadonlyMap<T>(obj: Pick<ReadonlyMap<string, T>, "get" | "keys">): ReadonlyMap<string, Readonly<T>>;

9
node_modules/@rspack/core/dist/util/fake.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export type FakeHook<T> = T & {
_fakeHook: true;
};
export declare function createFakeCompilationDependencies(getDeps: () => string[], addDeps: (deps: string[]) => void): {
[Symbol.iterator](): Generator<string, void, unknown>;
has(dep: string): boolean;
add: (dep: string) => void;
addAll: (deps: Iterable<string>) => void;
};

375
node_modules/@rspack/core/dist/util/fs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,375 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/fs.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { Abortable } from "node:events";
import type { WatchOptions } from "../config";
export interface Watcher {
close(): void;
pause(): void;
getAggregatedChanges?(): Set<string>;
getAggregatedRemovals?(): Set<string>;
getFileTimeInfoEntries?(): Map<string, FileSystemInfoEntry | "ignore">;
getContextTimeInfoEntries?(): Map<string, FileSystemInfoEntry | "ignore">;
getInfo(): WatcherInfo;
}
export interface WatcherInfo {
changes: Set<string>;
removals: Set<string>;
fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
}
export type IStatsBase<T> = {
isFile: () => boolean;
isDirectory: () => boolean;
isBlockDevice: () => boolean;
isCharacterDevice: () => boolean;
isSymbolicLink: () => boolean;
isFIFO: () => boolean;
isSocket: () => boolean;
dev: T;
ino: T;
mode: T;
nlink: T;
uid: T;
gid: T;
rdev: T;
size: T;
blksize: T;
blocks: T;
atimeMs: T;
mtimeMs: T;
ctimeMs: T;
birthtimeMs: T;
atime: Date;
mtime: Date;
ctime: Date;
birthtime: Date;
};
export type IStats = IStatsBase<number>;
export type IBigIntStats = IStatsBase<bigint> & {
atimeNs: bigint;
mtimeNs: bigint;
ctimeNs: bigint;
birthtimeNs: bigint;
};
interface IDirent {
isFile: () => boolean;
isDirectory: () => boolean;
isBlockDevice: () => boolean;
isCharacterDevice: () => boolean;
isSymbolicLink: () => boolean;
isFIFO: () => boolean;
isSocket: () => boolean;
name: string | Buffer;
}
export interface StreamOptions {
flags?: string;
encoding?: NodeJS.BufferEncoding;
fd?: any;
mode?: number;
autoClose?: boolean;
emitClose?: boolean;
start?: number;
signal?: null | AbortSignal;
}
export interface FSImplementation {
open?: (...args: any[]) => any;
close?: (...args: any[]) => any;
}
export type CreateReadStreamFSImplementation = FSImplementation & {
read: (...args: any[]) => any;
};
export type ReadStreamOptions = StreamOptions & {
fs?: null | CreateReadStreamFSImplementation;
end?: number;
};
export type CreateReadStream = (path: PathLike, options?: NodeJS.BufferEncoding | ReadStreamOptions) => NodeJS.ReadableStream;
export interface OutputFileSystem {
writeFile: (arg0: string | number, arg1: string | Buffer, arg2: (arg0?: null | NodeJS.ErrnoException) => void) => void;
mkdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
readdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: (string | Buffer)[] | IDirent[]) => void) => void;
rmdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
unlink: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
stat: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void) => void;
lstat?: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void) => void;
readFile: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void) => void;
chmod: (arg0: string, arg1: number, arg2: (arg0?: NodeJS.ErrnoException | null) => void) => void;
join?: (arg0: string, arg1: string) => string;
relative?: (arg0: string, arg1: string) => string;
dirname?: (arg0: string) => string;
createReadStream?: CreateReadStream;
}
export type JsonPrimitive = string | number | boolean | null;
export type JsonArray = JsonValue[];
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
export type JsonObject = {
[Key in string]: JsonValue;
} & {
[Key in string]?: JsonValue | undefined;
};
export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
export type StringCallback = (err: NodeJS.ErrnoException | null, data?: string) => void;
export type BufferCallback = (err: NodeJS.ErrnoException | null, data?: Buffer) => void;
export type StringOrBufferCallback = (err: NodeJS.ErrnoException | null, data?: string | Buffer) => void;
export type ReaddirStringCallback = (err: NodeJS.ErrnoException | null, files?: string[]) => void;
export type ReaddirBufferCallback = (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void;
export type ReaddirStringOrBufferCallback = (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void;
export type ReaddirDirentCallback = (err: NodeJS.ErrnoException | null, files?: IDirent[]) => void;
export type StatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats) => void;
export type BigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IBigIntStats) => void;
export type StatsOrBigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats | IBigIntStats) => void;
export type NumberCallback = (err: NodeJS.ErrnoException | null, data?: number) => void;
export type ReadJsonCallback = (err: NodeJS.ErrnoException | Error | null, data?: JsonObject) => void;
export type PathLike = string | Buffer | URL;
export type PathOrFileDescriptor = PathLike | number;
export type ObjectEncodingOptions = {
encoding?: BufferEncoding | null;
};
export type ReadFile = {
(path: PathOrFileDescriptor, options: ({
encoding: null | undefined;
flag?: string;
} & Abortable) | null | undefined, callback: BufferCallback): void;
(path: PathOrFileDescriptor, options: ({
encoding: BufferEncoding;
flag?: string;
} & Abortable) | BufferEncoding, callback: StringCallback): void;
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
flag?: string;
} & Abortable) | BufferEncoding | null | undefined, callback: StringOrBufferCallback): void;
(path: PathOrFileDescriptor, callback: BufferCallback): void;
};
export type ReadFileSync = {
(path: PathOrFileDescriptor, options: {
encoding: null | undefined;
flag?: string;
} | null): Buffer;
(path: PathOrFileDescriptor, options: {
encoding: BufferEncoding;
flag?: string;
} | BufferEncoding): string;
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
flag?: string;
}) | BufferEncoding | null): string | Buffer;
};
export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
export type BufferEncodingOption = "buffer" | {
encoding: "buffer";
};
export type StatOptions = {
bigint?: boolean;
};
export type StatSyncOptions = {
bigint?: boolean;
throwIfNoEntry?: boolean;
};
export type Readlink = {
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
(path: PathLike, callback: StringCallback): void;
};
export type ReadlinkSync = {
(path: PathLike, options: EncodingOption): string;
(path: PathLike, options: BufferEncodingOption): Buffer;
(path: PathLike, options: EncodingOption): string | Buffer;
};
export type Readdir = {
(path: PathLike, options: {
encoding: BufferEncoding | null;
withFileTypes?: false;
recursive?: boolean;
} | BufferEncoding | null | undefined, callback: ReaddirStringCallback): void;
(path: PathLike, options: {
encoding: "buffer";
withFileTypes?: false;
recursive?: boolean;
} | "buffer", callback: ReaddirBufferCallback): void;
(path: PathLike, callback: ReaddirStringCallback): void;
(path: PathLike, options: (ObjectEncodingOptions & {
withFileTypes: true;
recursive?: boolean;
}) | BufferEncoding | null | undefined, callback: ReaddirStringOrBufferCallback): void;
(path: PathLike, options: ObjectEncodingOptions & {
withFileTypes: true;
recursive?: boolean;
}, callback: ReaddirDirentCallback): void;
};
export type ReaddirSync = {
(path: PathLike, options: {
encoding: BufferEncoding | null;
withFileTypes?: false;
recursive?: boolean;
} | BufferEncoding | null): string[];
(path: PathLike, options: {
encoding: "buffer";
withFileTypes?: false;
recursive?: boolean;
} | "buffer"): Buffer[];
(path: PathLike, options: (ObjectEncodingOptions & {
withFileTypes?: false;
recursive?: boolean;
}) | BufferEncoding | null): string[] | Buffer[];
(path: PathLike, options: ObjectEncodingOptions & {
withFileTypes: true;
recursive?: boolean;
}): IDirent[];
};
export type Stat = {
(path: PathLike, callback: StatsCallback): void;
(path: PathLike, options: (StatOptions & {
bigint?: false;
}) | undefined, callback: StatsCallback): void;
(path: PathLike, options: StatOptions & {
bigint: true;
}, callback: BigIntStatsCallback): void;
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
};
export type StatSync = {
(path: PathLike, options?: undefined): IStats;
(path: PathLike, options?: StatSyncOptions & {
bigint?: false;
throwIfNoEntry: false;
}): IStats | undefined;
(path: PathLike, options: StatSyncOptions & {
bigint: true;
throwIfNoEntry: false;
}): IBigIntStats | undefined;
(path: PathLike, options?: StatSyncOptions & {
bigint?: false;
}): IStats;
(path: PathLike, options: StatSyncOptions & {
bigint: true;
}): IBigIntStats;
(path: PathLike, options: StatSyncOptions & {
bigint: boolean;
throwIfNoEntry?: false;
}): IStats | IBigIntStats;
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
};
export type LStat = {
(path: PathLike, callback: StatsCallback): void;
(path: PathLike, options: (StatOptions & {
bigint?: false;
}) | undefined, callback: StatsCallback): void;
(path: PathLike, options: StatOptions & {
bigint: true;
}, callback: BigIntStatsCallback): void;
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
};
export type LStatSync = {
(path: PathLike, options?: undefined): IStats;
(path: PathLike, options?: StatSyncOptions & {
bigint?: false;
throwIfNoEntry: false;
}): IStats | undefined;
(path: PathLike, options: StatSyncOptions & {
bigint: true;
throwIfNoEntry: false;
}): IBigIntStats | undefined;
(path: PathLike, options?: StatSyncOptions & {
bigint?: false;
}): IStats;
(path: PathLike, options: StatSyncOptions & {
bigint: true;
}): IBigIntStats;
(path: PathLike, options: StatSyncOptions & {
bigint: boolean;
throwIfNoEntry?: false;
}): IStats | IBigIntStats;
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
};
export type RealPath = {
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
(path: PathLike, callback: StringCallback): void;
};
export type RealPathSync = {
(path: PathLike, options?: EncodingOption): string;
(path: PathLike, options: BufferEncodingOption): Buffer;
(path: PathLike, options?: EncodingOption): string | Buffer;
};
export type ReadJson = (path: PathOrFileDescriptor, callback: ReadJsonCallback) => void;
export type ReadJsonSync = (path: PathOrFileDescriptor) => JsonObject;
export type Purge = (files?: string | string[] | Set<string>) => void;
export type InputFileSystem = {
readFile: ReadFile;
readFileSync?: ReadFileSync;
readlink: Readlink;
readlinkSync?: ReadlinkSync;
readdir: Readdir;
readdirSync?: ReaddirSync;
stat: Stat;
statSync?: StatSync;
lstat?: LStat;
lstatSync?: LStatSync;
realpath?: RealPath;
realpathSync?: RealPathSync;
readJson?: ReadJson;
readJsonSync?: ReadJsonSync;
purge?: Purge;
join?: (path1: string, path2: string) => string;
relative?: (from: string, to: string) => string;
dirname?: (path: string) => string;
};
export type IntermediateFileSystem = InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras;
export type WriteStreamOptions = {
flags?: string;
encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "latin1" | "binary" | "base64" | "base64url" | "hex";
fd?: any;
mode?: number;
};
export type MakeDirectoryOptions = {
recursive?: boolean;
mode?: string | number;
};
export type MkdirSync = (path: PathLike, options: MakeDirectoryOptions) => undefined | string;
export type ReadAsyncOptions<TBuffer extends ArrayBufferView = Buffer> = {
offset?: number;
length?: number;
position?: null | number | bigint;
buffer?: TBuffer;
};
export type Read<TBuffer extends ArrayBufferView = Buffer> = (fd: number, options: ReadAsyncOptions<TBuffer>, callback: (err: null | NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void) => void;
export type WriteAsyncOptions<TBuffer extends ArrayBufferView = Buffer> = {
offset?: number;
length?: number;
position?: null | number | bigint;
buffer?: TBuffer;
};
export type Write<TBuffer extends ArrayBufferView = Buffer> = (fd: number, content: Buffer, options: WriteAsyncOptions<TBuffer>, callback: (err: null | NodeJS.ErrnoException, bytesWrite: number, buffer: TBuffer) => void) => void;
export type Open = (file: PathLike, flags: undefined | string | number, callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void) => void;
export type IntermediateFileSystemExtras = {
rename: (arg0: PathLike, arg1: PathLike, arg2: (arg0: null | NodeJS.ErrnoException) => void) => void;
mkdirSync: MkdirSync;
write: Write;
open: Open;
read: Read;
close: (arg0: number, arg1: (arg0: null | NodeJS.ErrnoException) => void) => void;
};
export declare function rmrf(fs: OutputFileSystem, p: string, callback: (err?: Error | null) => void): void;
export declare const mkdirp: (fs: OutputFileSystem, p: string, callback: (error?: Error) => void) => void;
export interface FileSystemInfoEntry {
safeTime: number;
timestamp?: number;
}
export interface WatchFileSystem {
watch(files: Iterable<string> & {
added?: Iterable<String>;
removed?: Iterable<String>;
}, directories: Iterable<string> & {
added?: Iterable<String>;
removed?: Iterable<String>;
}, missing: Iterable<string> & {
added?: Iterable<String>;
removed?: Iterable<String>;
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
}
export {};

26
node_modules/@rspack/core/dist/util/hash/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export default class Hash {
/**
* @param data data
* @param inputEncoding data encoding
* @returns updated hash
*/
update(data: string, inputEncoding: string): this;
/**
* @param data data
* @returns updated hash
*/
update(data: Buffer): this;
/**
* Calculates the digest without encoding
* @abstract
* @returns {Buffer} digest
*/
digest(): Buffer;
/**
* Calculates the digest with encoding
* @abstract
* @param encoding encoding of the return value
* @returns {string} digest
*/
digest(encoding: string): string;
}

11
node_modules/@rspack/core/dist/util/hash/md4.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/md4.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
declare const _default: () => import("./wasm-hash").WasmHash;
export default _default;

View File

@@ -0,0 +1,51 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/wasm-hash.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
type Exports = WebAssembly.Instance["exports"] & {
init: () => void;
update: (b: number) => void;
memory: WebAssembly.Memory;
final: (b: number) => void;
};
export declare class WasmHash {
exports: Exports;
instancesPool: WebAssembly.Instance[];
buffered: number;
mem: Buffer;
chunkSize: number;
digestSize: number;
/**
* @param instance wasm instance
* @param instancesPool pool of instances
* @param chunkSize size of data chunks passed to wasm
* @param digestSize size of digest returned by wasm
*/
constructor(instance: WebAssembly.Instance, instancesPool: WebAssembly.Instance[], chunkSize: number, digestSize: number);
reset(): void;
/**
* @param data data
* @param encoding encoding
* @returns itself
*/
update(data: Buffer | string, encoding?: BufferEncoding): this;
/**
* @param {string} data data
* @param {BufferEncoding=} encoding encoding
* @returns {void}
*/
_updateWithShortString(data: string, encoding?: BufferEncoding): void;
/**
* @param data data
* @returns
*/
_updateWithBuffer(data: Buffer): void;
digest(type: BufferEncoding): string | Buffer<ArrayBuffer>;
}
declare const create: (wasmModule: WebAssembly.Module, instancesPool: WasmHash[], chunkSize: number, digestSize: number) => WasmHash;
export default create;

11
node_modules/@rspack/core/dist/util/hash/xxhash64.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/xxhash64.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
declare const _default: () => import("./wasm-hash").WasmHash;
export default _default;

31
node_modules/@rspack/core/dist/util/identifier.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
interface ParsedResource {
resource: string;
path: string;
query: string;
fragment: string;
}
type ParsedResourceWithoutFragment = Omit<ParsedResource, "fragment">;
export declare const makePathsRelative: {
(context: string, identifier: string, associatedObjectForCache: object | undefined): string;
bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
};
export declare const contextify: {
(context: string, identifier: string, associatedObjectForCache: object | undefined): string;
bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
};
export declare const absolutify: {
(context: string, identifier: string, associatedObjectForCache: object | undefined): string;
bindCache(associatedObjectForCache: object | undefined): ((arg0: string, arg1: string) => string);
bindContextCache(context: string, associatedObjectForCache: object | undefined): ((arg0: string) => string);
};
export declare const parseResource: {
(str: string, associatedObjectForCache?: object): ParsedResource;
bindCache(associatedObjectForCache: object): (str: string) => ParsedResource;
};
export declare const parseResourceWithoutFragment: {
(str: string, associatedObjectForCache?: object): ParsedResourceWithoutFragment;
bindCache(associatedObjectForCache: object): (str: string) => ParsedResourceWithoutFragment;
};
export {};

8
node_modules/@rspack/core/dist/util/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type { LoaderObject } from "../loader-runner";
export declare function isNil(value: unknown): value is null | undefined;
export declare const toBuffer: (bufLike: string | Buffer | Uint8Array) => Buffer;
export declare const toObject: (input: string | Buffer | object) => object;
export declare function serializeObject(map: string | object | undefined | null): Buffer | undefined;
export declare function indent(str: string, prefix: string): string;
export declare function stringifyLoaderObject(o: LoaderObject): string;
export declare const unsupported: (name: string, issue?: string) => never;

2
node_modules/@rspack/core/dist/util/memoize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare const memoize: <T>(fn: () => T) => (() => T);
export declare const memoizeFn: <const T extends readonly unknown[], const P>(fn: () => (...args: T) => P) => (...args: T) => P;

2
node_modules/@rspack/core/dist/util/runtime.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export type RuntimeSpec = string | Set<string> | undefined;
export declare function toJsRuntimeSpec(runtime: RuntimeSpec): string | string[] | undefined;

21
node_modules/@rspack/core/dist/util/smartGrouping.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
type GroupOptions = {
groupChildren?: boolean | undefined;
force?: boolean | undefined;
targetGroupCount?: number | undefined;
};
export type GroupConfig<T, R = T> = {
getKeys: (arg0: any) => string[] | undefined;
createGroup: (key: string, arg1: (T | R)[], arg2: T[]) => R;
getOptions?: ((key: string, arg1: T[]) => GroupOptions) | undefined;
};
export declare const smartGrouping: <T, R>(items: T[], groupConfigs: GroupConfig<T, R>[]) => (T | R)[];
export {};

6
node_modules/@rspack/core/dist/util/source.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import type { JsSource } from "@rspack/binding";
import { type Source } from "../../compiled/webpack-sources";
export declare class SourceAdapter {
static fromBinding(source: JsSource): Source;
static toBinding(source: Source): JsSource;
}

View File

@@ -0,0 +1,5 @@
import type { Configuration } from "../config";
/**
* Performs configuration validation that cannot be covered by TypeScript types.
*/
export declare function validateRspackConfig(config: Configuration): void;