From 96ca1ec52c214720edfb0beba510080f0757ff6b Mon Sep 17 00:00:00 2001 From: Anton Van Eechaute <974796+antonve@users.noreply.github.com> Date: Tue, 12 Nov 2019 08:47:27 +0900 Subject: [PATCH] add v3 version of @tryghost/content-api (#40176) --- types/tryghost__content-api/index.d.ts | 7 ++++--- types/tryghost__content-api/tryghost__content-api-tests.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/tryghost__content-api/index.d.ts b/types/tryghost__content-api/index.d.ts index 0b836c03f5..bd906efd18 100644 --- a/types/tryghost__content-api/index.d.ts +++ b/types/tryghost__content-api/index.d.ts @@ -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 +// Anton Van Eechaute // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export type ArrayOrValue = 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; diff --git a/types/tryghost__content-api/tryghost__content-api-tests.ts b/types/tryghost__content-api/tryghost__content-api-tests.ts index def77e444f..db74840b98 100644 --- a/types/tryghost__content-api/tryghost__content-api-tests.ts +++ b/types/tryghost__content-api/tryghost__content-api-tests.ts @@ -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