export type ObjectExports = Record; export type ModuleExports = ObjectExports | ((...args: unknown[]) => unknown) | string | boolean | symbol; export interface RawModule { id: number; loaded: boolean; exports: T; } export type WebpackRawModules = Record; export type WebpackRequire = ((e: number | string) => unknown) & { c?: WebpackRawModules; d: (module: unknown, exports: Record unknown>) => void; m: WebpackChunk[1]; }; export type WebpackModule = (wpModule: RawModule, wpExports: typeof wpModule.exports, wpRequire: WebpackRequire) => void; export type WebpackChunk = [ Array, Record, ((r: WebpackRequire) => unknown)? ]; export type WebpackChunkGlobal = { push(chunk: WebpackChunk): unknown; } & WebpackChunk[]; export type Filter = (module: RawModule) => boolean | ModuleExports; export type LazyCallback = (module: T) => void; export type LazyListener = [Filter, LazyCallback>]; export interface RegexReplacement { match: RegExp | string; replace: string | ((substring: string, ...args: unknown[]) => string); } export type PlaintextReplacer = (source: string) => string; export interface PlaintextPatch { find?: string | RegExp; check?: (source: string) => boolean; warn?: boolean; replacements: Array; } export interface RawPlaintextPatch { find?: string | RegExp; id: string; check?: (source: string) => boolean; warn?: boolean; replacements: Array; } export interface GetModuleOptions { /** Return all matches instead of just the first */ all?: boolean; /** Return the raw module instead of the exports */ raw?: boolean; } export interface WaitForOptions { /** Return the raw module instead of the exports */ raw?: boolean; /** If nothing is found after this delay (ms), stop and throw an error. */ timeout?: number; } export type AbstractConstructor = abstract new (args: unknown[]) => T;