moduleraid
Version:
Get modules from webpackJsonp
74 lines (73 loc) • 1.98 kB
TypeScript
/**
* Constructor parameters for the moduleRaid class
*/
export interface ModuleRaidParameters {
/**
* The Webpack entrypoint present on the global window object
*/
entrypoint?: string;
/**
* Option enabling or disabling debug output
*/
debug?: boolean;
/**
* Option enabling strict mode (only defined entrypoint) or entrypoint guessing
*/
strict?: boolean;
}
/**
* Function type describing any kind of possible function
*/
export declare type AnyFunction = (...args: unknown[]) => unknown;
/**
* Type describing the list of modules
*/
export declare type WebpackModuleList = {
[key in string | number | symbol]: WebpackCacheModule;
};
/**
* Return type for the `findConstructor` method
*/
export declare type ConstructorModuleTuple = [AnyFunction, WebpackModule];
/**
* Type describing possible arguments to `webpackJsonp`
* @internal
*/
export declare type WebpackArgument = [
[
number
] | [string] | [],
([WebpackModuleFunction] | {
[key in string | number]: WebpackModuleFunction;
} | [] | Record<string, unknown>),
([[number] | [string] | number] | WebpackModuleFunction)?
];
/**
* Type describing the __webpack_require__ function
* @internal
*/
export interface WebpackRequire {
c?: WebpackModuleList;
m?: AnyFunction[] | WebpackModuleList;
(key: string | number): WebpackCacheModule;
}
/**
* Type describing Webpack module constructors
* @internal
*/
export declare type WebpackModuleFunction = ((e: unknown, t: unknown, i: WebpackRequire) => void) | ((e: WebpackRequire) => void);
/**
* Type describing cached modules in Webpack
*/
export declare type WebpackCacheModule = {
i: string | number;
l: boolean;
exports: WebpackModule;
};
/**
* Type describing general modules
*/
export declare type WebpackModule = {
default?: any;
[key: string]: any;
};