@finos/legend-application-studio
Version:
Legend Studio application core
94 lines • 4.93 kB
TypeScript
/**
* 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 SPECIAL_REVISION_ALIAS, EntityDiffViewerState } from './EntityDiffEditorState.js';
import { type GeneratorFn } from '@finos/legend-shared';
import { type Entity } from '@finos/legend-storage';
import { ParserError } from '@finos/legend-graph';
import type { AbstractConflictResolutionState } from '../../AbstractConflictResolutionState.js';
import type { EditorState } from '../EditorState.js';
export interface MergeConflict {
startHeader: number;
commonBase?: number | undefined;
splitter: number;
endFooter: number;
}
export interface MergeEditorComparisonViewInfo {
label: string;
fromGrammarText?: string | undefined;
toGrammarText?: string | undefined;
fromRevision: SPECIAL_REVISION_ALIAS | string;
toRevision: SPECIAL_REVISION_ALIAS | string;
}
export declare enum ENTITY_CHANGE_CONFLICT_EDITOR_VIEW_MODE {
MERGE_VIEW = "MERGE_VIEW",
BASE_CURRENT = "BASE_CURRENT",
BASE_INCOMING = "BASE_INCOMING",
CURRENT_INCOMING = "CURRENT_INCOMING"
}
export declare class EntityChangeConflictEditorState extends EntityDiffViewerState {
entityPath: string;
baseRevision: SPECIAL_REVISION_ALIAS | string;
currentChangeRevision: SPECIAL_REVISION_ALIAS | string;
incomingChangeRevision: SPECIAL_REVISION_ALIAS | string;
baseEntity?: Entity | undefined;
currentChangeEntity?: Entity | undefined;
incomingChangeEntity?: Entity | undefined;
baseGrammarText?: string | undefined;
currentChangeGrammarText?: string | undefined;
incomingChangeGrammarText?: string | undefined;
baseEntityGetter?: ((entityPath: string | undefined) => Entity | undefined) | undefined;
currentChangeEntityGetter?: ((entityPath: string | undefined) => Entity | undefined) | undefined;
incomingChangeEntityGetter?: ((entityPath: string | undefined) => Entity | undefined) | undefined;
mergedText?: string | undefined;
mergeSucceeded: boolean;
mergeConflicts: MergeConflict[];
isReadOnly: boolean;
currentMergeEditorConflict?: MergeConflict | undefined;
currentMergeEditorLine?: number | undefined;
mergeEditorParserError?: ParserError | undefined;
currentMode: ENTITY_CHANGE_CONFLICT_EDITOR_VIEW_MODE;
conflictResolutionState: AbstractConflictResolutionState;
constructor(editorStore: EditorStore, conflictResolutionState: AbstractConflictResolutionState, entityPath: string, baseRevision: SPECIAL_REVISION_ALIAS | string, currentChangeRevision: SPECIAL_REVISION_ALIAS | string, incomingChangeRevision: SPECIAL_REVISION_ALIAS | string, baseEntity: Entity | undefined, currentChangeEntity: Entity | undefined, incomingChangeEntity: Entity | undefined, baseEntityGetter?: (entityPath: string | undefined) => Entity | undefined, currentChangeEntityGetter?: (entityPath: string | undefined) => Entity | undefined, incomingChangeEntityGetter?: (entityPath: string | undefined) => Entity | undefined);
setReadOnly(val: boolean): void;
setMergedText(val: string): void;
setCurrentMode(mode: ENTITY_CHANGE_CONFLICT_EDITOR_VIEW_MODE): void;
setCurrentMergeEditorLine(val: number | undefined): void;
setCurrentMergeEditorConflict(conflict: MergeConflict | undefined): void;
clearMergeEditorError(): void;
refreshMergeConflict(): void;
get label(): string;
private get sortedMergedConflicts();
get canUseTheirs(): boolean;
get canUseYours(): boolean;
get canMarkAsResolved(): boolean;
get previousConflict(): MergeConflict | undefined;
get nextConflict(): MergeConflict | undefined;
match(tab: EditorState): boolean;
getModeComparisonViewInfo(mode: ENTITY_CHANGE_CONFLICT_EDITOR_VIEW_MODE): MergeEditorComparisonViewInfo;
resetMergeEditorStateOnLeave(): void;
refresh(): GeneratorFn<void>;
getMergedText(): GeneratorFn<void>;
private getGrammarForEntity;
markAsResolved(): GeneratorFn<void>;
useCurrentChanges(): GeneratorFn<void>;
useIncomingChanges(): GeneratorFn<void>;
acceptCurrentChange(conflict: MergeConflict): void;
acceptIncomingChange(conflict: MergeConflict): void;
acceptBothChanges(conflict: MergeConflict): void;
rejectBothChanges(conflict: MergeConflict): void;
}
//# sourceMappingURL=EntityChangeConflictEditorState.d.ts.map