import { LoginFlowError, type AuthInteraction, type LoginFlowConsumer } from './login-flow.js'; import { type PiRuntimeLoadResult } from './pi-runtime.js'; export type PiOAuthLoginErrorCode = 'runtime_unavailable' | 'provider_not_found' | 'oauth_unsupported' | 'login_failed'; export interface PiOAuthLoginError { code: PiOAuthLoginErrorCode; message: string; } export type PiOAuthLoginResult = { ok: true; provider: string; authType: 'oauth'; expiresAt: string | null; } | { ok: false; provider: string; authType: 'oauth'; error: PiOAuthLoginError; }; type PiOAuthLoginFailure = Extract; export interface PiOAuthLoginDependencies { loadRuntime?: () => Promise; refreshProviders?: () => void; publishRecovered?: (input: { backend: 'pi'; provider: string; }) => void; } export declare class PiOAuthLoginFlowError extends LoginFlowError { readonly result: PiOAuthLoginFailure; constructor(result: PiOAuthLoginFailure); } export declare function loginPiOAuth(providerId: string, interaction: AuthInteraction, dependencies?: PiOAuthLoginDependencies): Promise; export declare function createPiOAuthLoginConsumer(providerId: string, dependencies?: PiOAuthLoginDependencies): LoginFlowConsumer; export {};