/**
 * 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 GeneratorFn, ActionState } from '@finos/legend-shared';
import type { ServiceEditorState } from './ServiceEditorState.js';
import { RuntimeEditorState } from '../../../editor-state/element-editor-state/RuntimeEditorState.js';
import { ExecutionPlanState, LambdaEditorState, LambdaParametersState, LambdaParameterState } from '@finos/legend-application';
import { type ServiceExecution, KeyedExecutionParameter, type PureExecution, type Mapping, type Runtime, type LightQuery, PureSingleExecution, PureMultiExecution, type PackageableElementReference, RawLambda } from '@finos/legend-graph';
import type { EditorStore } from '../../../EditorStore.js';
export declare class ServiceExecutionParameterState extends LambdaParametersState {
    executionState: ServicePureExecutionState;
    constructor(executionState: ServicePureExecutionState);
    openModal(query: RawLambda): void;
    build(query: RawLambda): LambdaParameterState[];
}
export declare abstract class ServiceExecutionState {
    editorStore: EditorStore;
    serviceEditorState: ServiceEditorState;
    execution: ServiceExecution;
    constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: ServiceExecution);
    abstract get serviceExecutionParameters(): {
        query: RawLambda;
        mapping: Mapping;
        runtime: Runtime;
    } | undefined;
}
export declare class UnsupportedServiceExecutionState extends ServiceExecutionState {
    get serviceExecutionParameters(): {
        query: RawLambda;
        mapping: Mapping;
        runtime: Runtime;
    } | undefined;
}
interface QueryImportInfo {
    query: LightQuery;
    content: string;
}
export declare class ServicePureExecutionQueryState extends LambdaEditorState {
    editorStore: EditorStore;
    execution: PureExecution;
    isInitializingLambda: boolean;
    openQueryImporter: boolean;
    queries: LightQuery[];
    selectedQueryInfo?: QueryImportInfo | undefined;
    loadQueriesState: ActionState;
    loadQueryInfoState: ActionState;
    importQueryState: ActionState;
    constructor(editorStore: EditorStore, execution: PureExecution);
    get lambdaId(): string;
    get query(): RawLambda;
    setIsInitializingLambda(val: boolean): void;
    setLambda(val: RawLambda): void;
    setOpenQueryImporter(val: boolean): void;
    setSelectedQueryInfo(query: LightQuery | undefined): GeneratorFn<void>;
    importQuery(): GeneratorFn<void>;
    loadQueries(searchText: string): GeneratorFn<void>;
    updateLamba(val: RawLambda): GeneratorFn<void>;
    convertLambdaObjectToGrammarString(pretty?: boolean): GeneratorFn<void>;
    convertLambdaGrammarStringToObject(): GeneratorFn<void>;
}
export interface ServiceExecutionContext {
    mapping: PackageableElementReference<Mapping>;
    runtime: Runtime;
}
export declare abstract class ServiceExecutionContextState {
    executionContext: ServiceExecutionContext;
    executionState: ServiceExecutionState;
    constructor(executionContext: ServiceExecutionContext, executionState: ServiceExecutionState);
    abstract setMapping(value: Mapping): void;
    abstract setRuntime(value: Runtime): void;
}
export declare class SingleExecutionContextState extends ServiceExecutionContextState {
    executionContext: PureSingleExecution;
    constructor(executionContext: PureSingleExecution, executionState: ServiceExecutionState);
    setMapping(value: Mapping): void;
    setRuntime(value: Runtime): void;
}
export declare class KeyedExecutionContextState extends ServiceExecutionContextState {
    executionContext: KeyedExecutionParameter;
    setMapping(value: Mapping): void;
    setRuntime(value: Runtime): void;
}
export declare abstract class ServicePureExecutionState extends ServiceExecutionState {
    queryState: ServicePureExecutionQueryState;
    execution: PureExecution;
    selectedExecutionContextState: ServiceExecutionContextState | undefined;
    runtimeEditorState?: RuntimeEditorState | undefined;
    isExecuting: boolean;
    isGeneratingPlan: boolean;
    isOpeningQueryEditor: boolean;
    executionResultText?: string | undefined;
    executionPlanState: ExecutionPlanState;
    parameterState: ServiceExecutionParameterState;
    showChangeExecModal: boolean;
    constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureExecution);
    abstract changeExecution(): void;
    isChangeExecutionDisabled(): boolean;
    setShowChangeExecModal(val: boolean): void;
    setOpeningQueryEditor(val: boolean): void;
    setExecutionResultText: (executionResult: string | undefined) => void;
    setQueryState: (queryState: ServicePureExecutionQueryState) => void;
    generatePlan(debug: boolean): GeneratorFn<void>;
    handleExecute(): GeneratorFn<void>;
    execute(): GeneratorFn<void>;
    getExecutionQuery(): RawLambda;
    get serviceExecutionParameters(): {
        query: RawLambda;
        mapping: Mapping;
        runtime: Runtime;
    } | undefined;
    closeRuntimeEditor(): void;
    openRuntimeEditor(): void;
    useCustomRuntime(): void;
    autoSelectRuntimeOnMappingChange(mapping: Mapping): void;
    abstract getInitiallySelectedExecutionContextState(): ServiceExecutionContextState | undefined;
    updateExecutionQuery(): void;
}
export declare class SingleServicePureExecutionState extends ServicePureExecutionState {
    execution: PureSingleExecution;
    selectedExecutionContextState: ServiceExecutionContextState;
    multiExecutionKey: string;
    constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureSingleExecution);
    isChangeExecutionDisabled(): boolean;
    getInitiallySelectedExecutionContextState(): ServiceExecutionContextState;
    setMultiExecutionKey(val: string): void;
    changeExecution(): void;
}
export declare class MultiServicePureExecutionState extends ServicePureExecutionState {
    execution: PureMultiExecution;
    newKeyParameterModal: boolean;
    renameKey: KeyedExecutionParameter | undefined;
    singleExecutionKey: KeyedExecutionParameter | undefined;
    constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureMultiExecution);
    setSingleExecutionKey(val: KeyedExecutionParameter | undefined): void;
    changeExecution(): void;
    setRenameKey(key: KeyedExecutionParameter | undefined): void;
    setNewKeyParameterModal(val: boolean): void;
    setExecutionKey(val: string): void;
    getInitiallySelectedExecutionContextState(): ServiceExecutionContextState | undefined;
    changeKeyedExecutionParameter(value: KeyedExecutionParameter): void;
    deleteKeyExecutionParameter(value: KeyedExecutionParameter): void;
    addExecutionParameter(value: string): void;
    changeKeyValue(key: KeyedExecutionParameter, value: string): void;
}
export {};
//# sourceMappingURL=ServiceExecutionState.d.ts.map