UNPKG

bknd

Version:

Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.

24 lines (23 loc) 1.02 kB
import type { Authenticator, StrategyAction, StrategyActionName, StrategyActions } from "../Authenticator"; import type { Hono } from "hono"; import { type s } from "bknd/utils"; export type StrategyMode = "form" | "external"; export declare abstract class AuthStrategy<Schema extends s.Schema = s.Schema> { protected config: s.Static<Schema>; type: string; name: string; mode: StrategyMode; protected actions: StrategyActions; constructor(config: s.Static<Schema>, type: string, name: string, mode: StrategyMode); protected registerAction<S extends s.ObjectSchema = s.ObjectSchema>(name: StrategyActionName, schema: S, preprocess: StrategyAction<S>["preprocess"]): void; protected abstract getSchema(): Schema; abstract getController(auth: Authenticator): Hono; getType(): string; getMode(): StrategyMode; getName(): string; toJSON(secrets?: boolean): { type: string; config: s.Static<Schema> | {} | undefined; }; getActions(): StrategyActions; }