/// import type { IncomingMessage, Server, ServerResponse } from "node:http"; import { ContextConfigDefault, FastifyBaseLogger, FastifyInstance, FastifyReply, FastifyRequest, HTTPMethods, RawReplyDefaultExpression, RawRequestDefaultExpression } from "fastify"; import type { RouteGenericInterface } from "fastify/types/route"; import type { ResolveFastifyReplyType } from "fastify/types/type-provider"; import * as T from "fp-ts/lib/Task"; import * as TE from "fp-ts/lib/TaskEither"; import type { Redis } from "ioredis"; import type { ZodType } from "zod"; import type { Config } from "../../config"; import type { Telemetry } from "../telemetry"; import { ZodTypeProvider } from "./fastify-zod"; export interface HttpServer { readonly createRoute: ({ method, url, schema, handler, }: { readonly method: HTTPMethods | readonly HTTPMethods[]; readonly url: string; readonly schema: Schema; readonly handler: (request: FastifyRequest) => HandlerResult; }) => HttpServer; } interface Response { readonly status: number; readonly body: unknown; readonly headers?: Record; } declare type HandlerResult = TE.TaskEither | T.Task; export declare type FastifyServer = FastifyInstance; export declare type HttpRequest = FastifyRequest; export declare type HttpReply = FastifyReply>; export declare function createHttpServer({ config, redis, telemetry, }: { readonly config: Config; readonly redis: Redis; readonly telemetry: Telemetry; }): TE.TaskEither TE.TaskEither; httpServer: HttpServer; }>; interface Schema { readonly description?: string; readonly body?: unknown; readonly querystring?: unknown; readonly params?: unknown; readonly headers?: unknown; readonly response?: unknown; } export declare function makeFastifyFunctionalWrapper(fastify: FastifyServer): HttpServer; export {};