Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
feat(Postcodes): Add page, total and limit attr
Browse files Browse the repository at this point in the history
  • Loading branch information
cblanc committed Apr 15, 2021
1 parent dff3fe8 commit f6306e4
Show file tree
Hide file tree
Showing 3 changed files with 14,370 additions and 5,720 deletions.
38 changes: 5 additions & 33 deletions lib/index.ts
Expand Up @@ -354,7 +354,7 @@ export type PostcodeResults = Address[];
*/
export interface PostcodesResponse
extends ApiResponseWithResult<PostcodeResults>,
PossiblePaginatedResponse {}
PaginatedResponse {}

/**
* ## Address Results
Expand Down Expand Up @@ -384,56 +384,28 @@ export interface AddressQueryResponse
extends ApiResponseWithResult<AddressQueryResults> {}

/**
* ## PossiblePaginatedApiResponseWithResult
*
* @hidden
*
* Some requests may expose the pagination elements `page`, `limit`, and `total` such as an address query, or postcode lookup with the multiple residence dataset.
* Requests exposes the pagination elements `page`, `limit`, and `total` such as an address query, or postcode lookup with the multiple residence dataset.
*/
interface PossiblePaginatedResponse {
interface PaginatedResponse {
/**
* Current page number.
*
* Exposed in the event a request can be paginated.
*/
page?: number;
page: number;

/**
* Total number of results.
*
* Exposed in the event a request can be paginated.
*/
total?: number;
total: number;

/**
* Maximum number of results per page.
*
* Exposed in the event a request can be paginated.
*/
limit?: number;
}

/**
* PaginatedResponse
*
* @hidden
*
* Enforces pagination attributes on interface
*/
interface PaginatedResponse {
/**
* Current page number
*/
page: number;

/**
* Total number of results.
*/
total: number;

/**
* Maximum number of results per page.
*/
limit: number;
}

Expand Down

0 comments on commit f6306e4

Please sign in to comment.