import { type HttpRouter as ConvexHttpRouter } from "convex/server"; import type * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import type * as Path from "effect/Path"; import type * as Etag from "effect/http/Etag"; import type * as HttpPlatform from "effect/http/HttpPlatform"; import * as HttpRouter from "effect/http/HttpRouter"; import type * as ActionRunner from "./ActionRunner"; import type * as Auth from "./Auth"; import type { ExecutionMetadata } from "./ExecutionMetadata"; import type { RequestMetadata } from "./RequestMetadata"; import type * as MutationRunner from "./MutationRunner"; import type * as QueryRunner from "./QueryRunner"; import type * as Scheduler from "./Scheduler"; import type { Storage } from "./Storage"; import type { StorageActionWriter } from "./StorageActionWriter"; import type { StorageReader } from "./StorageReader"; import type { StorageWriter } from "./StorageWriter"; /** * The Confect services available to HTTP route handlers and middleware, * supplied per request from the Convex action context. */ export type Services = QueryRunner.QueryRunner | MutationRunner.MutationRunner | ActionRunner.ActionRunner | Scheduler.Scheduler | Auth.Auth | ExecutionMetadata | RequestMetadata | Storage | StorageReader | StorageWriter | StorageActionWriter; /** * A layer that registers routes on the HTTP router—the input to {@link make}. * * Compose it from Effect's `effect/http` and `effect/http-api` modules: * `HttpApiBuilder.layer(api)` registers an `HttpApi`'s endpoints (provide its * group handler layers with `Layer.provide`), `HttpApiScalar.layer(api, ...)` * serves interactive API docs, `HttpRouter.add` registers a plain route, and * `HttpRouter.middleware(fn, { global: true })` applies middleware to every * route. Merge any number of these with `Layer.mergeAll`. * * Route handlers and middleware may require any of the Confect {@link Services}, * which surface as request-level `Requires` markers and are supplied per * request. Anything else the layer requires is a type error—notably, an * `HttpApiBuilder.layer(api)` whose group handler layers are not provided * leaves an `HttpApiGroup.ToService` requirement behind, so a missing handler * group is caught at compile time. * * Layers are built with Confect's Convex-aware `ConfigProvider` in context, so * `Config` reads (e.g. in `Layer.unwrap`) resolve against Convex environment * variables. */ export type Routes = Layer.Layer | HttpRouter.Request<"GlobalRequires", Services> | HttpRouter.Request<"Error", any> | HttpRouter.Request<"GlobalError", any>>; /** * Create a Convex HTTP router serving the given routes. * * A single catch-all `httpAction` is registered for every routable method under * the path prefix `"/"`, making the Effect router the single source of truth * for paths: place an API with `HttpApi.prefix` or absolute route paths. * Requests that match no route receive the Effect router's 404 response. * * Plain Convex routes can still be added to the returned router—Convex matches * exact paths first and longer path prefixes before the catch-all, so they take * precedence. */ export declare const make: (routes: Routes) => ConvexHttpRouter; //# sourceMappingURL=HttpRouter.d.ts.map