import type { AbsolutePath } from '@-xun/fs'; import type { PluginObj, PluginPass } from '@babel/core'; import type { EmptyObject } from 'type-fest'; export type AccumulatedMetadata = { /** * Two sets, one containing the accumulated import metadata for all * "type-only" imports and the other containing the same information but for * all "normal" imports. */ imports: { normal: Set; typeOnly: Set; }; }; /** * @see {@link createMetadataAccumulatorPlugin} */ export type PluginAndAccumulator = { /** * The actual metadata accumulator plugin itself. This should be passed into * Babel when calling `babel.transform` etc. */ plugin: PluginObj; /** * A {@link Map} mapping absolute file paths to their accumulated metadata. */ accumulator: Map; }; /** * The options that can be passed to this plugin from babel. */ export type Options = EmptyObject; /** * @internal */ export type State = PluginPass & { opts: Options; }; /** * Create and return a metadata accumulator plugin and corresponding object * containing all accumulated metadata. * * If analyzing source with no originating file path, the accumulator will map * its metadata under the `"/dev/null"` key. */ export declare function createMetadataAccumulatorPlugin(): PluginAndAccumulator;