UNPKG

idea-toolbox

Version:
41 lines (40 loc) 1.28 kB
import { Resource } from './resource.model'; import { CustomSectionMeta } from './customSectionMeta.model'; import { Languages } from './languages.model'; export declare class CustomBlockMeta extends Resource { /** * Ordered list of the sections (names) to expect in the block. * Example: `['flowers', 'burgers', ...]`. */ sectionsLegend: string[]; /** * Object containg attributes of type CustomSectionMeta; e.g. * ´´´ * fields.flowers: CustomSectionMeta; * fields.burgers: CustomSectionMeta; * ... * ``` */ sections: CustomSectionsMeta; load(x: any, languages: Languages): void; validate(languages: Languages): string[]; /** * Set the default values of the specified sections. */ setSectionsDefaultValues(): any; /** * Load the values of the specified sections. * @param newSections the values to set in the sections */ loadSections(newSections: any): any; /** * Validate the sections and return an array with errors, if any. */ validateSections(sections: any): string[]; } /** * Dynamic object that supports only _key -> values_ of type CustomSectionMeta. */ export interface CustomSectionsMeta { [index: string]: CustomSectionMeta; }