-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add .extend and buffer/arrayBuffer methods (#143)
- Loading branch information
Showing
7 changed files
with
76 additions
and
52 deletions.
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
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
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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import { MqlPayload, MqlOptions } from '../lightweight' | ||
import { MqlPayload, MqlOptions } from '../lightweight'; | ||
|
||
export { MqlError, MqlPayload } from '../lightweight' | ||
|
||
export type MqlResponse = MqlPayload & { | ||
response: { | ||
url: string; | ||
isFromCache?: boolean; | ||
statusCode: number; | ||
headers: { [key: string]: string }; | ||
body: MqlPayload | ||
}; | ||
} | ||
type HTTPResponse = { | ||
url: string; | ||
isFromCache?: boolean; | ||
statusCode: number; | ||
headers: { [key: string]: string }; | ||
}; | ||
|
||
type HTTPResponseWithBody = HTTPResponse & { body: MqlPayload }; | ||
|
||
type HTTPResponseRaw = HTTPResponse & { body: Buffer }; | ||
|
||
declare function mql( | ||
url: string, | ||
opts?: MqlOptions, | ||
gotOpts?: object | ||
): Promise<MqlResponse>; | ||
|
||
declare namespace mql { | ||
function stream( | ||
url: string, | ||
opts?: MqlOptions, | ||
gotOpts?: object | ||
): NodeJS.ReadableStream; | ||
type MqlResponse = MqlPayload & { response: HTTPResponseWithBody }; | ||
|
||
interface Mql { | ||
(url: string, opts?: MqlOptions, gotOpts?: object): Promise<MqlResponse>; | ||
extend: (gotOpts?: object) => Mql; | ||
stream: (url: string, gotOpts?: object) => NodeJS.ReadableStream; | ||
buffer: (url: string, opts?: MqlOptions, gotOpts?: object) => Promise<HTTPResponseRaw>; | ||
} | ||
|
||
declare const mql: Mql; | ||
|
||
export default mql; |
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
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
3e49bf2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mql – ./
mql-git-master-microlink.vercel.app
mql-microlink.vercel.app
mql.microlink.io