@botonic/plugin-contentful
Version:
## What Does This Plugin Do?
20 lines (19 loc) • 1.07 kB
TypeScript
import * as contentful from 'contentful';
import { ContentType } from 'contentful';
import memoize from 'memoizee';
import { ClientApiErrorReporter, GetEntriesType, GetEntryType, ReducedClientApi } from './client-api';
export declare class CachedClientApi implements ReducedClientApi {
readonly client: ReducedClientApi;
readonly cacheTtlMs: number;
readonly errorReport: ClientApiErrorReporter;
static readonly NO_EXPIRATION = -1;
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>;
constructor(client: ReducedClientApi, cacheTtlMs: number, errorReport: ClientApiErrorReporter);
memoize<Args extends any[], Return, F extends (...args: Args) => Promise<Return>>(func: F, functionLength: number): F;
options(length: number): memoize.Options<any>;
static normalizer(...args: any): string;
}