import { Filepath } from '../../../core/types/filepath'; import { default as Compiler } from '../../index'; import { TextEdit } from './applyTextEdits'; export interface DiagramViewSyncOperation { operation: 'create' | 'update' | 'delete'; name: string; newName?: string; visibleEntities?: { tables?: Array<{ name: string; schemaName: string; }> | null; stickyNotes?: Array<{ name: string; }> | null; tableGroups?: Array<{ name: string; }> | null; schemas?: Array<{ name: string; }> | null; }; } export interface DiagramViewBlock { name: string; startIndex: number; endIndex: number; } /** * Returns the position of every DiagramView block in `source` * Note that onany lex or parse errors, we return [], as there's no reliable way to detect diagram views from malformed DBML */ export declare function findDiagramViewBlocks(source: string): DiagramViewBlock[]; /** * Synchronizes DiagramView blocks in the DBML source at `filepath`. * * @param filepath The file whose source should be rewritten. Source is * read from the compiler's project layout, which makes the * query multifile-aware. * @param operations Array of operations to apply (create, update, delete). * @param blocks Optional pre-parsed blocks from findDiagramViewBlocks. If * not provided, parses internally. * @returns Object containing the new DBML source code and the text edits applied. */ export declare function syncDiagramView(this: Compiler, filepath: Filepath, operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): { newDbml: string; edits: TextEdit[]; };