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

1.4.6 • Public • Published

Installation

npm install --save @types/webpack-plugin-serve

Summary

This package contains type definitions for webpack-plugin-serve (https://github.com/shellscape/webpack-plugin-serve).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-plugin-serve.

index.d.ts

/// <reference types="node" />

import { Options as HistoryApiFallbackOptions } from "connect-history-api-fallback";
import type { GlobbyOptions } from "globby";
import { Options as HttpProxyMiddlewareConfig, RequestHandler as Proxy } from "http-proxy-middleware";
import { SecureServerOptions as Http2SecureServerOptions, ServerOptions as Http2ServerOptions } from "http2";
import { ServerOptions as HttpsServerOptions } from "https";
import * as Koa from "koa";
import { CompressOptions } from "koa-compress";
import { Options as KoaStaticOptions } from "koa-static";

export interface Builtins {
    proxy: (args: HttpProxyMiddlewareConfig) => Proxy;
    compress: (opts: CompressOptions) => void;
    static: (paths: string[], opts?: KoaStaticOptions) => void;
    historyFallback: (opts: HistoryApiFallbackOptions) => void;
    websocket: () => void;
    four0four: (fn?: (ctx: Koa.Context) => void) => void;
}

export interface StaticObject {
    glob?: string | string[] | undefined;
    options?: GlobbyOptions | undefined;
}

export interface WebpackPluginServeOptions {
    client?: {
        address?: string | undefined;
        protocol?: "ws" | "wss" | undefined;
        retry?: boolean | undefined;
        silent?: boolean | undefined;
    } | undefined;
    compress?: boolean | undefined;
    historyFallback?: boolean | HistoryApiFallbackOptions | undefined;
    hmr?: boolean | "refresh-on-failure" | undefined;
    host?: string | Promise<string> | undefined;
    http2?: boolean | Http2ServerOptions | Http2SecureServerOptions | undefined;
    https?: HttpsServerOptions | undefined;
    liveReload?: boolean | undefined;
    log?: {
        level: "trace" | "debug" | "info" | "warn" | "error";
        timestamp?: boolean | undefined;
    } | undefined;
    middleware?: ((app: Koa, builtins: Builtins) => void) | undefined;
    open?:
        | boolean
        | {
            wait?: boolean | undefined;
            app?: string | readonly string[] | undefined;
        }
        | undefined;
    port?: number | Promise<number> | undefined;
    progress?: boolean | "minimal" | undefined;
    static?: string | string[] | StaticObject | undefined;
    status?: boolean | undefined;
    waitForBuild?: boolean | undefined;
}

export class WebpackPluginServe<Compiler> {
    constructor(opts?: WebpackPluginServeOptions);
    attach(): {
        apply(compiler: Compiler): void;
    };
    hook(compiler: Compiler): void;
    apply(compiler: Compiler): void;
}

Additional Details

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/webpack-plugin-serve

Weekly Downloads

4,144

Version

1.4.6

License

MIT

Unpacked Size

8.21 kB

Total Files

5

Last publish

Collaborators

  • types