import type { ProjectContext } from '../project-context.js'; import ts from 'typescript'; /** * Checks whether the imported module only specifies its module in the import path, * rather than the full or relative path to where it's located: * * import lodash from 'lodash'; --> Correct * import foo from './foo.js'; --> Incorrect * * @param importPath - The path to check * @returns True of the path represents a bare module specifier */ export declare function isBareModuleSpecifier(importPath: string): boolean; /** * Checks whether the import path is from a third party library * * @param path - The import path * @returns True if the path is from a third party library */ export declare function isThirdParty(path: string): boolean; /** * Returns the path where the node is defined. * * @param node - The node to find * @param context - The analyzer context where the node belongs to * @returns The path where the node is defined */ export declare function getOriginalImportPath(node: ts.Identifier | undefined, context: ProjectContext): string; /** * Checks whether the import path matches a path defined in the `tsconfig.json`. * * @see https://www.typescriptlang.org/tsconfig#paths * @param importPath - The import path * @param compilerOptions - The TypeScript compiler options from the analyzer context * @returns True if the import has been re-map */ export declare function matchesTsConfigPath(importPath: string, compilerOptions: ts.CompilerOptions): boolean; /** * Checks if the import declaration node is a default import. * * Example: * * import defaultExport from 'foo'; * * @param node - The node to check * @returns True if the declaration is a default import */ export declare function isDefaultImport(node: ts.ImportDeclaration): boolean; /** * Checks if the import declaration node is a named import * * Example: * * import {namedA, namedB} from 'foo'; * * @param node - The node to check * @returns True if the declaration is a named import */ export declare function isNamedImport(node: ts.ImportDeclaration): boolean; /** * Checks if the import declaration node is a namespace import * * Example: * * import * as name from './my-module.js'; * * @param node - The node to check * @returns True if the declaration is a namespace import */ export declare function isNamespaceImport(node: ts.ImportDeclaration): boolean; /** * Checks whether the import declaration has side effects * * Example: * * import './my-module.js'; * * @param node - The node to check * @returns True if the import has side effects */ export declare function isSideEffectImport(node: ts.ImportDeclaration): boolean; //# sourceMappingURL=import.d.ts.map