Skip to content

Commit

Permalink
feat(types): update types to include pagination type. (#1451)
Browse files Browse the repository at this point in the history
* feat: add pagination global types
  • Loading branch information
alexforsyth committed Aug 20, 2020
1 parent 8a0febd commit 8e34453
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Expand Up @@ -6,6 +6,7 @@ export * from "./crypto";
export * from "./eventStream";
export * from "./http";
export * from "./logger";
export * from "./pagination";
export * from "./serde";
export * from "./middleware";
export * from "./response";
Expand Down
16 changes: 16 additions & 0 deletions packages/types/src/pagination.ts
@@ -0,0 +1,16 @@
import { Client } from "./client";

/**
* Expected type definition of a paginator.
*/
export type Paginator<T> = AsyncGenerator<T, T, unknown>;

/**
* Expected paginator configuration passed to an operation. Services will extend
* this interface definition and may type client further.
*/
export interface PaginationConfiguration {
client: Client<any, any, any>;
pageSize?: number;
startingToken?: string;
}

0 comments on commit 8e34453

Please sign in to comment.