import Response from './response'; import { pathMatch } from './util.path-match'; import { Config } from './index'; import { ExtendedObject } from './info'; export interface staticActive { (module: string, path: string, appId: string, vpath: string): Promise; } export interface StaticActive { (staticActive: staticActive, module: string, path: string, appId: string, vpath: string): Response | undefined | Promise; } interface serverThis { config: Config; match: pathMatch; basePath(appId: string): string | string[]; index(accept: string[]): string | string[]; extension(accept: string[]): string | string[]; active?: StaticActive; } export interface Opt { /** 获取请求域名 */ readonly domain: string; /** 获取请求方法 */ readonly method: string; /** 获取请求路径 */ readonly path: string; /** 客户端IP */ readonly clientIp: string[]; getHeader(h: string): undefined | string | string[]; setHeader(h: string, v: string | string[]): void; } export interface server { (this: serverThis | void, staticPath: string | string[], opt: Opt): Promise; } /** * 静态页面 * @param {String} staticPath 路径 */ export declare function server(this: serverThis | undefined, staticPath: string | string[], opt: Opt): Promise; export default function init(config: Config, match: pathMatch): server; export {};