import type { Page } from "playwright";
import type { Persona } from "../types/index.js";
export declare function isSessionCookie(cookieName: string): boolean;
export declare function isPrimarySessionCookie(cookieName: string): boolean;
export interface LoginResult {
    success: boolean;
    method: "cookies" | "login" | "none";
    error?: string;
}
export declare function hasFreshAuthCookies(persona: Persona): boolean;
/**
 * Perform login using a raw AuthConfig (e.g. from scenario.authConfig or an auth preset).
 * Resolves credentials via resolveCredential() supporting @secrets: and $ENV references.
 */
export declare function loginWithAuthConfig(page: Page, config: {
    email?: string;
    password?: string;
    loginPath?: string;
    token?: string;
    tokenHeader?: string;
}, baseUrl: string): Promise<LoginResult>;
/**
 * Ensures a persona is authenticated before a scenario runs. Flow:
 * 1. If the persona has no auth credentials → skip (return none).
 * 2. If saved cookies exist and are fresh → restore them (fast path).
 * 3. Otherwise → perform full login, then save resulting cookies.
 *
 * @param page     The Playwright page to authenticate.
 * @param persona  The persona (must have auth set).
 * @param baseUrl  Base URL of the app under test.
 */
export declare function ensurePersonaAuthenticated(page: Page, persona: Persona, baseUrl: string): Promise<LoginResult>;
//# sourceMappingURL=persona-auth.d.ts.map