import { default as BaseModel } from "./BaseModel.js";
export default class ArbiterModel extends BaseModel {
    constructor(options) {
        super(options);
        this.m_parent = options.parent;
    }
    get attributes() {
        return this.state.get("attributes");
    }
    get data() {
        return this.state.get("data");
    }
    get errors() {
        return this.state.get("errors");
    }
    get json() {
        return this.state.get("json");
    }
    get parent() {
        return this.m_parent;
    }
    get properties() {
        return this.state.get("properties");
    }
    get target() {
        return this.state.get("target");
    }
    get innerTarget() {
        return this.state.get("innerTarget");
    }
    get id() {
        return this.state.get("id");
    }
    get targetType() {
        return this.state.get("targetType");
    }
    get type() {
        return this.state.get("type");
    }
    toJSON() {
        let result = {
            attributes: this.attributes,
            data: this.data,
            errors: this.errors,
            properties: this.properties,
            innerTarget: this.innerTarget,
            target: this.target,
            targetType: this.targetType,
            type: this.type
        };
        if (this.id != null) {
            result.id = this.id;
        }
        if (this.json != null) {
            result.json = this.json;
        }
        return result;
    }
}
