import { type TSESLint, type TSESTree } from "@typescript-eslint/utils"; import { type ImportFixIntent } from "./import-fix-coordinator.js"; /** * Matched imported type alias that can be replaced with a canonical name. */ interface ImportedTypeAliasMatch { importedName: string; replacementName: string; sourceValue: string; } /** * Collects imported canonical type alias names that should be replaced by * preferred type-fest utility names. * * @param sourceCode - Source code object for the current file. * @param replacementsByImportedName - Mapping from imported symbol names to * preferred replacement names. * * @returns Map keyed by canonical imported alias name with replacement * metadata. */ export declare const collectImportedTypeAliasMatches: (sourceCode: Readonly, replacementsByImportedName: Readonly>) => ReadonlyMap; /** * Collect direct (non-renamed) named imports for a specific source module. * * @param sourceCode - Source code object for the current file. * @param expectedSourceValue - Module source string to match. * * @returns Set of imported identifier names. */ export declare const collectDirectNamedImportsFromSource: (sourceCode: Readonly, expectedSourceValue: string) => ReadonlySet; /** * Collect local identifier names for a specific named import from a selected * module source. * * @param sourceCode - Source code object for the current file. * @param expectedSourceValue - Module source string to match. * @param expectedImportedName - Imported symbol name to match. * * @returns Set of local identifier names (including aliased locals). */ export declare const collectNamedImportLocalNamesFromSource: (sourceCode: Readonly, expectedSourceValue: string, expectedImportedName: string) => ReadonlySet; /** * Collect local identifier names for namespace imports from a selected module * source. * * @param sourceCode - Source code object for the current file. * @param expectedSourceValue - Module source string to match. * * @returns Set of namespace import local names. */ export declare const collectNamespaceImportLocalNamesFromSource: (sourceCode: Readonly, expectedSourceValue: string) => ReadonlySet; /** * Determine whether a type parameter name is shadowed by any enclosing generic * declaration. * * @param node - Node used as the starting point for ancestor traversal. * @param parameterName - Type parameter name to detect. * * @returns `true` when an ancestor declares a matching type parameter. */ export declare function isTypeParameterNameShadowed(node: Readonly, parameterName: string): boolean; /** * Build a safe type-reference replacement fixer. * * @param node - Type reference node to potentially fix. * @param replacementName - Replacement identifier text. * @param availableReplacementNames - Available direct imported replacement * names. * @param sourceModuleName - Module source used when validating/adding imports. * * @returns Fix function when replacement/import insertion is scope-safe; * otherwise `null`. */ export declare const createSafeTypeReferenceReplacementFix: (node: Readonly, replacementName: string, availableReplacementNames: Readonly>, sourceModuleName?: string, reportFixIntent?: ImportFixIntent) => null | TSESLint.ReportFixFunction; /** * Build a safe whole-type-node replacement fixer with custom replacement text. * * @param node - Type node to potentially replace. * @param replacementName - Replacement symbol name used for import/scope safety * checks. * @param replacementText - Final replacement text to emit. * @param availableReplacementNames - Available direct imported replacement * names. * @param sourceModuleName - Module source used when validating/adding imports. * * @returns Fix function when replacement/import insertion is scope-safe; * otherwise `null`. */ export declare const createSafeTypeNodeTextReplacementFix: (node: Readonly, replacementName: string, replacementText: string, availableReplacementNames: Readonly>, sourceModuleName?: string, reportFixIntent?: ImportFixIntent) => null | TSESLint.ReportFixFunction; /** * Build a safe whole-type-node replacement fixer. * * @param node - Type node to potentially replace. * @param replacementName - Replacement identifier text. * @param availableReplacementNames - Available direct imported replacement * names. * @param sourceModuleName - Module source used when validating/adding imports. * * @returns Fix function when replacement/import insertion is scope-safe; * otherwise `null`. */ export declare const createSafeTypeNodeReplacementFix: (node: Readonly, replacementName: string, availableReplacementNames: Readonly>, sourceModuleName?: string, reportFixIntent?: ImportFixIntent) => null | TSESLint.ReportFixFunction; /** * Build a safe whole-type-node replacement fixer that preserves explicit * readonly wrappers/operators from the original node. * * @param node - Type node to potentially replace. * @param replacementName - Replacement symbol name used for import/scope safety * checks. * @param replacementText - Final replacement text before readonly-preservation * adjustment. * @param availableReplacementNames - Available direct imported replacement * names. * @param sourceModuleName - Module source used when validating/adding imports. * * @returns Fix function when replacement/import insertion is scope-safe; * otherwise `null`. */ export declare const createSafeTypeNodeTextReplacementFixPreservingReadonly: (node: Readonly, replacementName: string, replacementText: string, availableReplacementNames: Readonly>, sourceModuleName?: string, reportFixIntent?: ImportFixIntent) => null | TSESLint.ReportFixFunction; /** * Build a safe whole-type-node replacement fixer that preserves explicit * readonly wrappers/operators from the original node. * * @param node - Type node to potentially replace. * @param replacementName - Replacement identifier text. * @param availableReplacementNames - Available direct imported replacement * names. * @param sourceModuleName - Module source used when validating/adding imports. * * @returns Fix function when replacement/import insertion is scope-safe; * otherwise `null`. */ export declare const createSafeTypeNodeReplacementFixPreservingReadonly: (node: Readonly, replacementName: string, availableReplacementNames: Readonly>, sourceModuleName?: string, reportFixIntent?: ImportFixIntent) => null | TSESLint.ReportFixFunction; export {}; //# sourceMappingURL=imported-type-aliases.d.ts.map