Skip to content

Commit 4173a81

Browse files
dsiffordweswigham
authored andcommitted
[browser-sync-webpack-plugin] add new definitions (DefinitelyTyped#37042)
* [browser-sync-webpack-plugin] add new definitions * fix build failure
1 parent 4b7b828 commit 4173a81

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import BrowserSyncPlugin = require('browser-sync-webpack-plugin');
2+
3+
new BrowserSyncPlugin({
4+
proxy: 'localhost:8080',
5+
open: false,
6+
reloadDebounce: 2000,
7+
notify: false,
8+
});
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Type definitions for browser-sync-webpack-plugin 2.2
2+
// Project: https://github.com/Va1/browser-sync-webpack-plugin/blob/master/README.md
3+
// Definitions by: Derek Sifford <https://github.com/dsifford>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
// TypeScript Version: 3.5
6+
7+
import BrowserSync = require('browser-sync');
8+
import { Plugin } from 'webpack';
9+
10+
declare namespace BrowserSyncPlugin {
11+
interface Options {
12+
/**
13+
* BrowserSync instance init callback.
14+
* @defaultValue undefined
15+
*/
16+
callback?(error: Error, bs: BrowserSync.BrowserSyncInstance): void;
17+
/**
18+
* allows BrowserSync to inject changes inplace instead of reloading the page when changed
19+
* chunks are all CSS files.
20+
* @defaultValue false
21+
*/
22+
injectCss?: boolean;
23+
/**
24+
* BrowserSync instance name.
25+
* @defaultValue 'bs-webpack-plugin'
26+
*/
27+
name?: string;
28+
/**
29+
* Should BrowserSync handle reloads?
30+
* @defaultValue true
31+
*/
32+
reload?: boolean;
33+
}
34+
}
35+
declare class BrowserSyncPlugin extends Plugin {
36+
constructor(browserSyncOptions: BrowserSync.Options, pluginOptions?: BrowserSyncPlugin.Options);
37+
}
38+
39+
export = BrowserSyncPlugin;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": ["es6"],
5+
"noImplicitAny": true,
6+
"noImplicitThis": true,
7+
"strictNullChecks": true,
8+
"strictFunctionTypes": true,
9+
"baseUrl": "../",
10+
"typeRoots": ["../"],
11+
"types": [],
12+
"noEmit": true,
13+
"forceConsistentCasingInFileNames": true,
14+
"paths": {
15+
"micromatch": [
16+
"micromatch/v2"
17+
]
18+
}
19+
},
20+
"files": [
21+
"index.d.ts",
22+
"browser-sync-webpack-plugin-tests.ts"
23+
]
24+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "dtslint/dt.json" }

0 commit comments

Comments
 (0)