import { QueryClient } from '@tanstack/react-query'; import { type AnyBunderstackApp, type BunderstackSyncClient } from '../sync/index.js'; export { createIsomorphicFetch } from './isomorphic-fetch.js'; export type BunderstackStartOptions = { /** API mount point. Defaults to '/api'. */ baseUrl?: string; /** Default query staleTime (ms). Defaults to 30_000. */ staleTime?: number; }; /** * One-call client setup for TanStack Start apps: SSR-aware fetch, sensible * QueryClient defaults, and a sync client whose tables and buckets are * inferred from the server app type. * * @example * // src/api.ts — NOT src/client.ts, which is a reserved TanStack Start * // entry-point name (it would replace the hydration entry). * import type { App } from './bunderstack' * export const { createQueryClient, createApi } = bunderstackStart() */ export declare function bunderstackStart(options?: BunderstackStartOptions): { createQueryClient: () => QueryClient; createApi: (queryClient: QueryClient) => BunderstackSyncClient; }; type StartRequestContext = { request: Request; }; type StartHandler = (ctx: StartRequestContext) => Promise; /** * Handlers object for the catch-all API file route. * * @example * // src/routes/api/$.tsx * export const Route = createFileRoute('/api/$')({ * server: { handlers: createApiHandlers(app) }, * }) */ export declare function createApiHandlers(app: { handler: (req: Request) => Promise; }): { GET: StartHandler; POST: StartHandler; PATCH: StartHandler; DELETE: StartHandler; }; export type SessionUser = { id: string; email: string; name: string; image?: string | null; role?: string; }; type SessionApp = { auth: { api: { getSession: (opts: { headers: Headers; }) => Promise<{ user: SessionUser | null; } | null>; }; }; }; /** Resolve the BetterAuth session user for an incoming request (server-side). */ export declare function getSessionUser(app: SessionApp, request: Request): Promise; //# sourceMappingURL=index.d.ts.map