bknd
Version:
Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
29 lines (28 loc) • 1.57 kB
TypeScript
import { App, type CreateAppConfig } from "..";
import type { MiddlewareHandler } from "hono";
import type { AdminControllerOptions } from "../modules/server/AdminController";
export type BkndConfig<Args = any> = CreateAppConfig & {
app?: CreateAppConfig | ((args: Args) => CreateAppConfig);
onBuilt?: (app: App) => Promise<void>;
beforeBuild?: (app: App) => Promise<void>;
buildConfig?: Parameters<App["build"]>[0];
};
export type FrameworkBkndConfig<Args = any> = BkndConfig<Args>;
export type CreateAdapterAppOptions = {
force?: boolean;
id?: string;
};
export type FrameworkOptions = CreateAdapterAppOptions;
export type RuntimeOptions = CreateAdapterAppOptions;
export type RuntimeBkndConfig<Args = any> = BkndConfig<Args> & {
distPath?: string;
serveStatic?: MiddlewareHandler | [string, MiddlewareHandler];
adminOptions?: AdminControllerOptions | false;
};
export type DefaultArgs = {
[key: string]: any;
};
export declare function makeConfig<Args = DefaultArgs>(config: BkndConfig<Args>, args?: Args): CreateAppConfig;
export declare function createAdapterApp<Config extends BkndConfig = BkndConfig, Args = DefaultArgs>(config?: Config, args?: Args, opts?: CreateAdapterAppOptions): Promise<App>;
export declare function createFrameworkApp<Args = DefaultArgs>(config?: FrameworkBkndConfig, args?: Args, opts?: FrameworkOptions): Promise<App>;
export declare function createRuntimeApp<Args = DefaultArgs>({ serveStatic, adminOptions, ...config }?: RuntimeBkndConfig<Args>, args?: Args, opts?: RuntimeOptions): Promise<App>;