import { Filepath } from '../../../core/types/filepath'; import { default as Compiler } from '../../index'; import { TableIdentifier } from './types'; /** * Renames a table across every file in the project layout. * * Resolution starts in `filepath`'s scope. Two paths: * * 1. **Alias rename.** `filepath` introduces a use specifier with an alias * whose name matches `oldName` (e.g. `use { table users as u }` and * `oldName === 'u'`). Only `filepath` is rewritten - the alias token is * replaced and every reference to the alias inside `filepath` is updated. * The original declaration in another file is left alone. * * 2. **Real-declaration rename.** Otherwise the resolved symbol is the real * table (or a `UseSymbol` that imports the source name without an alias). * Both the declaring file and every file that imports the table by its * direct name are rewritten - declaration name, in-scope refs, use * specifier source-name tokens, and refs that flow through unaliased * imports. * * Returns a map of absolute file paths to new source content, containing * only the files that were actually changed by the rename. An empty map * indicates a no-op (lookup miss, name collision, or alias rename attempt). */ export declare function renameTable(this: Compiler, filepath: Filepath, oldName: string | TableIdentifier, newName: string | TableIdentifier): Map;