From d9d0829a560a4bd9864165491a0033e237d97066 Mon Sep 17 00:00:00 2001 From: Sami Jaber Date: Wed, 25 Jul 2018 11:55:49 -0400 Subject: [PATCH] Fix inconsistencies in TypeScript declaration file --- index.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 920f6f5..96914f1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,11 @@ declare module 'webpack-flush-chunks' { import { Stats } from 'webpack'; + // lazy-loading wrapper around the string outputs, in case they are not used. + interface LazyLoadedString { + toString: () => string; + } + export default function flushChunks( stats: Stats, options: { @@ -25,13 +30,13 @@ declare module 'webpack-flush-chunks' { Css: React.Component<{}>; /** JavaScript chunks */ - js: string[]; + js: LazyLoadedString; /** External stylesheets */ - styles: string[]; + styles: LazyLoadedString; /** raw CSS */ - css: string[]; + css: LazyLoadedString; /** Array of filenames */ scripts: string[]; @@ -43,12 +48,12 @@ declare module 'webpack-flush-chunks' { cssHashRaw: Record; /** `` */ - cssHash: string[]; + cssHash: LazyLoadedString; /** `` as a React component */ CssHash: React.Component<{}>; publicPath: string; - outputPath: string; + outputPath?: string; }; }