import type { PluginFn } from '@japa/runner/types'; import type { ApplicationService } from '@adonisjs/core/types'; import type { Authenticators, GuardContract, GuardFactory } from '../../types.ts'; declare module 'playwright' { interface BrowserContext { /** * Login a user using the default authentication guard when * using the browser context to make page visits */ loginAs(...args: { [K in keyof Authenticators]: Authenticators[K] extends GuardFactory ? ReturnType extends GuardContract ? Parameters['authenticateAsClient']> : never : never; }[keyof Authenticators]): Promise; /** * Define the authentication guard for login */ withGuard(guard: K): { /** * Login a user using a specific auth guard */ loginAs(...args: ReturnType extends GuardContract ? Parameters['authenticateAsClient']> : never): Promise; }; } } /** * Browser API client to authenticate users when making * HTTP requests using the Japa Browser client. * * @param app - The AdonisJS application service instance * * @example * import { authBrowserClient } from '@adonisjs/auth/plugins/japa/browser_client' * * export const plugins: PluginFn[] = [ * authBrowserClient(app) * ] */ export declare const authBrowserClient: (app: ApplicationService) => PluginFn;