Skip to content

PromptScript API


Interface: Formatter

Defined in: compiler/src/types.ts:34

Interface for formatters that convert AST to target format.

Properties

defaultConvention

readonly defaultConvention: string

Defined in: compiler/src/types.ts:42

Default convention for this formatter


description

readonly description: string

Defined in: compiler/src/types.ts:40

Human-readable description


name

readonly name: string

Defined in: compiler/src/types.ts:36

Formatter name (e.g., "github", "claude", "cursor")


outputPath

readonly outputPath: string

Defined in: compiler/src/types.ts:38

Output path pattern

Methods

format()

format(ast, options?): FormatterOutput

Defined in: compiler/src/types.ts:44

Format the AST to target format

Parameters

ast

Program

options?

FormatOptions

Returns

FormatterOutput