import { Component, ContentType, Field } from 'contensis-core-api'; import { FormContentType } from '../models/FormContentTypeManagement'; import { IContensisContext } from '../models/IContensisContext'; import ContensisRepository from '../repositories/ContensisRepository'; export type ContentTypeFields = { [k: string]: ContentTypeField; }; /** * 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 ContentTypeField { #private; field: Field; parent: Field | undefined; existing: Field | undefined; private resource; private context; private contensis; requireSecondPass: boolean; /** * [defaultId, originalId] */ defaults: [string, string][]; /** * [rejectedId, existingId] * when we have opted to use an existing default and we might not * need to migrate the default entry after all */ rejectedDefaults: [string, string][]; private _firstPassValue?; private _finalValue; fields: ContentTypeFields | ContentTypeField[] | undefined; set firstPassValue(value: Field | undefined); get firstPassValue(): Field | undefined; set finalValue(value: Field); get finalValue(): Field; constructor(field: Field, // from the source content type parent: Field | undefined, // from the source content type existing: Field | undefined, // from the target content type resource: ContentType | Component | FormContentType, context: IContensisContext, contensis: ContensisRepository); /** * Return a final value for the field, iterating over any built fields if applicable * @returns entry as JSON */ toJSON: (opts?: { firstPass: boolean; }) => Field; /** * Check the content type field for any special types and process various values * setting the first pass and final values */ check: () => void; }