import { Field } from 'contensis-core-api'; import { Entry } from 'contensis-management-api'; import { EntryDependencyMeta } from '../models/EntryDependencies'; import { IContensisContext } from '../models/IContensisContext'; import ContensisRepository from '../repositories/ContensisRepository'; export interface IEntryFields { [k: string]: EntryField | EntryField[]; } type ComposerFields = EntryField[]; type ComponentFields = IEntryFields | EntryField[]; type InnerFields = ComponentFields | ComposerFields | undefined; /** * Supplying the field configuration from the target content type, the context containing * the content models for the parent entry *and the target repository, we can take a given value * from the source and build a complete picture of the field specifically for the target entry * checking dependencies and setting flag to trigger a two-pass loading status on the entry if * any dependents do not exist * Using the toJSON method to produce the entry as JSON for loading into the Management API */ export declare class EntryField { #private; field: Field; private value; private entry; private context; private contensis; dependencies: EntryDependencyMeta[]; private parentFields?; private isCanvasField; private currentCanvasBlockId?; private existingEntry?; requireSecondPass: boolean; firstPassValue?: any; finalValue: any; fields: InnerFields; /** log any issues with building the field */ warnings: string[]; get isRequired(): boolean; get isRepeatable(): boolean; get isComposerChild(): boolean | undefined; get isComponent(): boolean; get isComponentChild(): boolean | undefined; get language(): string | undefined; /** * a good indicator that the entry field is being created for a * default entry in a model migration */ get builtContentType(): import("./ContentTypeBuilder").ContentTypeBuilder | undefined; /** * Look for the current value in an existing entry * Only needed for tidying up the diffs for example * some linked content returns `sys.language` in the * management api data and some doesn't so we can map * it if it's already there in the management data and * leave it out if not */ get existingValue(): any; get fieldAndAncestors(): Field[]; get fieldIdPath(): string; get childFieldIdPath(): string | undefined; get parentField(): Field | undefined; constructor(field: Field, value: any, entry: Entry, context: IContensisContext, contensis: ContensisRepository, dependencies: EntryDependencyMeta[], parentFields?: Field[] | undefined, isCanvasField?: boolean); /** * Return a final value for the field, iterating over any built fields if applicable * @returns entry as JSON */ toJSON: (opts?: { firstPass: boolean; }) => any; /** * Check the content type field and process the value from the source entry * setting the first pass and final values */ init: () => void; } export {};