import type { Client } from '@libsql/client'; import type { ResolvedConfig } from './config.js'; /** * JSON response helper. * Do not use SvelteKit's json() — this runs inside the handle hook, not +server.ts. */ export declare function json(data: unknown, init?: ResponseInit): Response; interface RouteOptions { requireAuth?: boolean; } /** * Route definition for the Beacon API. */ interface Route { method: string; pattern: RegExp; paramNames: string[]; requireAuth: boolean; handler: (event: RequestEvent, db: Client, config: ResolvedConfig, params: Record) => Promise; } type RequestEvent = Parameters[0]['event']; /** * Register an API route. * * @example * route('GET', '/tasks', handleListTasks, { requireAuth: true }); * route('POST', '/feedback', handleCreateFeedback); */ export declare function route(method: string, path: string, handler: Route['handler'], options?: RouteOptions): void; /** * Dispatch an API request to the matching route handler. */ export declare function dispatch(event: RequestEvent, db: Client, config: ResolvedConfig): Promise; export {}; //# sourceMappingURL=router.d.ts.map