import { StateName, Actions, Payloads } from "./state"; import { FlowError } from "./flowError"; import { State } from "../State"; type PickStates = TState; export type FlowName = "login" | "registration" | "profile" | "token_exchange"; export type AnyState = { [TState in StateName]: State; }[StateName]; export type AutoStep = (state: State) => Promise; export type AutoSteps = { [TState in PickStates<"preflight" | "login_passkey" | "onboarding_verify_passkey_attestation" | "webauthn_credential_verification" | "thirdparty" | "success" | "account_deleted">]: AutoStep; }; export type PasskeyAutofillActivationHandler = (state: State) => Promise; export type PasskeyAutofillActivationHandlers = { [TState in PickStates<"login_init">]: PasskeyAutofillActivationHandler; }; export interface FlowResponse { name: TState; status: number; payload?: Payloads[TState]; actions?: Actions[TState]; csrf_token: string; error?: FlowError; } export {};