/** * This function takes a file path as input and returns the extension point. * * It searches for the 'src/app/' pattern in the path, * where is one of the valid extension points. * * If the pattern is found, it returns the extension point name; otherwise, it returns null. */ export declare const getExtensionPointFromFilePath: (filePath: string) => string | null; /** * This function extracts the extension point from the import source of hubspot components, hooks, etc. * * In our package, the import can come from different extension points. * The extension point is always in the third segment of the import path. * * For example: * import { useCrmProperties } from '@hubspot/ui-extensions/crm/hooks'; * * It ignores non-extension-point imports, including those that import from other directories such as: * * import { useExtensionContext } from '@hubspot/ui-extensions/hooks'; * * If the import source does not correspond to a known extension point, it returns null. */ export declare const getHubspotImportExtensionPoint: (importSource: string) => string | null; /** * There are some extension points that map to different directory names. * For example, both 'extensions' and 'cards' map to the 'crm' directory. * * This function takes an extension point and returns the corresponding directory name. * If there is no special mapping, it returns the extension point as is. */ export declare const mapExtensionPointToImportDirectory: (extensionPoint: string | null) => string | null; /** * Checks if a relative import escapes the extension point directory boundary. * * Extension points (cards, settings, pages, extensions) must be self-contained. * While relative imports that go outside the extension point directory work locally, * they fail when the project is built and uploaded, as each extension point is * deployed as an independent unit. * * This function: * 1. Identifies the extension point from the file path * 2. Finds the extension point root directory * 3. Resolves the relative import path * 4. Checks if the resolved path is outside the extension point root * * For example, given file: /project/src/app/cards/Component.tsx * - import '../shared/utils' → returns true (escapes cards directory) * - import './utils' → returns false (stays within cards directory) * - import '../nested/Component' → returns false (stays within cards directory) * * @param currentFilePath - The absolute path of the file containing the import * @param importSource - The relative import source string * @returns True if the import goes outside the extension point boundary */ export declare const isImportOutsideExtensionPoint: (currentFilePath: string, importSource: string) => boolean;