import { JSXInternal } from "preact/src/jsx"; import { ComponentChildren, h } from "preact"; import { Dispatch, SetStateAction } from "preact/compat"; import { Hanko, State, FlowError, LastLogin } from "@teamhanko/hanko-frontend-sdk"; import { Translations } from "../i18n/translations"; import SignalLike = JSXInternal.SignalLike; export type ComponentName = "auth" | "login" | "registration" | "profile" | "events"; export type HankoAuthMode = "registration" | "login"; export interface GlobalOptions { hanko?: Hanko; injectStyles?: boolean; enablePasskeys?: boolean; hidePasskeyButtonOnLogin?: boolean; translations?: Translations; translationsLocation?: string; fallbackLanguage?: string; storageKey?: string; } interface UIState { username?: string; email?: string; error?: FlowError; isDisabled?: boolean; } interface Context { hanko: Hanko; setHanko: Dispatch>; page: h.JSX.Element; setPage: Dispatch>; init: (compName: ComponentName) => void; componentName: ComponentName; setComponentName: Dispatch>; lang: string; hidePasskeyButtonOnLogin: boolean; prefilledEmail?: string; prefilledUsername?: string; uiState: UIState; setUIState: Dispatch>; initialComponentName: ComponentName; lastLogin?: LastLogin; isOwnFlow: (state: State) => boolean; } export declare const AppContext: import("preact").Context; interface Props { lang?: string | SignalLike; prefilledEmail?: string; prefilledUsername?: string; mode?: HankoAuthMode; nonce?: string; componentName: ComponentName; globalOptions: GlobalOptions; children?: ComponentChildren; createWebauthnAbortSignal: () => AbortSignal; } declare const AppProvider: ({ lang, prefilledEmail, prefilledUsername, globalOptions, createWebauthnAbortSignal, nonce, ...props }: Props) => JSXInternal.Element; export default AppProvider;