import { t as GetAuth } from "../../types-CM67ko7K.js"; import { HttpRouter } from "convex/server"; import { MiddlewareHandler } from "hono"; //#region src/auth/middleware.d.ts interface AuthMiddlewareOptions { /** Base path for auth routes (default: '/api/auth') */ basePath?: string; /** Log request/response headers for debugging */ verbose?: boolean; } /** * Create auth middleware that handles auth routes and OpenID well-known redirect. * * @example * ```ts * import { Hono } from 'hono'; * import { cors } from 'hono/cors'; * import { authMiddleware } from 'better-convex/auth/http'; * import { createHttpRouter } from 'better-convex/server'; * * const app = new Hono(); * app.use('/api/*', cors({ origin: process.env.SITE_URL, credentials: true })); * app.use(authMiddleware(getAuth)); * * export default createHttpRouter(app, httpRouter); * ``` */ declare function authMiddleware(getAuth: GetAuth Promise; }>, opts?: AuthMiddlewareOptions): MiddlewareHandler; //#endregion //#region src/auth/registerRoutes.d.ts type TrustedOriginsOption = (string | null | undefined)[] | ((request?: Request) => (string | null | undefined)[] | Promise<(string | null | undefined)[]>); type AuthRouteContract = { $context: Promise<{ options: { trustedOrigins?: TrustedOriginsOption; }; }>; handler: (request: Request) => Promise; options: { basePath?: string; baseURL?: string; trustedOrigins?: TrustedOriginsOption; }; }; declare const registerRoutes: (http: HttpRouter, getAuth: GetAuth, opts?: { cors?: { allowedHeaders?: string[]; allowedOrigins?: string[]; exposedHeaders?: string[]; } | boolean; verbose?: boolean; }) => void; //#endregion //#region src/auth-http/index.d.ts /** * Install Convex-safe polyfills required by Better Auth's HTTP handling. * This runs automatically when importing `better-convex/auth/http`. */ declare function installAuthHttpPolyfills(): void; //#endregion export { authMiddleware, installAuthHttpPolyfills, registerRoutes };