import type { LintDiagnostic, LintSeverity } from '../types'; export declare const DUPLICATE_COMPONENT_RULE = "component/duplicate-name"; /** A `` declaration and where it is written. */ export interface ComponentDeclaration { name: string; /** Absolute path of the declaring XML file. */ filePath: string; /** Zero-based position of the `name` attribute *value*. */ line: number; column: number; } /** One component name declared by two or more files. */ export interface DuplicateComponentGroup { name: string; /** Two or more declarations, ordered by file path. */ declarations: ComponentDeclaration[]; } export interface DuplicateComponentOptions { severity?: LintSeverity; /** * Files to ignore completely — they are dropped *before* the duplicate count, * so a name whose only surviving declaration is the excluded one is not * reported at all. Use for build-output copies of the source tree. */ isExcluded?: (filePath: string) => boolean; /** * Files a diagnostic may be attached to. Excluded files still *count* toward * the collision — a project component clashing with one from an installed * package is a real conflict — but a warning inside `node_modules` is noise * the user cannot act on, so by default only non-package files are reported. */ isReportable?: (filePath: string) => boolean; /** Renders the other declarations' paths in the message. Defaults to identity. */ displayPath?: (filePath: string) => string; } /** True for files outside any installed package — the default `isReportable`. */ export declare function isProjectFile(filePath: string): boolean; /** * Groups declarations that share a name (case-insensitively). * * SceneGraph component names are global to the channel: `CreateObject( * "roSGNode", "X")` and `` resolve by name alone, with no notion of a * declaring file, so a second declaration silently overrides the first * depending on load order. * * Groups are ordered by name and declarations within a group by file path, so * the output is stable across runs and platforms. */ export declare function findDuplicateComponents(declarations: ComponentDeclaration[], isExcluded?: (filePath: string) => boolean): DuplicateComponentGroup[]; /** The message shown on one declaration, naming the others. */ export declare function duplicateComponentMessage(declaration: ComponentDeclaration, others: ComponentDeclaration[], displayPath?: (filePath: string) => string): string; /** * The whole check: group, then emit one diagnostic per reportable declaration. * * Pure — takes declarations, touches no filesystem — so the CLI project pass and * the editor's incremental component index can share it. */ export declare function duplicateComponentDiagnostics(declarations: ComponentDeclaration[], options?: DuplicateComponentOptions): LintDiagnostic[]; //# sourceMappingURL=duplicateComponents.d.ts.map