mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Added support for nightmare-inline-download to nightmare.js
This commit is contained in:
Vendored
+11
@@ -30,6 +30,8 @@ declare class Nightmare {
|
||||
uncheck(seletor: string): Nightmare;
|
||||
select(seletor: string, option: string): Nightmare;
|
||||
upload(selector: string, path: string): Nightmare;
|
||||
download(path:string): Nightmare;
|
||||
download(action: Nightmare.IDownloadActions): Nightmare;
|
||||
scrollTo(top: number, left: number): Nightmare;
|
||||
viewport(width: number, height: number): Nightmare;
|
||||
inject(type: string, file: string): Nightmare;
|
||||
@@ -134,6 +136,11 @@ declare namespace Nightmare {
|
||||
cookiesFile?: string;
|
||||
phantomPath?: string;
|
||||
show?: boolean;
|
||||
paths?: {
|
||||
downloads?:string;
|
||||
};
|
||||
maxDownloadRequestWait?:number;
|
||||
ignoreDownloads?:boolean;
|
||||
}
|
||||
|
||||
export interface IRequest {
|
||||
@@ -171,6 +178,10 @@ declare namespace Nightmare {
|
||||
line: number;
|
||||
function?: string;
|
||||
}
|
||||
export enum IDownloadActions {
|
||||
cancel = "cancel",
|
||||
continue = "continue"
|
||||
}
|
||||
export class Cookies {
|
||||
get(): [Nightmare.ICookie];
|
||||
get(name: string): Nightmare.ICookie;
|
||||
|
||||
@@ -343,3 +343,9 @@ new Nightmare()
|
||||
new Nightmare()
|
||||
.goto('https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select')
|
||||
.select('select[name=select]', 'value3');
|
||||
|
||||
new Nightmare()
|
||||
.goto('https://github.com/segmentio/nightmare')
|
||||
.click('a[href="/segmentio/nightmare/archive/master.zip"]')
|
||||
.download('/some/other/path/master.zip');
|
||||
.run(done);
|
||||
|
||||
Reference in New Issue
Block a user