import type { Page } from 'playwright'; import type { LivewireComponents } from '../browser.js'; export type LivewireComponentName = keyof LivewireComponents & string; export declare const livewireComponentBrand: unique symbol; export type LivewireRouteUrl = string & { readonly [livewireComponentBrand]: C; }; export type LivewirePage = Page & { readonly [livewireComponentBrand]?: C; }; export type LivewireContract = C extends LivewireComponentName ? LivewireComponents[C] : { props: Record; methods: Record; events: Record; }; export interface LivewireComponentBrowser { readonly [livewireComponentBrand]?: C; readonly id: string; readonly name: C; call['methods'] & string>(method: M, ...args: LivewireContract['methods'][M] extends readonly unknown[] ? LivewireContract['methods'][M] : never): Promise; set

['props'] & string>(property: P, value: LivewireContract['props'][P]): Promise; dispatch['events'] & string>(event: E, payload: LivewireContract['events'][E]): Promise; refresh(): Promise; get

['props'] & string>(property: P): Promise['props'][P]>; assertSet

['props'] & string>(property: P, value: LivewireContract['props'][P]): Promise; assertNotSet

['props'] & string>(property: P, value: LivewireContract['props'][P]): Promise; assertSee(value: string): Promise; assertDontSee(value: string): Promise; assertDispatched['events'] & string>(event: E, payload?: LivewireContract['events'][E]): Promise; assertHasError(key?: string): Promise; assertNoErrors(): Promise; assertLoading(): Promise; assertNotLoading(): Promise; } declare module 'playwright' { interface Page { livewire(): Promise>; livewire(name: C, options?: { id?: string; }): Promise>; } }