export declare function isValidClassName(n: string): boolean; export declare function isValidFieldName(n: string): boolean; /** PascalCase class name → camelCase instance name. */ export declare function camelInstance(className: string): string; /** Derive the PascalCase class name from a page file path ("a/b/LoginPage.page.ts" → "LoginPage"). */ export declare function classNameFromPagePath(filePath: string): string; /** * Validate + normalize an AI-supplied project-relative file path. Forward-slashes it, * strips a leading "./", and refuses absolute paths or "../" escapes (which would write * outside the project). Returns { ok:false, error } on rejection. */ export declare function normalizeRelPath(p: string): { ok: boolean; value: string; error?: string; }; /** ESM import specifier from one project-relative file to a page file (".ts" → ".js", leading "./"). */ export declare function importSpecifier(fromFile: string, toPageFile: string): string; /** A page object that opts INTO healing: @ScaffoldPage + bare @Find fields, no selectors in the .ts. */ export declare function pageTemplate(className: string, fields: string[]): string; /** The sibling .locators.json for a page — one EMPTY entry per @Find field (agent fills from live DOM). */ export declare function locatorsTemplate(fields: string[], platform?: string): string; export interface SpecPage { className: string; importPath: string; } export type ScaffoldPlatform = 'web' | 'android' | 'ios'; export interface SuiteSpec { suiteName: string; tests: string[]; pages?: SpecPage[]; appUrl?: string; /** Target platform — decides the clean-start before() shape (web browser vs mobile app relaunch). */ platform?: ScaffoldPlatform; } /** A spec: correct import + testSuite/testCase (never describe/it), with page imports wired by computed path. */ export declare function specTemplate({ suiteName, tests, pages, appUrl, platform }: SuiteSpec): string; export interface ScaffoldResult { ok: boolean; /** Error messages when ok=false. */ messages: string[]; /** Project-relative paths written when ok=true. */ created: string[]; /** Non-blocking warnings (e.g. imported pages that don't exist yet). */ warnings: string[]; /** Extra info for the response (class/suite name, fields, file path, appUrl…). */ meta: Record; } /** * Write a page object at the AI-chosen project-relative `file` (must end ".page.ts"), * plus the sibling .locators.json. The class name is derived from the filename. * Refuses to clobber unless overwrite. */ export declare function scaffoldPage(projectRoot: string, file: string, fields: string[], overwrite?: boolean, platform?: ScaffoldPlatform): ScaffoldResult; /** * Write a spec at the AI-chosen project-relative `file` (must end ".spec.ts"). `pages` * is a list of project-relative page-file paths to import — the import specifiers are * computed from the spec's own location, so pages and specs may live in any directories. * `name` is the human suite title (used only in testSuite("…"), NOT the filename). * Refuses to clobber unless overwrite. */ export declare function scaffoldSuite(projectRoot: string, file: string, name: string, tests: string[], pages?: string[], appUrl?: string, overwrite?: boolean, platform?: ScaffoldPlatform): ScaffoldResult;