mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
37 lines
852 B
TypeScript
37 lines
852 B
TypeScript
import type { App, CreateAppConfig } from "bknd";
|
|
|
|
export type CfBkndModeCache<Env = any> = (env: Env) => {
|
|
cache: KVNamespace;
|
|
key: string;
|
|
};
|
|
|
|
export type CfBkndModeDurableObject<Env = any> = (env: Env) => {
|
|
durableObject: DurableObjectNamespace;
|
|
key: string;
|
|
keepAliveSeconds?: number;
|
|
};
|
|
|
|
export type CloudflareBkndConfig<Env = any> = {
|
|
mode?: CfBkndModeCache | CfBkndModeDurableObject;
|
|
forceHttps?: boolean;
|
|
};
|
|
|
|
export type BkndConfig<Env = any> = {
|
|
app: CreateAppConfig | ((env: Env) => CreateAppConfig);
|
|
setAdminHtml?: boolean;
|
|
server?: {
|
|
port?: number;
|
|
platform?: "node" | "bun";
|
|
};
|
|
cloudflare?: CloudflareBkndConfig<Env>;
|
|
onBuilt?: (app: App) => Promise<void>;
|
|
};
|
|
|
|
export type BkndConfigJson = {
|
|
app: CreateAppConfig;
|
|
setAdminHtml?: boolean;
|
|
server?: {
|
|
port?: number;
|
|
};
|
|
};
|