UNPKG

1.37 kBTypeScriptView Raw
1import { Application as ExpressApp } from "express";
2import { MockServerHelper } from "./mockServerHelper";
3import MockServerOptions from "./mockServerOptions";
4declare const webpackMockServer: {
5 /**
6 * Applies webpackMiddleware on existed express-application
7 * @param app expressjs application that is used for mapping-routes
8 * @param extendOptions MockServerOptions that overrides default options
9 */
10 use(app: ExpressApp, extendOptions?: MockServerOptions | undefined): void;
11 /**
12 * Add mock functions into webackMockServer
13 * @param mockFunction
14 */
15 add(mockFunction: (app: ExpressApp, helper: MockServerHelper) => void): (app: ExpressApp) => void;
16 /** Default MockServer options (readonly) */
17 readonly defaultOptions: MockServerOptions;
18};
19export = webpackMockServer;
20declare global {
21 namespace Express {
22 interface Request {
23 /**
24 * Urls that can be used for downloading uploaded files
25 * Uploading files automatically stores it's in memory
26 * As alternative you can check req.file and req.files for getting file-names
27 * */
28 fileDownloadUrls?: string[];
29 }
30 namespace Multer {
31 interface File {
32 downloadUrl: string;
33 }
34 }
35 }
36}