UNPKG

@webuildbots/webuildbots-sdk

Version:
24 lines (23 loc) 969 B
import { Languages } from '../const/languages-enums'; import { DeepPartial } from '../helpers/helpers-types'; import BlockItem from '../interfaces/block-item'; import ChoiceBuilder from './choice/choice-builder'; export default class ItemBuilder { item: DeepPartial<BlockItem>; addTitle(lang: Languages | string, text: string): this; setTitle(polylang: any): this; addSubtitle(lang: Languages | string, text: string): this; setSubtitle(polylang: any): this; /** * This function will only take string as an argument which can be ObjectId or URL * @param media : string * @returns */ image(media: string): this; build(): DeepPartial<BlockItem>; pushChoice<T extends ChoiceBuilder>(cb: T): this; unshiftChoice<T extends ChoiceBuilder>(cb: T): this; setChoices<T extends ChoiceBuilder[]>(choices: T): this; defaultChoice<T extends ChoiceBuilder>(cb: T): this; hasChoice(cb: ChoiceBuilder): boolean; }