From 8e34453707b33e45208dbd43dacc10c10bb53c62 Mon Sep 17 00:00:00 2001 From: Alexander Forsyth Date: Thu, 20 Aug 2020 10:51:56 -0400 Subject: [PATCH] feat(types): update types to include pagination type. (#1451) * feat: add pagination global types --- packages/types/src/index.ts | 1 + packages/types/src/pagination.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/types/src/pagination.ts diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index f34cbbac2e5c..0b6c71c650fe 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -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"; diff --git a/packages/types/src/pagination.ts b/packages/types/src/pagination.ts new file mode 100644 index 000000000000..ff735b35ba55 --- /dev/null +++ b/packages/types/src/pagination.ts @@ -0,0 +1,16 @@ +import { Client } from "./client"; + +/** + * Expected type definition of a paginator. + */ +export type Paginator = AsyncGenerator; + +/** + * Expected paginator configuration passed to an operation. Services will extend + * this interface definition and may type client further. + */ +export interface PaginationConfiguration { + client: Client; + pageSize?: number; + startingToken?: string; +}