Skip to content

Commit

Permalink
Merge pull request #65 from samijaber/patch-1
Browse files Browse the repository at this point in the history
Fix inconsistencies in TypeScript declaration file
  • Loading branch information
ScriptedAlchemy authored Jul 30, 2018
2 parents f66b2f1 + d9d0829 commit dbc926a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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[];
Expand All @@ -43,12 +48,12 @@ declare module 'webpack-flush-chunks' {
cssHashRaw: Record<string, string>;

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

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

publicPath: string;
outputPath: string;
outputPath?: string;
};
}

0 comments on commit dbc926a

Please sign in to comment.