///
import vm from 'vm';
export declare type ContextifyOptions = {
contextModuleName?: string;
persistentCache?: object;
allowSourcemaps?: boolean;
buildByExtension?: Record string> | null;
mock?: ((params: {
moduleName: string;
filename: string;
payload: object;
}) => any) | null;
getFileContents?: ((filename: string) => string) | null;
resolveModule?: ((path: string, currentDirname: string) => string | null) | null;
};
declare type PrepareRequireArgs = {
currentDirname: string;
transitiveCache?: object;
payload: object;
sandbox?: object | vm.Context | true;
vmContext?: vm.Context | null;
};
export declare class Contextify {
allBranches: Set;
persistentCache: Record;
filePathCache: any;
buildByExtension: ContextifyOptions['buildByExtension'];
allowSourcemaps: boolean;
mock: ((params: {
moduleName: string;
filename: string;
payload: object;
}) => any) | null;
contextModuleName: string;
getFileContents: (filename: string) => any;
resolveModule: (path: string, currentDirname: string) => string;
constructor(options: ContextifyOptions);
prepareRequire: (config: PrepareRequireArgs) => (moduleName: string) => any;
_readFileWrapped: (filename: string) => any;
_findNodeModulePath: (path: string, currentDirname: string) => string;
diskFilesCache: any;
_readFileFromDisk: (filename: string) => any;
static prepareContext(sandbox: object): vm.Context;
}
export {};