UNPKG

bknd

Version:

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

25 lines (24 loc) 1.07 kB
import type { Authenticator, StrategyAction, StrategyActionName, StrategyActions } from "../Authenticator"; import type { Hono } from "hono"; import type { Static, TSchema } from "@sinclair/typebox"; import { type TObject } from "../../../core/utils"; export type StrategyMode = "form" | "external"; export declare abstract class Strategy<Schema extends TSchema = TSchema> { protected config: Static<Schema>; type: string; name: string; mode: StrategyMode; protected actions: StrategyActions; constructor(config: Static<Schema>, type: string, name: string, mode: StrategyMode); protected registerAction<S extends TObject = TObject>(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: Static<Schema> | {} | undefined; }; getActions(): StrategyActions; }