import path from 'node:path'; /** What the frame filter needs to know about a call site. */ export interface Frame { fileName?: string | null; isConstructor: boolean; } export interface DeclaringFileOptions { /** The directory holding the CLI's own code. */ ownRoot: string; /** * The number of classes from `Construct` down to the class being * instantiated; each one contributes a constructor frame at the top of * the stack. */ constructorChainLength: number; /** * For tests only, so Windows frames can be exercised on other platforms. */ platformPath?: path.PlatformPath; } export declare function isInside(root: string, file: string, platformPath?: path.PlatformPath): boolean; /** * Picks the declaring file out of a list of stack frames, innermost first. * See the module description for the rules. */ export declare function declaringFileFromFrames(frames: Frame[], { ownRoot, constructorChainLength, platformPath }: DeclaringFileOptions): string | undefined; /** * The user file that declares the construct whose constructor is running, or * `undefined` when no user code is on the stack (the CLI or a test runner * created the construct) or the runtime does not expose structured stack * frames. * * `Error.prepareStackTrace` is replaced for the duration of a single * synchronous `new Error()` so V8 hands over call sites instead of a * formatted string, then restored; only file names and the constructor flag * are read, which no source map changes. * * @param constructorChainLength see {@link DeclaringFileOptions} */ export declare function captureDeclaringFile(constructorChainLength: number): string | undefined;