forked from wuchengwei/node-wget
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add typings to package * fix: add missing declare keyword * fix: request.callback should be IncomingMessage * chore: add comma for linting * fix: copy some options to top level
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { EventEmitter } from 'events' | ||
import { ClientRequest, IncomingMessage } from 'http' | ||
|
||
declare const wget: { | ||
download(src: string, output: string, options?: wget.DownloadOptions): EventEmitter, | ||
request(options: wget.RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest, | ||
} | ||
|
||
declare namespace wget { | ||
type RequestOptions = { | ||
gunzip?: boolean, | ||
} | DownloadOptions | ||
|
||
type DownloadOptions = { | ||
protocol?: string, | ||
host?: string, | ||
path?: string, | ||
proxy?: { | ||
protocol?: string, | ||
host?: string, | ||
port?: number, | ||
proxyAuth?: string, | ||
headers?: Record<string, string>, | ||
} | string, | ||
method?: string, | ||
} | ||
} | ||
|
||
export = wget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters