/**
 * 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 { MappingEditorState, MappingElementSource } from '../MappingEditorState.js';
import { type GeneratorFn } from '@finos/legend-shared';
import type { EditorStore } from '../../../../EditorStore.js';
import { type RawLambda, type Runtime, type DEPRECATED__InputData, type DEPRECATED__MappingTestAssert, type Mapping, type DEPRECATED__MappingTest, type ExecutionResult, type ExecutionResultWithMetadata, DEPRECATED__ExpectedOutputMappingTestAssert, DEPRECATED__ObjectInputData, FlatDataInputData, RelationalInputData } from '@finos/legend-graph';
import { LambdaEditorState, ExecutionPlanState } from '@finos/legend-query-builder';
import { MappingEditorTabState } from '../MappingTabManagerState.js';
export declare enum TEST_RESULT {
    NONE = "NONE",// test has not run yet
    ERROR = "ERROR",// test has error
    FAILED = "FAILED",// test assertion failed
    PASSED = "PASSED"
}
export declare class MappingTestQueryState extends LambdaEditorState {
    editorStore: EditorStore;
    test: DEPRECATED__MappingTest;
    isInitializingLambda: boolean;
    query: RawLambda;
    constructor(editorStore: EditorStore, test: DEPRECATED__MappingTest, query: RawLambda);
    get lambdaId(): string;
    setIsInitializingLambda(val: boolean): void;
    updateLamba(val: RawLambda): GeneratorFn<void>;
    convertLambdaObjectToGrammarString(options?: {
        pretty?: boolean | undefined;
        preserveCompilationError?: boolean | undefined;
    }): GeneratorFn<void>;
    convertLambdaGrammarStringToObject(): GeneratorFn<void>;
}
declare abstract class MappingTestInputDataState {
    readonly uuid: string;
    editorStore: EditorStore;
    mapping: Mapping;
    inputData: DEPRECATED__InputData;
    constructor(editorStore: EditorStore, mapping: Mapping, inputData: DEPRECATED__InputData);
    abstract get runtime(): Runtime;
}
export declare class MappingTestObjectInputDataState extends MappingTestInputDataState {
    inputData: DEPRECATED__ObjectInputData;
    /**
     * @workaround https://github.com/finos/legend-studio/issues/68
     */
    data: string;
    constructor(editorStore: EditorStore, mapping: Mapping, inputData: DEPRECATED__ObjectInputData);
    setData(val: string): void;
    get runtime(): Runtime;
}
export declare class MappingTestFlatDataInputDataState extends MappingTestInputDataState {
    inputData: FlatDataInputData;
    get runtime(): Runtime;
}
export declare class MappingTestRelationalInputDataState extends MappingTestInputDataState {
    inputData: RelationalInputData;
    get runtime(): Runtime;
}
declare abstract class MappingTestAssertionState {
    readonly uuid: string;
    assert: DEPRECATED__MappingTestAssert;
    constructor(assert: DEPRECATED__MappingTestAssert);
}
export declare class MappingTestExpectedOutputAssertionState extends MappingTestAssertionState {
    assert: DEPRECATED__ExpectedOutputMappingTestAssert;
    /**
     * @workaround https://github.com/finos/legend-studio/issues/68
     */
    expectedResult: string;
    constructor(assert: DEPRECATED__ExpectedOutputMappingTestAssert);
    setExpectedResult(val: string): void;
}
export declare enum MAPPING_TEST_EDITOR_TAB_TYPE {
    SETUP = "Test Setup",
    RESULT = "Test Result"
}
/**
 * TODO: Remove once migration from `MappingTest_Legacy` to `MappingTest` is complete
 * @deprecated
 */
export declare class DEPRECATED__MappingTestState extends MappingEditorTabState {
    readonly editorStore: EditorStore;
    readonly mappingEditorState: MappingEditorState;
    selectedTab: MAPPING_TEST_EDITOR_TAB_TYPE;
    result: TEST_RESULT;
    test: DEPRECATED__MappingTest;
    runTime: number;
    isSkipped: boolean;
    errorRunningTest?: Error | undefined;
    testExecutionResultText?: string | undefined;
    isRunningTest: boolean;
    isExecutingTest: boolean;
    queryState: MappingTestQueryState;
    inputDataState: MappingTestInputDataState;
    assertionState: MappingTestAssertionState;
    isGeneratingPlan: boolean;
    executionPlanState: ExecutionPlanState;
    testRunPromise: Promise<ExecutionResultWithMetadata> | undefined;
    constructor(editorStore: EditorStore, test: DEPRECATED__MappingTest, mappingEditorState: MappingEditorState);
    get label(): string;
    setIsRunningTest(val: boolean): void;
    setSelectedTab(val: MAPPING_TEST_EDITOR_TAB_TYPE): void;
    setTestRunPromise(promise: Promise<ExecutionResultWithMetadata> | undefined): void;
    buildQueryState(): MappingTestQueryState;
    buildInputDataState(): MappingTestInputDataState;
    buildAssertionState(): MappingTestAssertionState;
    resetTestRunStatus(): void;
    setResult(result: TEST_RESULT): void;
    toggleSkipTest(): void;
    setQueryState(queryState: MappingTestQueryState): void;
    setInputDataState(inputDataState: MappingTestInputDataState): void;
    setAssertionState(assertionState: MappingTestAssertionState): void;
    setInputDataStateBasedOnSource(source: MappingElementSource, populateWithMockData: boolean): void;
    /**
     * Execute mapping using current info in the test detail panel then set the execution result value as test expected result
     */
    regenerateExpectedResult(): GeneratorFn<void>;
    handleResult(result: ExecutionResult): void;
    handleError(error: Error, promise: Promise<ExecutionResultWithMetadata> | undefined): void;
    onTestStateOpen(openTab?: MAPPING_TEST_EDITOR_TAB_TYPE): GeneratorFn<void>;
    updateAssertion(): void;
    runTest(): GeneratorFn<void>;
    cancelTest(): GeneratorFn<void>;
    generatePlan(debug: boolean): GeneratorFn<void>;
}
export {};
//# sourceMappingURL=DEPRECATED__MappingTestState.d.ts.map