@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
81 lines (80 loc) • 3.21 kB
TypeScript
import { OnFinish } from '../contents';
import { CarouselBuilder, DocumentBuilder, ElementBuilder, HandoffBuilder, InputBuilder, MediaBuilder, StartUpBuilder, TextBuilder, TopContentBuilder } from '../factories/content-factories';
import { Button, Callback, Element, Text, TopContentId } from '../index';
/**
* The Builder classes below create Content instances with minimal effort
* to speedup the implementation of unit tests by setting random values for the
* non specified fields.
* They are exported by the plugin so that the can be used in bots' unit tests
*/
export declare function rndStr(): string;
export declare function rndBool(): boolean;
export declare class ContentCallbackBuilder {
callback: Callback | undefined;
withContentId(contentId: TopContentId): ContentCallbackBuilder;
build(): Callback;
}
export declare class RndButtonsBuilder {
name: string | undefined;
text: string | undefined;
buttons: Button[];
callbackBuilder: ContentCallbackBuilder;
callback: Callback | undefined;
build(): Button[];
withCallback(callback: Callback): this;
withName(name: string): this;
withText(text: string): this;
addButton(): this;
}
export declare class RndTopContentBuilder {
keywords: never[];
withRandomFields(builder: TopContentBuilder): void;
}
export declare class RndTextBuilder extends TextBuilder {
buttonsBuilder: RndButtonsBuilder;
readonly topComponentBuilder: RndTopContentBuilder;
constructor(name?: string, text?: string);
/** @deprecated use buttonsBuilder */
withButtonsBuilder(): RndButtonsBuilder;
build(): Text;
withRandomFields(): this;
}
export declare class RndElementBuilder extends ElementBuilder {
private buttonsBuilder;
constructor();
withButtonsBuilder(): RndButtonsBuilder;
withButtons(buttons: Button[]): this;
withRandomFields(): this;
build(): Element;
}
export declare class RndCarouselBuilder extends CarouselBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
readonly elementBuilder: RndElementBuilder;
constructor(name?: string);
withRandomFields(numElements?: number): this;
}
export declare class RndStartUpBuilder extends StartUpBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
readonly buttonsBuilder: RndButtonsBuilder;
constructor(name?: string, text?: string);
withRandomFields(): this;
}
export declare class RndMediaBuilder extends MediaBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
constructor(name?: string, mediaUrl?: string);
withRandomFields(): this;
}
export declare class RndDocumentBuilder extends DocumentBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
constructor(name?: string, docUrl?: string);
withRandomFields(): this;
}
export declare class RndHandoffBuilder extends HandoffBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
constructor(name?: string, onFinish?: OnFinish);
withRandomFields(): this;
}
export declare class RndInputBuilder extends InputBuilder {
readonly topComponentBuilder: RndTopContentBuilder;
constructor(name?: string, keywords?: string[], target?: Callback);
}