mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
add v3 version of @tryghost/content-api (#40176)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
898feb8213
commit
96ca1ec52c
+4
-3
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user