UNPKG

@finos/legend-studio

Version:
74 lines 3.86 kB
/** * 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 } from '@finos/legend-shared'; import { type GenerationTreeNodeData, type GenerationOutputResult, GenerationDirectory, GenerationFile } from '../shared/FileGenerationTreeUtil.js'; 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-model-storage'; import { type GenerationConfigurationDescription, type GenerationOutput } from '@finos/legend-graph'; import { ExternalFormatState } from './ExternalFormatState.js'; export declare const DEFAULT_GENERATION_SPECIFICATION_NAME = "MyGenerationSpecification"; export declare type FileGenerationTypeOption = { value: string; label: string; }; export declare class GraphGenerationState { editorStore: EditorStore; isRunningGlobalGenerate: boolean; generatedEntities: Map<string, Entity[]>; isClearingGenerationEntities: boolean; externalFormatState: ExternalFormatState; fileGenerationConfigurations: GenerationConfigurationDescription[]; rootFileDirectory: GenerationDirectory; filesIndex: Map<string, GenerationFile>; selectedNode?: GenerationTreeNodeData | undefined; constructor(editorStore: EditorStore); get fileGenerationConfigurationOptions(): FileGenerationTypeOption[]; get supportedFileGenerationConfigurationsForCurrentElement(): GenerationConfigurationDescription[]; findGenerationParentPath(genChildPath: string): string | undefined; setFileGenerationConfigurations(fileGenerationConfigurations: GenerationConfigurationDescription[]): void; getFileGenerationConfiguration(type: string): GenerationConfigurationDescription; fetchAvailableFileGenerationDescriptions(): GeneratorFn<void>; /** * 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<void>; generateModels(): GeneratorFn<void>; /** * Generated file generations in the graph. * NOTE: This method does not update graph and application only the files are generated. */ generateFiles(): GeneratorFn<void>; /** * Used to clear generation entities as well as the generation model */ clearGenerations(): GeneratorFn<void>; /** * Method adds generation specification if * 1. no generation specification has been defined in graph * 2. there exists a generation element */ possiblyAddMissingGenerationSpecifications(): GeneratorFn<void>; processGenerationResult(generationOutputIndex: Map<string, GenerationOutput[]>): void; reprocessGenerationFileState(editorState: EditorState): EditorState | undefined; reprocessNodeTree(generationResult: GenerationOutputResult[], treeData: TreeData<GenerationTreeNodeData>, openedNodeIds: string[]): TreeData<GenerationTreeNodeData>; onTreeNodeSelect(node: GenerationTreeNodeData, treeData: TreeData<GenerationTreeNodeData>, reprocess?: boolean): void; setSelectedNode(node?: GenerationTreeNodeData): void; emptyFileGeneration(): void; } //# sourceMappingURL=GraphGenerationState.d.ts.map