/**
 * 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 type { EditorStore } from '../../../EditorStore.js';
import { ElementEditorState } from '../../../editor-state/element-editor-state/ElementEditorState.js';
import { MAPPING_TEST_EDITOR_TAB_TYPE, DEPRECATED__MappingTestState, TEST_RESULT } from './legacy/DEPRECATED__MappingTestState.js';
import { type GeneratorFn } from '@finos/legend-shared';
import type { TreeNodeData, TreeData } from '@finos/legend-art';
import { type CompilationError, type PackageableElement, Type, Class, Enumeration, Mapping, EnumerationMapping, SetImplementation, InstanceSetImplementation, AssociationImplementation, DEPRECATED__MappingTest, type Store } from '@finos/legend-graph';
import type { MappingElementLabel } from '../../../../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
import type { LegendStudioApplicationPlugin } from '../../../../LegendStudioApplicationPlugin.js';
import type { MappingEditorTabState } from './MappingTabManagerState.js';
import { MappingTestableState } from './testable/MappingTestableState.js';
import { MappingTestMigrationState } from './legacy/MappingTestMigrationState.js';
export interface MappingExplorerTreeNodeData extends TreeNodeData {
    mappingElement: MappingElement;
}
export declare const generateMappingTestName: (mapping: Mapping) => string;
export declare enum MAPPING_EDITOR_TAB {
    CLASS_MAPPINGS = "CLASS_MAPPINGS",
    TEST_SUITES = "TEST_SUITES"
}
export declare enum MAPPING_ELEMENT_SOURCE_ID_LABEL {
    ENUMERATION_MAPPING = "enumerationMapping",
    OPERATION_CLASS_MAPPING = "operationClassMapping",
    PURE_INSTANCE_CLASS_MAPPING = "pureInstanceClassMapping",
    FLAT_DATA_CLASS_MAPPING = "flatDataClassMapping",
    RELATIONAL_CLASS_MAPPING = "relationalClassMapping",
    AGGREGATION_AWARE_CLASS_MAPPING = "aggregationAwareClassMapping"
}
export declare enum MAPPING_ELEMENT_TYPE {
    CLASS = "CLASS",
    ENUMERATION = "ENUMERATION",
    ASSOCIATION = "ASSOCIATION"
}
export declare enum BASIC_SET_IMPLEMENTATION_TYPE {
    OPERATION = "operation",
    INSTANCE = "instance"
}
export type MappingElement = EnumerationMapping | SetImplementation | AssociationImplementation;
/**
 * Mapping element source could be just about anything, even `undefined`
 * We cannot really extend this type since it hinders modularity
 */
export type MappingElementSource = unknown;
export declare const getMappingElementTarget: (mappingElement: MappingElement) => PackageableElement;
export declare const getMappingElementLabel: (mappingElement: MappingElement, editorStore: EditorStore) => MappingElementLabel;
export declare const getMappingElementSource: (mappingElement: MappingElement, plugins: LegendStudioApplicationPlugin[]) => MappingElementSource;
export declare const resolveMappingSourceToStore: (source: MappingElementSource) => Store | undefined;
export declare const getMappingStores: (mapping: Mapping, plugins: LegendStudioApplicationPlugin[]) => Set<Store>;
export declare const getMappingElementType: (mappingElement: MappingElement) => MAPPING_ELEMENT_TYPE;
export declare const createClassMapping: (mapping: Mapping, id: string, _class: Class, setImpType: BASIC_SET_IMPLEMENTATION_TYPE, editorStore: EditorStore) => SetImplementation | undefined;
export declare const createEnumerationMapping: (mapping: Mapping, id: string, enumeration: Enumeration, sourceType: Type) => EnumerationMapping;
export declare const getEmbeddedSetImplementations: (setImpl: InstanceSetImplementation) => InstanceSetImplementation[];
export declare const getAllMappingElements: (mapping: Mapping) => MappingElement[];
export interface MappingElementSpec {
    showTarget: boolean;
    openInAdjacentTab: boolean;
    target?: PackageableElement | undefined;
    postSubmitAction?: (newMappingElement: MappingElement | undefined) => void;
}
export declare class MappingEditorState extends ElementEditorState {
    selectedTab: MAPPING_EDITOR_TAB;
    currentTabState?: MappingEditorTabState | undefined;
    openedTabStates: MappingEditorTabState[];
    mappingExplorerTreeData: TreeData<MappingExplorerTreeNodeData>;
    newMappingElementSpec?: MappingElementSpec | undefined;
    mappingTestableState: MappingTestableState;
    DEPRECATED_mappingTestStates: DEPRECATED__MappingTestState[];
    migrationState: MappingTestMigrationState | undefined;
    isRunningAllTests: boolean;
    allTestRunTime: number;
    constructor(editorStore: EditorStore, element: PackageableElement);
    get mapping(): Mapping;
    buildLegacyTestsStates(): DEPRECATED__MappingTestState[];
    /**
     * This method is used to check if a target is being mapped multiple times, so we can make
     * decision on things like whether we enforce the user to provide an ID for those mapping elements.
     */
    get mappingElementsWithSimilarTarget(): MappingElement[];
    setNewMappingElementSpec(spec: MappingElementSpec | undefined): void;
    setSelectedTab(tab: MAPPING_EDITOR_TAB): void;
    openTab(tabState: MappingEditorTabState): GeneratorFn<void>;
    closeTab(tabState: MappingEditorTabState): GeneratorFn<void>;
    closeAllOtherTabs(tabState: MappingEditorTabState): GeneratorFn<void>;
    closeAllTabs(): void;
    setMappingExplorerTreeNodeData(data: TreeData<MappingExplorerTreeNodeData>): void;
    onMappingExplorerTreeNodeExpand: (node: MappingExplorerTreeNodeData) => void;
    onMappingExplorerTreeNodeSelect: (node: MappingExplorerTreeNodeData) => void;
    getMappingExplorerTreeChildNodes: (node: MappingExplorerTreeNodeData) => MappingExplorerTreeNodeData[];
    reprocessMappingExplorerTree(openNodeFoCurrentTab?: boolean): void;
    openMappingElement(mappingElement: MappingElement, openInAdjacentTab: boolean): void;
    changeClassMappingSourceDriver(setImplementation: InstanceSetImplementation, newSource: MappingElementSource): GeneratorFn<void>;
    private closeMappingElementTabState;
    deleteMappingElement(mappingElement: MappingElement): GeneratorFn<void>;
    /**
     * This will determine if we need to show the new mapping element modal or not
     */
    createMappingElement(spec: MappingElementSpec): void;
    private createMappingElementState;
    reprocess(newElement: Mapping, editorStore: EditorStore): MappingEditorState;
    revealCompilationError(compilationError: CompilationError): boolean;
    clearCompilationError(): void;
    buildExecution(setImpl: SetImplementation): GeneratorFn<void>;
    openMigrationTool(): void;
    closeMigrationTool(): void;
    openTest(test: DEPRECATED__MappingTest, openTab?: MAPPING_TEST_EDITOR_TAB_TYPE): GeneratorFn<void>;
    get testSuiteResult(): TEST_RESULT;
    runTests(): GeneratorFn<void>;
    addTest(test: DEPRECATED__MappingTest): GeneratorFn<void>;
    deleteTest(test: DEPRECATED__MappingTest): GeneratorFn<void>;
    createNewTest(setImplementation: SetImplementation): GeneratorFn<void>;
}
//# sourceMappingURL=MappingEditorState.d.ts.map