@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
32 lines (31 loc) • 1.25 kB
TypeScript
import * as cms from '../cms';
import { CMS } from '../cms';
import { ContentfulCredentials, ContentfulOptions } from '../plugin';
/**
* Set it to ContentfulOptions.contentfulFactory to connect to
* different Contentful environments depending on the Context's Locale
* for each call to CMS
*/
export declare function multiEnvironmentFactory(environmentByLocale?: {
[locale: string]: ContentfulCredentials;
}): (contOptions: ContentfulOptions) => CMS;
/**
* Creates a different Contentful environments for each configured Locale.
* When the call to CMS does not specify a locale, it uses the credentials from
* ContentfulOptions and it informs through the logger
*/
export declare class MultiEnvironmentFactory {
private readonly environmentByLocale?;
private readonly contentfulFactory;
private readonly logger;
private cache;
private defaultCms;
constructor(environmentByLocale?: {
[locale: string]: ContentfulCredentials;
} | undefined, contentfulFactory?: (o: ContentfulOptions) => cms.CMS, logger?: {
(...data: any[]): void;
(message?: any, ...optionalParams: any[]): void;
});
get(contOptions: ContentfulOptions, ctx?: cms.Context): CMS;
private getCredentials;
}