UNPKG

next

Version:

The React Framework

30 lines (29 loc) 866 B
import type { NextConfigComplete } from '../config-shared'; import type { IncomingMessage, ServerResponse } from 'http'; import '../require-hook'; import '../node-polyfill-fetch'; type RouteResult = { type: 'rewrite'; url: string; statusCode: number; headers: Record<string, undefined | number | string | string[]>; } | { type: 'error'; error: { name: string; message: string; stack: any[]; }; } | { type: 'none'; }; type MiddlewareConfig = { matcher: string[] | null; files: string[]; }; type ServerAddress = { hostname?: string; port?: number; }; export declare function makeResolver(dir: string, nextConfig: NextConfigComplete, middleware: MiddlewareConfig, serverAddr: Partial<ServerAddress>): Promise<(req: IncomingMessage, res: ServerResponse) => Promise<RouteResult | void>>; export {};