import { default as ts } from 'typescript'; import { JsxContext } from './types.ts'; import { TemplatePart } from './templateParts.ts'; /** * Extract comments and whitespace from a node (called "trivia" in TypeScript) */ export declare const getNodeTrivia: (node: ts.Node, context: Pick) => string; /** * Attach trivia comments to a node. * * @remarks * Does not attach whitespace as doing so in TypeScript AST is much harder than * it seems. There is one hacky workaround, but I could easily see it break * something: https://stackoverflow.com/a/69240365/8584605 */ export declare function attachComments(triviaText: string, node: T): T; export declare const findCommentRanges: (trivia: string) => ts.CommentRange[]; /** Convert trivia into parts that can be converted to template expressions */ export declare function triviaToTemplateParts(trivia: string): TemplatePart[];