@types/reload
TypeScript icon, indicating that this package has built-in type declarations

3.2.3 • Public • Published

Installation

npm install --save @types/reload

Summary

This package contains type definitions for reload (https://github.com/alallier/reload#readme).

Details

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

index.d.ts

import express = require("express");
import ws = require("ws");

declare function reload(
    app: express.Express,
    opts: reload.OptionsWaitToStartWebSocketServer,
): Promise<reload.ReloadWithWebSocketServer>;
declare function reload(app: express.Express, opts?: reload.Options): Promise<reload.Reload>;

declare namespace reload {
    interface Options {
        port?: number;
        https?: {
            p12?: {
                p12Path: string;
            };
            certAndKey?: {
                key: string;
                cert: string;
            };
            passphrase?: string;
        };
        forceWss?: boolean;
        verbose?: boolean;
        route?: string;
    }

    interface OptionsWaitToStartWebSocketServer extends Options {
        webSocketServerWaitStart: true;
    }

    interface Reload {
        reload(): void;
        wss: ws.Server;
        closeServer(): Promise<Error | undefined>;
    }

    interface ReloadWithWebSocketServer extends Reload {
        startWebSocketServer(): Promise<Reload>;
    }
}

export = reload;

Additional Details

Credits

These definitions were written by Victor Nascimento Bakke.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/reload

Weekly Downloads

526

Version

3.2.3

License

MIT

Unpacked Size

4.84 kB

Total Files

5

Last publish

Collaborators

  • types