fuc-new/doc/node_modules/@vuepress/helper/lib/node/bundler/customizeDevServer.d.ts
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

30 lines
930 B
TypeScript

import type { IncomingMessage, ServerResponse } from 'node:http';
import type { App } from 'vuepress/core';
/**
* Options for customizing VuePress Dev Server
*/
export interface DevServerOptions {
/**
* Path to be responded
*/
path: string;
/**
* Respond handler
*/
response: (request: IncomingMessage, response: ServerResponse) => Promise<Buffer | string>;
/**
* error msg
*/
errMsg?: string;
}
/**
* Handle specific path when running VuePress Dev Server
*
* 在运行 VuePress 开发服务器时处理特定路径
*
* @param bundlerOptions - VuePress Bundler config / VuePress 打包器配置
* @param app - VuePress Node App / VuePress Node 应用
* @param options - Dev server options / 开发服务器选项
*/
export declare const customizeDevServer: (bundlerOptions: unknown, app: App, { errMsg, response: responseHandler, path, }: DevServerOptions) => void;