import http from 'http'; import https from 'https'; import http2 from 'http2'; import { Socket } from 'net'; import { type MiddlewareAsync, MiddlewareCompositeWithPriorityAsync, type MiddlewarePromise, type MiddlewareResult, Router2Async, type RouterOptions } from '@akala/core'; import type { Request, Response } from './shared.js'; export declare class HttpRouter extends Router2Async { private readonly upgradeRouter; readonly formatters: MiddlewareCompositeWithPriorityAsync<[Request, Response, unknown], "break">; constructor(options?: RouterOptions); registerJsonFormatter(priority?: number): void; registerErrorFormatter(priority?: number): void; attachTo(server: http.Server | https.Server | http2.Http2Server | http2.Http2SecureServer): void; handle(req: Request, res: Response): Promise>; static extendResponse(res: T & Partial): Response & T; static extendRequest(msg: http.IncomingMessage): Request; formatError(req: Request, res: Response, result: MiddlewareResult): MiddlewarePromise; format(req: Request, res: Response, result: unknown): MiddlewarePromise; upgrade(path: string, upgradeSupport: string, handler: ((request: Request, socket: Socket, head: Buffer) => Promise)): this; } export interface HttpRouter { 'checkoutMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'connectMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'copyMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'deleteMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'getMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'headMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'lockMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'm-searchMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'mergeMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'mkactivityMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'mkcalendarMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'mkcolMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'moveMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'notifyMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'optionsMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'patchMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'postMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'propMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'findMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'proppatchMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'purgeMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'putMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'reportMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'searchMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'subscribeMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'traceMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'unlockMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'unsubscribeMiddleware'(path: string, ...middlewares: MiddlewareAsync<[Request, Response]>[]): this; 'checkout'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'connect'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'copy'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'delete'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'get'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'head'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'lock'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'm-search'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'merge'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'mkactivity'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'mkcalendar'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'mkcol'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'move'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'notify'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'options'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'patch'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'post'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'prop'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'find'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'proppatch'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'purge'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'put'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'report'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'search'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'subscribe'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'trace'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'unlock'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; 'unsubscribe'(path: string, ...handlers: ((...args: [Request, Response]) => Promise)[]): this; }