fix(typescript): add done callback to Paginate interface

This commit is contained in:
Michelle Tilley 2019-10-30 12:17:53 -07:00 committed by Gregor Martynus
parent 56415e919e
commit 30532782cc
2 changed files with 2 additions and 2 deletions

View File

@ -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[]>
} }

View File

@ -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