UNPKG

@botonic/plugin-contentful

Version:

## What Does This Plugin Do?

22 lines (21 loc) 1.08 kB
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; }