import { Response } from 'express'; import { Config } from '../aop'; import { Dictionary } from '../base'; import { RemoteFunc } from '../jsonRpc'; import { SessionRequest } from './session'; /** * Mock会话 */ export declare class MockSession { static sessions: { [index: string]: any; }; static setValue(req: SessionRequest, name: string, value: any): any; static getValue(req: SessionRequest, name: string): any; static deleteValue(req: SessionRequest, name: string): void; } export declare type MockRouters = { [url: string]: (req: SessionRequest, res: Response) => void; }; /** * Mock配置 */ export declare class MockConfig { /** * 当前是否Mock启动 */ static isMock: boolean; /** * 扩展服务 */ static extendServices?: Dictionary; /** * Mock路由 */ static request?: (req: SessionRequest, res: Response) => void; } export declare function createMockRemoteFunction(remoteFunction: RemoteFunc): (req: SessionRequest, res: Response) => Promise; /** * 启动Mock * @param rootDir 根目录 */ export declare function startMock(rootDir: string, staticWebDir?: string, extendServices?: Dictionary): Promise;