/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import type { ImportOptions } from '@babel/helper-module-imports'; import type { NodePath } from '@babel/traverse'; type ImportAdditionOptions = Omit< Partial, 'ensureLiveReference' | 'ensureNoContext' >; import * as t from '@babel/types'; export declare function hoistExpression( path: NodePath, astExpression: t.Expression, ): t.Expression; export declare function pathReplaceHoisted( path: NodePath, astExpression: t.Expression, ): void; export declare function addNamedImport( statementPath: NodePath, as: string, from: string, options: ImportAdditionOptions, ): t.Identifier; export declare function addDefaultImport( statementPath: NodePath, from: string, options: ImportAdditionOptions, ): t.Identifier; export declare function isProgramLevel(path: NodePath): boolean; export declare function getProgramStatement(path: NodePath): NodePath; /** * Checks if a variable with the given name is named exported in the program. * This handles both: * - Direct named exports: `export const x = ...` * - Locally declared named exports: `const x = ...; export { x }` * * Default exports, aliasing and re-exports from other files (e.g., `export { x } from './other'`) are NOT allowed. */ export declare function isVariableNamedExported( path: NodePath, ): boolean;