PaginateReturn type

Helper type to infer the Type of the paged elements from the response type This type is generated based on the swagger information for x-ms-pageable specifically on the itemName property which indicates the property of the response where the page items are found. The default value is value. This type will allow us to provide strongly typed Iterator based on the response we get as second parameter

type PaginateReturn<TResult> = TResult extends { body: { value?: TPage } }
  ? GetArrayType<TPage>
  : unknown[]