@botonic/plugin-contentful
Version:
Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet
22 lines (21 loc) • 1.08 kB
TypeScript
import * as contentful from 'contentful';
import { ContentType } from 'contentful';
import { Memoizer } from '../../util/memoizer';
import { ClientApiErrorReporter, GetEntriesType, GetEntryType, ReducedClientApi } from './client-api';
/**
* Use memoization to remember forever the last successful result, and use it
* whenever Contentful fails.
*/
export declare class FallbackCachedClientApi implements ReducedClientApi {
numRecoveredErrors: number;
memoizer: Memoizer;
readonly getAsset: (id: string, query?: any) => Promise<contentful.Asset>;
readonly getAssets: (query?: any) => Promise<contentful.AssetCollection>;
readonly getEntries: GetEntriesType;
readonly getEntry: GetEntryType;
readonly getContentType: (id: string) => Promise<ContentType>;
private static readonly NUM_APIS;
private numMemoizations;
constructor(client: ReducedClientApi, cacheLimitKB: number, reporter: ClientApiErrorReporter, logger?: (msg: string) => void);
memoize<Args extends any[], Return, F extends (...args: Args) => Promise<Return>>(func: F): F;
}