Fix browser files to have the same API as the nodejs ones (#9004)

This commit is contained in:
Daniel Tschinder
2018-11-09 13:11:46 -08:00
committed by GitHub
parent 74f969b603
commit 504b331da4
3 changed files with 28 additions and 10 deletions

View File

@@ -9,6 +9,14 @@ import {
type FileResultCallback,
} from "./transformation";
import typeof * as transformFileBrowserType from "./transform-file-browser";
import typeof * as transformFileType from "./transform-file";
// Kind of gross, but essentially asserting that the exports of this module are the same as the
// exports of transform-file-browser, since this file may be replaced at bundle time with
// transform-file-browser.
((({}: any): $Exact<transformFileBrowserType>): $Exact<transformFileType>);
type TransformFile = {
(filename: string, callback: FileResultCallback): void,
(filename: string, opts: ?InputOptions, callback: FileResultCallback): void,