import { PackageFilesResolver, RawDependency, RawDependencySource } from './package-files/resolver.js'; import type { PlaywrightConfig } from '../playwright-config.js'; import { Workspace } from './package-files/workspace.js'; type Module = { dependencies: Array; }; declare class RawDependencyCollector { #private; add(dependency: RawDependency): void; state(): RawDependency[]; } type ParserOptions = { supportedNpmModules?: Array; checkUnsupportedModules?: boolean; workspace?: Workspace; restricted?: boolean; }; export type VirtualFile = { filePath: string; physical: false; content: string; }; export type PhysicalFile = { filePath: string; physical: true; /** * Where the file goes in the archive. Defaults to filePath relative to the * bundle root. Only needed when the two differ, which happens when a file is * bundled at the path of a symlink that points at it. */ archivePath?: string; /** * When set, the entry is archived as a symlink pointing here rather than as a * copy of the file's contents. Relative to the entry's own archive directory. */ symlinkTarget?: string; /** * Marks a symlink entry that a bundled file's own path references depend on * (e.g. a Playwright config's testDir spelled through the link). If such a * link cannot make it into the archive, those references break at run time — * dropping it deserves a warning, not just a debug line. */ referencedLink?: true; }; export type File = VirtualFile | PhysicalFile; export declare class Parser { #private; supportedModules: Set; checkUnsupportedModules: boolean; workspace?: Workspace; resolver: PackageFilesResolver; restricted: boolean; constructor(options: ParserOptions); supportsModule(importPath: string): boolean; private validateEntrypoint; private readFile; private determineFileOps; getFilesAndDependencies(playwrightConfig: PlaywrightConfig): Promise<{ files: File[]; errors: string[]; }>; private parseFile; private parseFileContent; private resolveDependencies; parse(entrypoint: string): Promise<{ entrypoint: { filePath: string; content: string; }; dependencies: { filePath: string; content: string; }[]; }>; static parseDependencies(filePath: string, contents: string): { module: Module; error?: any; }; static jsNodeVisitor(dependencies: RawDependencyCollector): any; static tsNodeVisitor(tsParser: any, dependencies: RawDependencyCollector): any; static isRequireExpression(node: any): boolean; static getRequireStringArg(node: any): string | null; static registerDependency(importPath: string | null, source: RawDependencySource, dependencies: RawDependencyCollector): void; } export {};