Skip to content

Commit

Permalink
Update ContentfulClient definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhefner committed Apr 24, 2019
1 parent 69be614 commit c0edd5d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

import { Component, Context } from 'react';
import {
Asset,
AssetCollection,
ContentType,
ContentTypeCollection,
CreateClientParams,
ContentfulClientApi,
Entry,
EntryCollection,
LocaleCollection,
Space,
SyncCollection,
} from 'contentful';

/**
Expand Down Expand Up @@ -36,14 +43,21 @@ export interface ContentfulClientParams extends CreateClientParams {
ssrMode?: boolean;
}

export interface ContentfulClientInterface extends ContentfulClientApi {
export class ContentfulClient implements ContentfulClientApi {
cache: ContentfulCache;
ssrMode: boolean;
checkCache(requestKey: string): any;
getAsset(id: string, query?: any): Promise<Asset>;
getAssets(query?: any): Promise<AssetCollection>;
getContentType(id: string): Promise<ContentType>;
getContentTypes(query?: any): Promise<ContentTypeCollection>;
getEntry<T>(id: string, query?: any): Promise<Entry<T>>;
getEntries<T>(query?: any): Promise<EntryCollection<T>>;
getLocales(): Promise<LocaleCollection>;
getSpace(): Promise<Space>;
sync(query: any): Promise<SyncCollection>;
}

export function ContentfulClient(options: CreateClientParams): ContentfulClientInterface;

/**
* ContentfulContext
*/
Expand Down

0 comments on commit c0edd5d

Please sign in to comment.