1.1.5 • Published 6 months ago

@types/apimocker v1.1.5

Weekly downloads
33
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/apimocker

Summary

This package contains type definitions for apimocker (https://www.npmjs.com/package/apimocker).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/apimocker.

index.d.ts

// Type definitions for apimocker 1.1
// Project: https://www.npmjs.com/package/apimocker
// Definitions by: Uchenna <https://github.com/uchilaka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { RequestHandler, Application } from 'express';

export interface ConfigOptions {
    port?: string | undefined;
    mockDirectory?: string | undefined;
    allowedDomains?: string[] | undefined;
    allowedHeaders?: string[] | undefined;
    logRequestHeaders?: boolean | undefined;
    allowAvoidPreFlight?: boolean | undefined;
    useUploadFieldname?: boolean | undefined;
    webServices?: any;
    quiet?: boolean | undefined;
}

export interface ApiMocker {
    express: Application;
    middlewares: RequestHandler[];
    setConfigFile: (file: string) => ApiMocker;
    loadConfigFile: () => void;
    setRoutes: (webServices: any) => void;
    /**
     * Set the route for express, in case it was not set yet
     */
    setRoute: (options: any) => void;
    /**
     * Start a new instance of API Mocker
     */
    start: (serverPort: string | number, callback?: () => void) => ApiMocker;
    /**
     * Stop the referenced instance of API Mocker
     */
    stop: (callback?: () => void) => ApiMocker;
}

export const middlewares: RequestHandler[];

export function createServer(options?: ConfigOptions): ApiMocker;

export function setConfigFile(file: string): ApiMocker;

export function start(serverPort: string | number, callback?: () => void): ApiMocker;

export function stop(callback?: () => void): ApiMocker;

Additional Details

  • Last updated: Wed, 07 Jul 2021 21:44:27 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by Uchenna.

1.1.5

6 months ago

1.1.4

7 months ago

1.1.3

8 months ago

1.1.2

3 years ago

1.1.1

5 years ago

1.1.0

5 years ago