add v3 version of @tryghost/content-api (#40176)

This commit is contained in:
Anton Van Eechaute
2019-11-11 15:47:27 -08:00
committed by Pranav Senthilnathan
parent 898feb8213
commit 96ca1ec52c
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
// Type definitions for @tryghost/content-api 1.2
// Type definitions for @tryghost/content-api 1.3
// Project: https://github.com/TryGhost/Ghost-SDK/tree/master/packages/content-api
// Definitions by: Kevin Nguyen <https://github.com/knguyen0125>
// Anton Van Eechaute <https://github.com/antonve>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type ArrayOrValue<T> = T | T[];
@@ -205,9 +206,9 @@ export interface GhostContentAPIOptions {
/**
* Version of GhostContentAPI
*
* Supported Versions: 'v2', 'canary'
* Supported Versions: 'v2', 'v3', 'canary'
*/
version: 'v2' | 'canary';
version: 'v2' | 'v3' | 'canary';
key: string;
/** @deprecated since version v2 */
host?: string;
@@ -1,6 +1,6 @@
import GhostContentAPI, { PostOrPage } from '@tryghost/content-api';
const api = GhostContentAPI({ url: 'test', version: 'v2', key: '' }); // $ExpectType GhostAPI
const api = GhostContentAPI({ url: 'test', version: 'v3', key: '' }); // $ExpectType GhostAPI
let pages: PostOrPage[];
const pagesBrowsePromise = api.pages.browse(); // $ExpectType Promise<PagesObject>