Skip to content

Commit

Permalink
fix: added new enveloped and paginated interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocoski committed Sep 1, 2019
1 parent c369a94 commit 9fca3f2
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dist/interfaces/EnvelopedResponse.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="node" />
import { OutgoingHttpHeaders } from "http";
export interface EnvelopedResponse<T> {
readonly status: number;
readonly body: T;
readonly headers: OutgoingHttpHeaders;
}
3 changes: 3 additions & 0 deletions dist/interfaces/EnvelopedResponse.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/interfaces/EnvelopedResponse.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions dist/interfaces/PaginatedResults.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Item from './Item';
export interface PaginationMetadata {
readonly hasAfter: boolean;
readonly hasBefore: boolean;
readonly after: string | null;
readonly before: string | null;
readonly totalCount: number;
}
export interface PaginatedResponse<I extends Item> {
readonly data: I[];
readonly pagination: PaginationMetadata;
}
3 changes: 3 additions & 0 deletions dist/interfaces/PaginatedResults.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/interfaces/PaginatedResults.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/interfaces/cursorResult.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default interface CursorResult {
readonly after: Cursor;
readonly hasBefore: boolean;
readonly hasAfter: boolean;
readonly totalCount?: number;
}
1 change: 1 addition & 0 deletions src/interfaces/CursorResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default interface CursorResult {
readonly after: Cursor;
readonly hasBefore: boolean;
readonly hasAfter: boolean;
readonly totalCount?: number;
}
7 changes: 7 additions & 0 deletions src/interfaces/EnvelopedResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { OutgoingHttpHeaders } from "http";

export interface EnvelopedResponse<T> {
readonly status: number;
readonly body: T;
readonly headers: OutgoingHttpHeaders;
}
13 changes: 13 additions & 0 deletions src/interfaces/PaginatedResults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Item from './Item';

export interface PaginationMetadata {
readonly hasAfter: boolean;
readonly hasBefore: boolean;
readonly after: string | null;
readonly before: string | null;
readonly totalCount: number;
}
export interface PaginatedResponse<I extends Item> {
readonly data: I[];
readonly pagination: PaginationMetadata;
}

0 comments on commit 9fca3f2

Please sign in to comment.