mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
committed by
Andrey Lushnikov
parent
842fee860b
commit
c237947b32
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user