Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0d7adf
commit 1a4a8f8
Showing
5 changed files
with
48 additions
and
93 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @typedef {Object} GitProgressEvent | ||
* @property {string} phase | ||
* @property {number} loaded | ||
* @property {number} total | ||
*/ | ||
|
||
/** | ||
* @callback ProgressCallback | ||
* @param {GitProgressEvent} progress | ||
* @returns {void | Promise<void>} | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} GitHttpRequest | ||
* @property {string} url - The URL to request | ||
* @property {string} [method='GET'] - The HTTP method to use | ||
* @property {Object<string, string>} [headers={}] - Headers to include in the HTTP request | ||
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests | ||
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s) | ||
* @property {AbortSignal} [signal] - Reserved for future use (canceling a request) | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} GitHttpResponse | ||
* @property {string} url - The final URL that was fetched after any redirects | ||
* @property {string} [method] - The HTTP method that was used | ||
* @property {Object<string, string>} [headers] - HTTP response headers | ||
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of the response | ||
* @property {number} statusCode - The HTTP status code | ||
* @property {string} statusMessage - The HTTP status message | ||
*/ | ||
|
||
/** | ||
* @callback HttpFetch | ||
* @param {GitHttpRequest} request | ||
* @returns {Promise<GitHttpResponse>} | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} HttpClient | ||
* @property {HttpFetch} request | ||
*/ |
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