DefinitelyTyped/types/browser-sync-webpack-plugin/index.d.ts
Derek Sifford 4173a818f4 [browser-sync-webpack-plugin] add new definitions (#37042)
* [browser-sync-webpack-plugin] add new definitions

* fix build failure
2019-07-22 12:51:34 -07:00

40 lines
1.3 KiB
TypeScript

// Type definitions for browser-sync-webpack-plugin 2.2
// Project: https://github.com/Va1/browser-sync-webpack-plugin/blob/master/README.md
// Definitions by: Derek Sifford <https://github.com/dsifford>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5
import BrowserSync = require('browser-sync');
import { Plugin } from 'webpack';
declare namespace BrowserSyncPlugin {
interface Options {
/**
* BrowserSync instance init callback.
* @defaultValue undefined
*/
callback?(error: Error, bs: BrowserSync.BrowserSyncInstance): void;
/**
* allows BrowserSync to inject changes inplace instead of reloading the page when changed
* chunks are all CSS files.
* @defaultValue false
*/
injectCss?: boolean;
/**
* BrowserSync instance name.
* @defaultValue 'bs-webpack-plugin'
*/
name?: string;
/**
* Should BrowserSync handle reloads?
* @defaultValue true
*/
reload?: boolean;
}
}
declare class BrowserSyncPlugin extends Plugin {
constructor(browserSyncOptions: BrowserSync.Options, pluginOptions?: BrowserSyncPlugin.Options);
}
export = BrowserSyncPlugin;