@kubb/parser-ts
Version:
TypeScript parsing and manipulation utilities for Kubb, enabling code generation with proper TypeScript syntax and formatting.
21 lines (17 loc) • 646 B
text/typescript
import ts, { PrinterOptions } from 'typescript';
export { f as factory } from './factory-Cn6Avpxk.cjs';
type PrintOptions = {
source?: string;
baseName?: string;
scriptKind?: ts.ScriptKind;
} & PrinterOptions;
/**
* Convert AST TypeScript nodes to a string based on the TypeScript printer.
* Ensures consistent output across environments.
*/
declare function print(elements: Array<ts.Node>, { source, baseName, removeComments, noEmitHelpers, newLine, scriptKind }?: PrintOptions): string;
/**
* Format the generated code based on Prettier
*/
declare function format(source: string): Promise<string>;
export { format, print };