/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { computed, makeObservable, observable, override } from 'mobx';
import { PackageableElementReference } from '../../../graph/metamodel/pure/packageableElements/PackageableElementReference.js';
import { observe_Abstract_PackageableElement, observe_PackageableElementReference, skipObserved, } from './CoreObserverHelper.js';
export const observe_ConfigurationProperty = skipObserved((metamodel) => makeObservable(metamodel, {
    name: observable,
    value: observable.ref,
    hashCode: computed,
}));
export const observe_FileGenerationSpecification = skipObserved((metamodel) => {
    observe_Abstract_PackageableElement(metamodel);
    makeObservable(metamodel, {
        type: observable,
        generationOutputPath: observable,
        scopeElements: observable,
        configurationProperties: observable,
        _elementHashCode: override,
    });
    metamodel.scopeElements.forEach((scopeElement) => {
        if (scopeElement instanceof PackageableElementReference) {
            observe_PackageableElementReference(scopeElement);
        }
    });
    metamodel.configurationProperties.forEach(observe_ConfigurationProperty);
    return metamodel;
});
export const observe_GenerationTreeNode = skipObserved((metamodel) => {
    makeObservable(metamodel, {
        id: observable,
        hashCode: computed,
    });
    observe_PackageableElementReference(metamodel.generationElement);
    return metamodel;
});
export const observe_GenerationSpecification = skipObserved((metamodel) => {
    observe_Abstract_PackageableElement(metamodel);
    makeObservable(metamodel, {
        generationNodes: observable,
        fileGenerations: observable,
        _elementHashCode: override,
    });
    metamodel.generationNodes.forEach(observe_GenerationTreeNode);
    metamodel.fileGenerations.forEach(observe_PackageableElementReference);
    return metamodel;
});
//# sourceMappingURL=DSL_Generation_ObserverHelper.js.map