
import { Doc } from "../../../../../fields/Doc";
import { Docs } from "../../../../documents/Documents";
import { DynamicField } from "./FieldTypes/DynamicField";
import { Field, FieldSettings, ViewType } from "./FieldTypes/Field";
import {  } from "./FieldTypes/FieldUtils";
import { } from "./FieldTypes/StaticField";
import { TemplateDocInfos } from "./TemplateBackend";

export class Template {

    mainField: DynamicField;

    constructor(templateInfo: FieldSettings) {
        this.mainField = this.setupMainField(templateInfo);
    }

    get childFields(): Field[] { return this.mainField.getSubfields };
    get allFields(): Field[] { return this.mainField.getAllSubfields };

    setupMainField = (templateInfo: FieldSettings) => {
        return new DynamicField(templateInfo, ViewType.FREEFORM, 0);
    }

}