import { BabelFileResult } from '@babel/core';
import type { NodePath, TraverseOptions } from '@babel/traverse';
import * as t from '@babel/types';
import prettier from 'prettier';
import { OpenFile } from './fs';
export declare type JSXNode = t.JSXElement['children'][0];
export declare type TransformResult = TransformResultSuccess | TransformResultError;
export declare type TransformResultSuccess = {
    type: 'success';
    babelResult: BabelFileResult;
};
export declare type TransformResultError = {
    type: 'error';
    error: Error;
};
export declare function transformCode(inputCode: string, visitor: TraverseOptions): TransformResult;
export declare type TransformNodeResultSuccess<R> = {
    type: 'success';
    file: OpenFile;
    code: string;
    visitorResult?: R;
};
export declare function transformNodeInCode<T extends Node, R>(domNode: T, visitor: (path: NodePath<T extends Element ? t.JSXElement : JSXNode>) => R, dirHandle: FileSystemDirectoryHandle, options?: {
    preferAncestor?: 'parent' | 'owner' | 'none';
    prettierConfig?: prettier.Options;
}): Promise<TransformNodeResultSuccess<R> | {
    type: 'error';
}>;
export declare function writeTransformationResultToFile(transformResult: TransformNodeResultSuccess<unknown>): Promise<void>;
export declare function isNotEmptyNode(node: JSXNode): boolean;
//# sourceMappingURL=ast.d.ts.map