Skip to content

Commit dbc926a

Browse files
Merge pull request #65 from samijaber/patch-1
Fix inconsistencies in TypeScript declaration file
2 parents f66b2f1 + d9d0829 commit dbc926a

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

index.d.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
declare module 'webpack-flush-chunks' {
22
import { Stats } from 'webpack';
33

4+
// lazy-loading wrapper around the string outputs, in case they are not used.
5+
interface LazyLoadedString {
6+
toString: () => string;
7+
}
8+
49
export default function flushChunks(
510
stats: Stats,
611
options: {
@@ -25,13 +30,13 @@ declare module 'webpack-flush-chunks' {
2530
Css: React.Component<{}>;
2631

2732
/** JavaScript chunks */
28-
js: string[];
33+
js: LazyLoadedString;
2934

3035
/** External stylesheets */
31-
styles: string[];
36+
styles: LazyLoadedString;
3237

3338
/** raw CSS */
34-
css: string[];
39+
css: LazyLoadedString;
3540

3641
/** Array of filenames */
3742
scripts: string[];
@@ -43,12 +48,12 @@ declare module 'webpack-flush-chunks' {
4348
cssHashRaw: Record<string, string>;
4449

4550
/** `<script>window.__CSS_CHUNKS__ = ${JSON.stringify(cssHashRaw)}</script>` */
46-
cssHash: string[];
51+
cssHash: LazyLoadedString;
4752

4853
/** `<script>window.__CSS_CHUNKS__ = ${JSON.stringify(cssHashRaw)}</script>` as a React component */
4954
CssHash: React.Component<{}>;
5055

5156
publicPath: string;
52-
outputPath: string;
57+
outputPath?: string;
5358
};
5459
}

0 commit comments

Comments
 (0)