import { Program as ASTProgram } from "meriyah/dist/types/estree"; import rewire from "rewire"; //#region src/types.d.ts interface Symbols { functions: string[]; variables: string[]; classes: string[]; } interface HiddenExportInfo { symbols: Symbols; ast: ASTProgram; code: string; } type CloneFn = (object: T) => T; interface Options { basePath?: string; objectClone?: CloneFn; } interface JewireEntities { __jewireContext__: { rewire: ReturnType; hiddenExportInfo: HiddenExportInfo; jewireGetter: (name: string) => any; }; [key: string]: any; } //#endregion //#region src/jewire.d.ts /** * Leverages rewire to extract hidden exports from a JavaScript module, but * allowing named exports in the same style as require. * Returned objects and arrays are also deep-cloned such that they can be * tested with .toStrictEqual() in Jest, although introduces limitations * * @param {string} relativePath - the name or path of the module, e.g. ./arrays * @param {Options} [options] - options for jewire as defined in types.ts * @returns {JewireEntities} - Named exports from the file */ declare const jewire: (relativePath: string, options?: Options) => JewireEntities; //#endregion export { type CloneFn, type HiddenExportInfo, type Options, jewire as default }; //# sourceMappingURL=index.d.cts.map