import { Location } from 'graphql'; import { ProjectSource } from '../../project/source'; import { MessageLocation } from '../validation/location'; import { Pair } from 'yaml'; export type Change = TextChange | AppendChange | YamlAddInMapChange; /** * A set of changes to one or multiple project sources */ export declare class ChangeSet { readonly changes: ReadonlyArray; readonly textChanges: ReadonlyArray; readonly appendChanges: ReadonlyArray; readonly yamlAddInMapChanges: ReadonlyArray; constructor(changes: ReadonlyArray); static EMPTY: ChangeSet; } /** * A change that either deletes a span in an existing source or replaces that span with new text */ export declare class TextChange { /** * The new text to insert at the location (empty string if the text should just be deleted) */ readonly newText: string; readonly source: ProjectSource; /** * The range of text to delete */ readonly location: MessageLocation; constructor( /** * The range of text to delete */ location: MessageLocation | Location, /** * The new text to insert at the location (empty string if the text should just be deleted) */ newText: string); } /** * A change that creates a new source with a given name or appends text to an existing source * * If there are multiple AppendToNewSource instances with the same sourceName in a changeset, the content of all of them will be appended to the source, separated by two newlines. */ export declare class AppendChange { /** * The name of the new source */ readonly sourceName: string; /** * The text for the new source */ readonly text: string; constructor( /** * The name of the new source */ sourceName: string, /** * The text for the new source */ text: string); } /** * A change that adds the given `value` in source `sourceName` under path `path`. * * **Note**: * - `path` must point to a YAMLMap, otherwise nothing is added * - when the `key` of `value` does already exist in the target map nothing will be added */ export declare class YamlAddInMapChange { readonly args: { readonly sourceName: string; readonly path: unknown[]; readonly value: Pair; }; constructor(args: { readonly sourceName: string; readonly path: unknown[]; readonly value: Pair; }); }