4.0.6 • Published 6 months ago

@types/webpackbar v4.0.6

Weekly downloads
35,361
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/webpackbar

Summary

This package contains type definitions for webpackbar (https://github.com/nuxt/webpackbar).

Details

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

index.d.ts

// Type definitions for webpackbar 2.6
// Project: https://github.com/nuxt/webpackbar
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7

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

import { Plugin } from 'webpack';

export = WebpackBar;

declare class WebpackBar extends Plugin {
    constructor(options?: WebpackBar.Options);

  state: WebpackBar.State;
}

declare namespace WebpackBar {
  interface Stats {
    count: number;
    time: [number, number];
  }

  class Profile {
    requests: any[];

    name: string;

    constructor(name: string);

    getStats(): { ext: Stats, loader: Stats };
  }

  interface State {
    isRunning: boolean;
    color: string;
    profile: Profile | null;
  }

  interface SharedState {
    [name: string]: State;
  }

  interface Options {
    /** Display name */
    name?: string | undefined;
    /** Color output of the progress bar */
    color?: string | undefined;
    /** Enable the profiler for files and loaders */
    profile?: boolean | undefined;
    /** Stream to write to */
    stream?: NodeJS.WriteStream | undefined;
    /** Minimal output */
    minimal?: boolean | undefined;
    /** Show compiled in time */
    compiledIn?: boolean | undefined;
    /** Function called when all builds are finished */
    done?: ((sharedState: SharedState, ctx: WebpackBar) => void) | undefined;
  }
}

Additional Details

Credits

These definitions were written by DefinitelyTyped.