export interface AppflowToken {
    access_token: string;
    refresh_token?: string;
    expires_in: number;
    id_token?: string;
    capturedAtMs: number;
}
export declare function pkce(): {
    verifier: string;
    challenge: string;
};
export declare function buildAuthorizeUrl(challenge: string, state: string, nonce: string): string;
export declare function isExpired(t: Pick<AppflowToken, 'expires_in' | 'capturedAtMs'>, marginMs?: number): boolean;
export declare function sanitizeOauthError(raw: string | null | undefined): string;
export declare function loginWithBrowser(opts?: {
    openBrowser?: (url: string) => void;
    signal?: AbortSignal;
}): Promise<AppflowToken>;
export declare function refresh(token: AppflowToken): Promise<AppflowToken>;
