chore(types): upgrade to TypeScript 3.1.1 (#3331)

This upgrades  us to TypeScript 3.1.1, which fixes some build failures. Annoyingly TypeScript does a better job of checking `process.stdio`, which exposes that the DefinitelyTyped definition for it is wrong. See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11587. I'll look into submitting a patch for that later.
This commit is contained in:
Joel Einbinder
2018-10-02 13:38:06 -07:00
committed by Andrey Lushnikov
parent 842fee860b
commit c237947b32
4 changed files with 6 additions and 4 deletions

View File

@@ -114,6 +114,7 @@ class Launcher {
}
const usePipe = chromeArguments.includes('--remote-debugging-pipe');
/** @type {!Array<"ignore"|"pipe">} */
const stdio = usePipe ? ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'] : ['pipe', 'pipe', 'pipe'];
const chromeProcess = childProcess.spawn(
chromeExecutable,
@@ -163,6 +164,7 @@ class Launcher {
const transport = await WebSocketTransport.create(browserWSEndpoint);
connection = new Connection(browserWSEndpoint, transport, slowMo);
} else {
// @ts-ignore - TypeScript incorrectly thinks stdio can't go above 2
const transport = new PipeTransport(/** @type {!NodeJS.WritableStream} */(chromeProcess.stdio[3]), /** @type {!NodeJS.ReadableStream} */ (chromeProcess.stdio[4]));
connection = new Connection('', transport, slowMo);
}