///
import type { __ApiPreviewProps } from '../api-utils';
import type { CustomRoutes } from '../../lib/load-custom-routes';
import type { FindComponentsResult } from '../next-server';
import type { LoadComponentsReturnType } from '../load-components';
import type { Options as ServerOptions } from '../next-server';
import type { Params } from '../../shared/lib/router/utils/route-matcher';
import type { ParsedUrl } from '../../shared/lib/router/utils/parse-url';
import type { ParsedUrlQuery } from 'querystring';
import type { Server as HTTPServer } from 'http';
import type { UrlWithParsedQuery } from 'url';
import type { BaseNextRequest, BaseNextResponse } from '../base-http';
import type { RoutingItem } from '../base-server';
import Server from '../next-server';
import { NodeNextResponse, NodeNextRequest } from '../base-http/node';
export interface Options extends ServerOptions {
/**
* The HTTP Server that Next.js is running behind
*/
httpServer?: HTTPServer;
/**
* Tells of Next.js is running from the `next dev` command
*/
isNextDevCommand?: boolean;
}
export default class DevServer extends Server {
private devReady;
private setDevReady?;
private webpackWatcher?;
private hotReloader?;
private isCustomServer;
protected sortedRoutes?: string[];
private addedUpgradeListener;
private pagesDir;
private appDir?;
private actualMiddlewareFile?;
private middleware?;
private edgeFunctions?;
protected staticPathsWorker?: {
[key: string]: any;
} & {
loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths;
};
private getStaticPathsWorker;
constructor(options: Options);
protected getBuildId(): string;
addExportPathMapRoutes(): Promise;
startWatcher(): Promise;
stopWatcher(): Promise;
prepare(): Promise;
protected close(): Promise;
protected hasPage(pathname: string): Promise;
protected _beforeCatchAllRender(req: BaseNextRequest, res: BaseNextResponse, params: Params, parsedUrl: UrlWithParsedQuery): Promise;
private setupWebSocketHandler;
runMiddleware(params: {
request: BaseNextRequest;
response: BaseNextResponse;
parsedUrl: ParsedUrl;
parsed: UrlWithParsedQuery;
}): Promise;
runEdgeFunction(params: {
req: BaseNextRequest;
res: BaseNextResponse;
query: ParsedUrlQuery;
params: Params | undefined;
page: string;
}): Promise;
run(req: NodeNextRequest, res: NodeNextResponse, parsedUrl: UrlWithParsedQuery): Promise;
private logErrorWithOriginalStack;
protected getCustomRoutes(): CustomRoutes;
private _devCachedPreviewProps;
protected getPreviewProps(): __ApiPreviewProps;
protected getPagesManifest(): undefined;
protected getAppPathsManifest(): undefined;
protected getMiddleware(): RoutingItem | undefined;
protected getEdgeFunctions(): RoutingItem[];
protected getServerComponentManifest(): undefined;
protected hasMiddleware(): Promise;
protected ensureMiddleware(): Promise;
protected ensureEdgeFunction(pathname: string): Promise;
generateRoutes(): {
headers: import("../router").Route[];
rewrites: {
beforeFiles: import("../router").Route[];
afterFiles: import("../router").Route[];
fallback: import("../router").Route[];
};
redirects: import("../router").Route[];
catchAllRoute: import("../router").Route;
catchAllMiddleware: import("../router").Route[];
pageChecker: import("../router").PageChecker;
useFileSystemPublicRoutes: boolean;
dynamicRoutes: import("../router").DynamicRoutes | undefined;
nextConfig: import("../config-shared").NextConfig;
fsRoutes: import("../router").Route[];
};
protected generatePublicRoutes(): never[];
protected getDynamicRoutes(): never[];
_filterAmpDevelopmentScript(html: string, event: {
line: number;
col: number;
code: string;
}): boolean;
protected getStaticPaths(pathname: string): Promise<{
staticPaths: string[] | undefined;
fallbackMode: false | 'static' | 'blocking';
}>;
protected ensureApiPage(pathname: string): Promise;
protected findPageComponents(pathname: string, query?: ParsedUrlQuery, params?: Params | null, isAppDir?: boolean): Promise;
protected getFallbackErrorComponents(): Promise;
protected setImmutableAssetCacheControl(res: BaseNextResponse): void;
private servePublic;
hasPublicFile(path: string): Promise;
getCompilationError(page: string): Promise;
protected isServeableUrl(untrustedFileUrl: string): boolean;
}