/** * 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 { TreeData } from '@finos/legend-art'; import type { EditorStore } from '../EditorStore.js'; import type { EditorState } from './EditorState.js'; import type { Entity } from '@finos/legend-storage'; import { type GenerationConfigurationDescription, type GenerationOutput, ArtifactGenerationExtensionResult } from '@finos/legend-graph'; import { ExternalFormatState } from './ExternalFormatState.js'; import { FileSystem_Directory, type FileSystemTreeNodeData, FileSystem_File, type FileResult } from '../utils/FileSystemTreeUtils.js'; export declare const DEFAULT_GENERATION_SPECIFICATION_NAME = "MyGenerationSpecification"; export type GenerationTypeOption = { value: string; label: string; }; export declare class DEPREACTED_GlobalFileGenerationState { readonly graphGenerationState: GraphGenerationState; readonly editorStore: EditorStore; fileGenerationConfigurations: GenerationConfigurationDescription[]; constructor(graphGenerationState: GraphGenerationState, editorStore: EditorStore); get fileGenerationConfigurationOptions(): GenerationTypeOption[]; get supportedFileGenerationConfigurationsForCurrentElement(): GenerationConfigurationDescription[]; /** * Generated file generations in the graph. * NOTE: This method does not update graph and application only the files are generated. * * Errors are handled (logged + notified) here and returned rather than * re-thrown so the caller can keep generating; the caller owns the * `editor.generation.*` telemetry outcome. */ DEPREACTED_generateFiles(generationOutputIndex: Map): GeneratorFn; setFileGenerationConfigurations(fileGenerationConfigurations: GenerationConfigurationDescription[]): void; getFileGenerationConfiguration(type: string): GenerationConfigurationDescription; fetchAvailableFileGenerationDescriptions(): GeneratorFn; } export declare class GraphGenerationState { editorStore: EditorStore; isRunningGlobalGenerate: boolean; generatedEntities: Map; clearingGenerationEntitiesState: ActionState; externalFormatState: ExternalFormatState; globalFileGenerationState: DEPREACTED_GlobalFileGenerationState; rootFileDirectory: FileSystem_Directory; filesIndex: Map; selectedNode?: FileSystemTreeNodeData | undefined; enableArtifactGeneration: boolean; constructor(editorStore: EditorStore); setEnableArtifactGeneration(val: boolean): void; findGenerationParentPath(genChildPath: string): string | undefined; /** * Global generation is tied to the generation specification of the project. Every time a generation element * is added, they will be added to the generation specification */ globalGenerate(): GeneratorFn; /** * Errors are handled (logged + notified) here and returned rather than * re-thrown; see {@link GraphGenerationState.globalGenerate}. */ generateModels(): GeneratorFn; /** * Generated artifacts generations in graph * NOTE: This method does not update graph and application only the files are generated. * * Errors are handled (logged + notified) here and returned rather than * re-thrown; see {@link GraphGenerationState.globalGenerate}. */ generateArtifacts(): GeneratorFn; processGenerationResult(artifacts: ArtifactGenerationExtensionResult, generationOutputIndex: Map): void; reprocessGenerationFileState(editorState: EditorState): EditorState | undefined; reprocessNodeTree(generationResult: FileResult[], treeData: TreeData, openedNodeIds: string[]): TreeData; onTreeNodeSelect(node: FileSystemTreeNodeData, treeData: TreeData, reprocess?: boolean): void; setSelectedNode(node?: FileSystemTreeNodeData): void; emptyGeneratedArtifacts(): void; /** * Used to clear generation entities as well as the generation model */ clearGenerations(): GeneratorFn; /** * Method adds generation specification if * 1. no generation specification has been defined in graph * 2. there exists a generation element */ possiblyAddMissingGenerationSpecifications(): GeneratorFn; } //# sourceMappingURL=GraphGenerationState.d.ts.map