Skip to content

Commit

Permalink
Revert deletion of @types/puppeteer in 302d5f6
Browse files Browse the repository at this point in the history
Puppeteer v1.12.0 had added the official type definition, but updated
v1.12.1 has removed it because of low quality.

See: puppeteer/puppeteer#3878
  • Loading branch information
yhatt committed Feb 2, 2019
1 parent a6565ba commit 2f25168
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@types/jest-plugin-context": "^2.9.0",
"@types/node": "^10.12.21",
"@types/pug": "^2.0.4",
"@types/puppeteer": "^1.11.2",
"@types/supertest": "^2.0.7",
"@types/ws": "^6.0.1",
"@types/yargs": "^12.0.8",
Expand Down
2 changes: 1 addition & 1 deletion src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Converter {
type: 'png' | 'jpeg'
}
) {
file.buffer = <Buffer>await this.usePuppeteer(file, async (page, uri) => {
file.buffer = await this.usePuppeteer(file, async (page, uri) => {
await page.setViewport({ ...opts.size })
await page.goto(uri, { waitUntil: ['domcontentloaded', 'networkidle0'] })
await page.emulateMedia('print')
Expand Down
5 changes: 5 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ declare module '*.scss' {
const scss: string
export default scss
}

declare module 'puppeteer-core' {
import * as puppeteer from 'puppeteer'
export = puppeteer
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@
resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.4.tgz#8772fcd0418e3cd2cc171555d73007415051f4b2"
integrity sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=

"@types/puppeteer@^1.11.2":
version "1.12.0"
resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.12.0.tgz#0bd11f1aae4130b164d1759e69b8376a75d034fa"
integrity sha512-chymwff4/kbiHWkG/ZqkyLboFWMmbO5gz9AozDKqdv6T9ca1ScI1jsK5A7vM5hp2qoxfADN/UEOpMDXaA/L0VA==
dependencies:
"@types/node" "*"

"@types/q@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.1.tgz#48fd98c1561fe718b61733daed46ff115b496e18"
Expand Down

0 comments on commit 2f25168

Please sign in to comment.