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; +}