import type { BindOcrScreenOptions } from './screen.js'; import type { ScreenResult } from './screen-result.js'; import type { ScreenElement } from './element.js'; type ScreenKey; }>, S extends T[keyof T]['name']> = { [K in keyof T]: T[K]['name'] extends S ? K : never; }[keyof T]; type CatalogElementName; }>, S extends T[keyof T]['name']> = keyof T[ScreenKey]['elements'] & string; export type TypedResult; }>, S extends T[keyof T]['name']> = Pick & { element(name: CatalogElementName): ScreenElement; }; /** * Create a typed screen() function bound to a generated.ts catalog. * Call once with your imported `screens` const; the returned function * replaces the untyped `screen()` import for compile-time element-name checking. * * import { createScreen } from '@rickcedwhat/playwright-smart-vision'; * import { screens } from '../helpers/screens.generated'; * * const screen = createScreen(screens); * * // In a test (after await init(...)): * const customerInfo = screen('customer-info'); * await customerInfo.element('customerNumber').toHaveValue('SEA314535'); * // TypeScript error: customerInfo.element('typo') ← won't compile */ export declare function createScreen; }>>(_catalog: T): (name: S, options?: BindOcrScreenOptions) => TypedResult; export {}; //# sourceMappingURL=screen-api.d.ts.map