import { TokenPayload } from "./token.js"; export interface Session { created_at: number; created_with: string[]; expires_at: number; idle_timeout: number; token: string; token_payload: TokenPayload; suggest_passkeys: boolean; } /** * Create a session and replace the current one if exists. * @param token the access token generated by email or passkey authentication methods. * @param lifetime the session maximum duration in second. By default 24h. * @param idleTimeout the session inactivity timeout. * @returns the session object. * @throws {AbortError} when the authentication flow has been canceled (using signal) * @throws {UnexpectedError} when an unexpected error occured * @throws {MissingTokenError} if the token is not defined * @throws {NetworkError} when a connection error occured * @throws {InvalidTokenError} when the access token is malformed or expired */ export declare const create: (token: string, lifetime?: number, idleTimeout?: number) => Promise; export declare const get: () => Promise; export declare const revoke: () => Promise; export type SessionStateListener = (session: Session | null | undefined) => void; export declare const addSessionStateChanged: (listener: SessionStateListener) => Promise; export declare const removeSessionStateChanged: (listener: SessionStateListener) => void;