babel-plugin-debug-macros
Version:
Debug macros and feature flag stripping
24 lines (23 loc) • 930 B
TypeScript
import type * as Babel from '@babel/core';
import type { types as t } from '@babel/core';
import type { NormalizedOptions } from './normalize-options';
import type { NodePath } from '@babel/core';
import type { ImportUtil } from 'babel-import-util';
export default class Macros {
private debugHelpers;
private localDebugBindings;
private builder;
constructor(babel: typeof Babel, options: NormalizedOptions, util: ImportUtil);
/**
* Collects the import bindings for the debug tools.
*/
collectDebugToolsSpecifiers(specifiers: NodePath<t.ImportSpecifier | t.ImportDefaultSpecifier | t.ImportNamespaceSpecifier>[]): void;
/**
* Expands the given expression, if it is simple CallExpression statement for the debug tools.
*/
build(path: NodePath<t.ExpressionStatement>): void;
/**
* Removes obsolete import bindings for the debug tools.
*/
cleanImports(): void;
}