/** * Per-slot {@link AuthFlowState} builders (#469, stage 2). * * Each builder maps the values an OAuth flow ALREADY computes for its built-in * page (the same inputs fed to `renderLocalLoginPage` / `buildToolConsentPage` / * `buildFederatedLoginPage` / `buildIncrementalAuthPage`) into the stage-1 * contract shape, plus the server-owned `csrfToken`, `submitUrl`, `extraUrl`, * and accumulated `addedItems`. No PII is added — identity the user types is * carried by the developer's own form fields, never serialized here. * * @packageDocumentation */ import { type AuthFlowState, type AuthProvider, type AuthTool } from './auth-ui.contract'; /** Common server-owned fields every interactive slot needs. */ interface SlotCommon { pendingAuthId: string; /** The scope's `${fullPath}/oauth/callback` submit target. */ submitUrl: string; /** The `${fullPath}/oauth/ui/extra` endpoint for `@AuthExtra` submits. */ extraUrl: string; /** Minted CSRF token for this pending auth. */ csrfToken: string; /** Server-side accumulators for this pending auth (keyed by extra name). */ addedItems?: Record; } /** Build the `login` slot state. */ export declare function buildLoginState(common: SlotCommon, data: { clientId: string; clientName?: string; scopes: string[]; redirectUri: string; logoUri?: string; }): AuthFlowState; /** Build the `consent` slot state. */ export declare function buildConsentState(common: SlotCommon, data: { clientId: string; clientName?: string; tools: AuthTool[]; redirectUri?: string; }): AuthFlowState; /** Build the `federated` slot state. */ export declare function buildFederatedState(common: SlotCommon, data: { clientId: string; clientName?: string; providers: AuthProvider[]; redirectUri: string; }): AuthFlowState; /** Build the `incremental` slot state. */ export declare function buildIncrementalState(common: SlotCommon, data: { appId: string; appName: string; appDescription?: string; toolId?: string; redirectUri: string; }): AuthFlowState; /** Build the `error` slot state (may have no pending auth yet). */ export declare function buildErrorState(data: { error: string; pendingAuthId?: string; }): AuthFlowState; export {}; //# sourceMappingURL=auth-ui.state.d.ts.map