From 620f9cc215be5377c03d0f66c609fe46149f08f2 Mon Sep 17 00:00:00 2001 From: Glen Date: Tue, 8 Dec 2015 09:45:34 +0200 Subject: [PATCH] Refactor (add MatchTest type and StreamOptions interface) --- browser-sync/browser-sync.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index fe4498e8f..6f46d6c94 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -312,6 +312,13 @@ declare module "browser-sync" { fn: (match: string) => string; } + type MatchTest = (string | RegExp | ((testString: string) => boolean)); + + interface StreamOptions { + once?: boolean; + match?: MatchTest | MatchTest[]; + } + interface BrowserSyncStatic extends BrowserSyncInstance { /** * Start the Browsersync service. This will launch a server, proxy or start the snippet mode @@ -367,7 +374,7 @@ declare module "browser-sync" { * The stream method returns a transform stream and can act once or on many files. * @param opts Configuration for the stream method */ - stream(opts?: { once?: boolean, match?: string | RegExp | ((testString: string) => boolean) | (string | RegExp | ((testString: string) => boolean))[] }): NodeJS.ReadWriteStream; + stream(opts?: StreamOptions): NodeJS.ReadWriteStream; /** * Helper method for browser notifications * @param message Can be a simple message such as 'Connected' or HTML