export declare const HTTP_METHODS: ("GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH" | "TRACE")[]; export type HTTPMethod = (typeof HTTP_METHODS)[number]; /** * The BetterRequest object is an extension of the native [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) * interface, with better typing and extended functionality such as mutable properties * though maybe we should allow for immutable requests? */ export type BetterRequest = Omit & { readonly method: HTTPMethod; json: () => Promise; }; /** * The BetterResponse object is an extension of the native [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) * interface, with better typing and extended functionality. */ export type BetterResponse = Omit & { json: () => Promise; }; /** Heavily inspired by trpc and Apollo GraphQL */ export type Link = (req: BetterRequest, next: (req: BetterRequest | Request) => Promise) => Promise; export declare function applyLinks(req: BetterRequest | Request, links: Link[]): Promise; /** Compose multiple links into a single link */ export declare function composeLinks(...links: Link[]): Link; export declare function composeLinksToHandler(...links: Link[]): (req: Request) => Promise; //# sourceMappingURL=link.d.ts.map