"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Used to access the root LajiForm instance from a child component.
 */
class RootInstanceService {
    constructor(schema, formData, onChange, validate, submitWithWarnings) {
        this.mounted = false;
        this.schema = schema;
        this.formData = formData;
        this.onChangeCallback = onChange;
        this.validate = validate;
        this.submitWithWarningsCallback = submitWithWarnings;
    }
    setFormData(formData) {
        this.formData = formData;
    }
    getFormData() {
        return this.formData;
    }
    onChange(formData) {
        this.onChangeCallback(formData);
    }
    setSchema(schema) {
        this.schema = schema;
    }
    getSchema() {
        return this.schema;
    }
    validate() {
        this.validateCallback();
    }
    submitWithWarnings() {
        this.submitWithWarningsCallback();
    }
    setIsMounted(mounted) {
        this.mounted = mounted;
    }
    isMounted() {
        return this.mounted;
    }
    setErrorListInstance(instance) {
        this.errorListInstance = instance;
    }
    getErrorListInstance() {
        return this.errorListInstance;
    }
}
exports.default = RootInstanceService;
