UNPKG

grafserv

Version:

A highly optimized server for GraphQL, powered by Grafast

27 lines 1.41 kB
import type { Server as HTTPServer } from "node:http"; import type { Server as HTTPSServer } from "node:https"; import { GrafservBase } from "../../../core/base.js"; import type { GrafservBody, GrafservConfig, RequestDigest, Result } from "../../../interfaces.js"; import type { OptionsFromConfig } from "../../../options.js"; export declare function getBodyFromRequest(req: Request, maxLength: number): Promise<GrafservBody>; declare global { namespace Grafast { interface RequestContext { whatwgv0: { request: Request; }; } } } /** @experimental */ export declare class WhatwgGrafserv extends GrafservBase { protected whatwgRequestToGrafserv(dynamicOptions: OptionsFromConfig, request: Request): RequestDigest; protected processHeaders(headers: Headers): Record<string, string>; protected grafservResponseToWhatwg(response: Result | null): Response; createHandler(): import("@whatwg-node/server").ServerAdapter<{}, import("@whatwg-node/server").ServerAdapterBaseObject<{}, (request: Request) => Promise<Response>>>; addTo(server: HTTPServer | HTTPSServer): void; protected processWhatwgRequest(_request: Request, request: RequestDigest): import("grafast").PromiseOrDirect<Result | null>; } /** @experimental */ export declare function grafserv(config: GrafservConfig): WhatwgGrafserv; //# sourceMappingURL=index.d.ts.map