@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
36 lines (35 loc) • 2.28 kB
TypeScript
import { SearchCandidate } from '../search';
import { CMS, ContentType, PagingOptions, TopContentType } from './cms';
import { Asset, Button, Carousel, Chitchat, CommonFields, Content, Custom, DateRangeContent, Document, Element, Handoff, Image, Input, Payload, Queue, ScheduleContent, StartUp, Text, TopContent, Url, Video } from './contents';
import { Context } from './context';
/**
* CMS decorator which allows delegating each method call to a different
* CMS instance depending on the context (eg. locale)
*/
export declare class MultiContextCms implements CMS {
private readonly cmsFromContext;
constructor(cmsFromContext: (ctx?: Context) => CMS);
asset(id: string, context?: Context): Promise<Asset>;
button(id: string, context?: Context): Promise<Button>;
carousel(id: string, context?: Context): Promise<Carousel>;
chitchat(id: string, context?: Context): Promise<Chitchat>;
content(id: string, context?: Context, referencesToInclude?: number): Promise<Content>;
contents<T extends Content>(contentType: ContentType, context?: Context, paging?: PagingOptions): Promise<T[]>;
assets(context?: Context): Promise<Asset[]>;
contentsWithKeywords(context?: Context, paging?: PagingOptions): Promise<SearchCandidate[]>;
dateRange(id: string, context?: Context): Promise<DateRangeContent>;
document(id: string, context?: Context): Promise<Document>;
element(id: string, context?: Context): Promise<Element>;
image(id: string, context?: Context): Promise<Image>;
video(id: string, context?: Context): Promise<Video>;
queue(id: string, context?: Context): Promise<Queue>;
schedule(id: string, context?: Context): Promise<ScheduleContent>;
startUp(id: string, context?: Context): Promise<StartUp>;
text(id: string, context?: Context): Promise<Text>;
handoff(id: string, context?: Context): Promise<Handoff>;
input(id: string, context?: Context): Promise<Input>;
custom(id: string, context?: Context): Promise<Custom>;
topContents<T extends TopContent>(model: TopContentType, context?: Context, filter?: (cf: CommonFields) => boolean, paging?: PagingOptions): Promise<T[]>;
url(id: string, context?: Context): Promise<Url>;
payload(id: string, context?: Context): Promise<Payload>;
}