From b4007c70550517c90b43698674a57645c73111dc Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 14 Nov 2019 00:20:53 -0800 Subject: [PATCH] feat: export types for paginated calls (#657) * fix: add license to protos/protos.js * feat: export types for paginated calls * revert extra stuff --- src/index.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/index.ts b/src/index.ts index 7ed1a18ce..244c86d33 100644 --- a/src/index.ts +++ b/src/index.ts @@ -141,3 +141,26 @@ export interface LROperation [ResultType, MetadataType, operationProtos.google.longrunning.Operation] >; } + +export interface PaginationCallback< + RequestObject, + ResponseObject, + ResponseType +> { + ( + err: Error | null, + values?: ResponseType[], + nextPageRequest?: RequestObject, + rawResponse?: ResponseObject + ): void; +} + +export interface PaginationResponse< + RequestObject, + ResponseObject, + ResponseType +> { + values?: ResponseType[]; + nextPageRequest?: RequestObject; + rawResponse?: ResponseObject; +}