UNPKG

@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

25 lines (24 loc) 1.43 kB
import * as contentful from 'contentful'; import { Entry } from 'contentful'; import { Content, ContentId, ContentType, Context, ResourceId } from '../cms'; import { DeliveryApi } from './delivery-api'; import { ContentWithNameFields } from './delivery-utils'; export declare abstract class ResourceDelivery { protected readonly delivery: DeliveryApi; protected readonly resumeErrors: boolean; constructor(delivery: DeliveryApi, resumeErrors: boolean); urlFromAssetRequired(assetField: contentful.Asset): string; urlFromAssetOptional(assetField: contentful.Asset | undefined, context: Context): string | undefined; protected checkEntry(entry: Entry<any>): void; protected logOrThrow(doing: string, context: Context, reason: any, resourceId: ResourceId): void; protected asyncMap<T extends Content>(context: Context, entries: Entry<any>[], factory: (entry: Entry<any>) => Promise<T>): Promise<T[]>; protected getContentIdForLogs(entry: contentful.Entry<any>): ContentId; } export declare abstract class ContentDelivery extends ResourceDelivery { readonly modelType: ContentType; constructor(modelType: ContentType, delivery: DeliveryApi, resumeErrors: boolean); getEntry<T>(id: string, context: Context, query?: any): Promise<contentful.Entry<T>>; entryId(entry: Entry<ContentWithNameFields>): string; } export declare abstract class TopContentDelivery extends ContentDelivery { }