export type WebAppSessionFetch = (input: string, init?: { method?: string; headers?: Record; body?: string; }) => Promise; export interface WebAppSessionExchangeParams { urlId: string; sessionBaseUrl: string; code?: string; refreshToken?: string; fetch?: WebAppSessionFetch; } export interface WebAppSession { token: string; refreshToken: string; expiresIn: number; expiresAt: string; deadlineMs: number; sessionDeadlineMs: number; } export declare class WebAppSessionError extends Error { readonly status?: number; readonly terminal: boolean; constructor(message: string, status?: number, terminal?: boolean); } export declare const exchangeWebAppSession: (params: WebAppSessionExchangeParams) => Promise; export declare const readWebSessionCodeFromLocation: () => string | undefined; export interface WebAppBoot { urlId: string; phyhubUrl: string; sessionBaseUrl: string; } export declare const loadWebAppBoot: (fetchImpl?: WebAppSessionFetch) => Promise; export declare const clearWebSessionCodeFromLocation: () => void; export declare const WEB_SESSION_STORAGE_KEY_PREFIX = "phystack:web-session:"; export declare const STORED_WEB_SESSION_VERSION = 1; export interface StoredWebSession { v: number; refreshToken: string; sessionDeadlineMs: number; urlId: string; savedAt: number; } export interface WebSessionStorageLike { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } export declare const readStoredWebSession: (urlId: string, storage?: WebSessionStorageLike | null) => StoredWebSession | null; export declare const writeStoredWebSession: (record: StoredWebSession, storage?: WebSessionStorageLike | null) => boolean; export declare const clearStoredWebSession: (urlId: string, storage?: WebSessionStorageLike | null) => void; //# sourceMappingURL=web-app-session.service.d.ts.map