/**
 * 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 type { IngestDeploymentServerConfig } from '@finos/legend-server-lakehouse';
import { type GeneratorFn } from '@finos/legend-shared';
import { ElementEditorState } from './ElementEditorState.js';
import type { RuntimeExplorerTreeNodeData } from '../../utils/TreeUtils.js';
import type { TreeData } from '@finos/legend-art';
import { ConnectionEditorState } from './connection/ConnectionEditorState.js';
import { type PackageableElement, type Mapping, type Connection, type PackageableConnection, type SetImplementation, type PackageableElementReference, PackageableRuntime, Runtime, EngineRuntime, IdentifiedConnection, Store, Class, LakehouseRuntime } from '@finos/legend-graph';
export declare const getClassMappingStore: (setImplementation: SetImplementation, editorStore: EditorStore) => Store | undefined;
/**
 * Since model connection are pretty tedious to add, we automatically create new connections for mapped classes
 * as we add/change mapping for the runtime
 *
 * NOTE: as of now, to be safe and simple, we will not remove the connections as we remove the mapping from the runtime
 */
export declare const decorateRuntimeWithNewMapping: (runtime: Runtime, mapping: Mapping, editorStore: EditorStore) => void;
export declare const isConnectionForStore: (connection: Connection, store: Store) => boolean;
export declare const isConnectionForModelStoreWithClass: (connection: Connection, _class: Class) => boolean;
export declare const getConnectionsForModelStoreWithClass: (connections: Connection[], _class: Class) => Connection[];
/**
 * Derive the stores from the runtime's mappings and then partition the list of runtime's connections based on the store
 */
export declare const getRuntimeExplorerTreeData: (runtime: Runtime, editorStore: EditorStore) => TreeData<RuntimeExplorerTreeNodeData>;
export declare abstract class RuntimeEditorTabState {
    readonly uuid: string;
    editorStore: EditorStore;
    runtimeEditorState: EngineRuntimeEditorState;
    constructor(editorStore: EditorStore, runtimeEditorState: EngineRuntimeEditorState);
}
export declare class IdentifiedConnectionEditorState {
    editorStore: EditorStore;
    idenfitiedConnection: IdentifiedConnection;
    connectionEditorState: ConnectionEditorState;
    constructor(editorStore: EditorStore, idenfitiedConnection: IdentifiedConnection);
}
export declare abstract class IdentifiedConnectionsEditorTabState extends RuntimeEditorTabState {
    identifiedConnectionEditorState?: IdentifiedConnectionEditorState | undefined;
    constructor(editorStore: EditorStore, runtimeEditorState: EngineRuntimeEditorState);
    openIdentifiedConnection(identifiedConnection: IdentifiedConnection): void;
    addIdentifiedConnection(packageableConnection?: PackageableConnection): void;
    getConnectionEditorState(): ConnectionEditorState | undefined;
    abstract get identifiedConnections(): IdentifiedConnection[];
    abstract get packageableConnections(): PackageableConnection[];
    abstract createDefaultConnection(): Connection;
    abstract deleteIdentifiedConnection(identifiedConnection: IdentifiedConnection): void;
}
export declare class IdentifiedConnectionsPerStoreEditorTabState extends IdentifiedConnectionsEditorTabState {
    store: Store;
    constructor(editorStore: EditorStore, runtimeEditorState: EngineRuntimeEditorState, store: Store);
    get identifiedConnections(): IdentifiedConnection[];
    get packageableConnections(): PackageableConnection[];
    createDefaultConnection(): Connection;
    deleteIdentifiedConnection(identifiedConnection: IdentifiedConnection): void;
}
export declare class IdentifiedConnectionsPerClassEditorTabState extends IdentifiedConnectionsEditorTabState {
    class: Class;
    constructor(editorStore: EditorStore, runtimeEditorState: EngineRuntimeEditorState, _class: Class);
    get identifiedConnections(): IdentifiedConnection[];
    get packageableConnections(): PackageableConnection[];
    createDefaultConnection(): Connection;
    deleteIdentifiedConnection(identifiedConnection: IdentifiedConnection): void;
}
export declare class RuntimeEditorRuntimeTabState extends RuntimeEditorTabState {
}
export declare class EngineRuntimeEditorState {
    editorStore: EditorStore;
    state: RuntimeEditorState;
    runtimeValue: EngineRuntime;
    explorerTreeData: TreeData<RuntimeExplorerTreeNodeData>;
    currentTabState?: RuntimeEditorTabState | undefined;
    constructor(state: RuntimeEditorState, value: EngineRuntime);
    setExplorerTreeData(treeData: TreeData<RuntimeExplorerTreeNodeData>): void;
    addMapping(mapping: Mapping): void;
    deleteMapping(mappingRef: PackageableElementReference<Mapping>): void;
    changeMapping(mappingRef: PackageableElementReference<Mapping>, newVal: Mapping): void;
    addIdentifiedConnection(identifiedConnection: IdentifiedConnection): void;
    openTabFor(tabElement: Runtime | Store | Class): void;
    decorateRuntimeConnections(): void;
    cleanUpDecoration(): void;
    onExplorerTreeNodeExpand: (node: RuntimeExplorerTreeNodeData) => void;
    onExplorerTreeNodeSelect: (node: RuntimeExplorerTreeNodeData) => void;
    isTreeNodeSelected: (node: RuntimeExplorerTreeNodeData) => boolean;
    getExplorerTreeChildNodes: (node: RuntimeExplorerTreeNodeData) => RuntimeExplorerTreeNodeData[];
    reprocessRuntimeExplorerTree(): void;
    /**
     * If the currently opened connection tab is a connection pointer whose store/source class has been changed, we will
     * remove this tab and switch to default runtime tab
     */
    reprocessCurrentTabState(): void;
}
export declare enum LakehouseRuntimeType {
    ENVIRONMENT = "ENVIRONMENT",
    CONNECTION = "CONNECTION"
}
export declare class LakehouseRuntimeEditorState extends EngineRuntimeEditorState {
    runtimeValue: LakehouseRuntime;
    availableEnvs: IngestDeploymentServerConfig[] | undefined;
    lakehouseRuntimeType: LakehouseRuntimeType;
    constructor(state: RuntimeEditorState, value: LakehouseRuntime);
    setLakehouseRuntimeType(val: LakehouseRuntimeType): void;
    setConnection(val: PackageableConnection | undefined): void;
    get envOptions(): {
        label: string;
        value: string;
    }[];
    convertEnvToOption(val: IngestDeploymentServerConfig): {
        label: string;
        value: string;
    };
    setEnvSummaries(val: IngestDeploymentServerConfig[] | undefined): void;
    fetchLakehouseSummaries(token?: string | undefined): GeneratorFn<void>;
}
export declare class RuntimeEditorState {
    /**
     * NOTE: used to force component remount on state change
     */
    readonly uuid: string;
    editorStore: EditorStore;
    runtime: Runtime;
    runtimeValueEditorState: EngineRuntimeEditorState;
    isEmbeddedRuntime: boolean;
    constructor(editorStore: EditorStore, runtime: Runtime, isEmbeddedRuntime: boolean);
}
export declare class PackageableRuntimeEditorState extends ElementEditorState {
    runtimeEditorState: RuntimeEditorState;
    constructor(editorStore: EditorStore, packageableRuntime: PackageableElement);
    get runtime(): PackageableRuntime;
    reprocess(newElement: PackageableElement, editorStore: EditorStore): ElementEditorState;
}
//# sourceMappingURL=RuntimeEditorState.d.ts.map