mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Added type definition for function "pdf()" with buffer in callback.
This commit is contained in:
Vendored
+1
@@ -107,6 +107,7 @@ declare class Nightmare {
|
||||
html(path: string, saveType: 'MHTML'): Nightmare;
|
||||
pdf(path: string): Nightmare;
|
||||
pdf(path: string, options: Object): Nightmare;
|
||||
pdf(cd:(err:Error, data:Buffer)=>void): Nightmare;
|
||||
title(): string;
|
||||
title(cb: (title: string) => void): Nightmare;
|
||||
url(cb: (url: string) => void): Nightmare;
|
||||
|
||||
@@ -189,6 +189,14 @@ new Nightmare()
|
||||
.pdf('test/test.pdf')
|
||||
.run(done);
|
||||
|
||||
new Nightmare()
|
||||
.goto("http://yahoo.com")
|
||||
.pdf((err,data)=>{
|
||||
console.log(Buffer.isBuffer(data))
|
||||
})
|
||||
.run(done)
|
||||
|
||||
|
||||
new Nightmare()
|
||||
.goto('http://www.google.com/')
|
||||
.wait('input')
|
||||
|
||||
Reference in New Issue
Block a user