forked from mirrors/probot
fix(typescript): add done callback to Paginate interface
This commit is contained in:
parent
56415e919e
commit
30532782cc
|
@ -64,7 +64,7 @@ export interface OctokitError extends Error {
|
||||||
interface Paginate extends Octokit.Paginate {
|
interface Paginate extends Octokit.Paginate {
|
||||||
(
|
(
|
||||||
responsePromise: Promise<Octokit.AnyResponse>,
|
responsePromise: Promise<Octokit.AnyResponse>,
|
||||||
callback?: (response: Octokit.AnyResponse) => any
|
callback?: (response: Octokit.AnyResponse, done: () => void) => any
|
||||||
): Promise<any[]>
|
): Promise<any[]>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export function addPagination (octokit: Octokit) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultCallback = (response: Octokit.AnyResponse, done?: () => void) => response
|
const defaultCallback = (response: Octokit.AnyResponse, done: () => void) => response
|
||||||
|
|
||||||
async function paginate (octokit: Octokit, octokitPaginate: Octokit.Paginate, ...args: any[]) {
|
async function paginate (octokit: Octokit, octokitPaginate: Octokit.Paginate, ...args: any[]) {
|
||||||
// Until we fully deprecate the old paginate method, we need to check if the
|
// Until we fully deprecate the old paginate method, we need to check if the
|
||||||
|
|
Loading…
Reference in New Issue