import { Appearance } from '../../../components/auth/theme/appearance.js'; import { ThemeLocalization } from '../../../compat/better-auth/plugins.js'; /** * Hook shape compatible with `next-themes`' `useTheme` and similar APIs. The * hook is invoked inside the plugin factory so consumers can register the * plugin in the same component as their `` without an extra * inner component. */ export type UseThemeHook = () => { theme?: string; setTheme: (theme: string) => void; themes?: string[]; }; interface CommonThemeOptions { /** * Override the plugin's default localization strings. * @remarks `ThemeLocalization` */ localization?: Partial; /** * Available theme options. * @default ["system", "light", "dark"] */ themes?: ["system", "light", "dark"]; } export type ThemePluginOptions = CommonThemeOptions & ({ /** * A theme hook (e.g. next-themes' `useTheme`) called inside the * plugin's slot components on every render. The hook owns the live * theme value, so `theme`/`setTheme` are not accepted in this form. */ useTheme: UseThemeHook; theme?: never; setTheme?: never; } | { /** * Current theme value. Required when not using a hook so slot * components can highlight the active option. Pass it from a * stateful source (e.g. `useState`, Context) so updates flow * through `` and re-render slot components. */ theme: string; /** Setter that updates the value `theme` is read from. */ setTheme: (theme: string) => void; useTheme?: never; }); export declare const themePlugin: ((args_0: ThemePluginOptions) => { accountCards: (typeof Appearance)[]; useTheme: UseThemeHook; localization: { appearance: string; theme: string; system: string; light: string; dark: string; }; theme: string; setTheme: (theme: string) => void; themes: string[]; id: "theme"; } & { id: "theme"; }) & { id: "theme"; }; export {};