Skip to content

PromptScript API


Interface: Formatter

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

Interface for formatters that convert AST to target format.

Properties

defaultConvention

readonly defaultConvention: string

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

Default convention for this formatter


description

readonly description: string

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

Human-readable description


name

readonly name: string

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

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


outputPath

readonly outputPath: string

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

Output path pattern

Methods

format()

format(ast, options?): FormatterOutput

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

Format the AST to target format

Parameters

ast

Program

options?

FormatOptions

Returns

FormatterOutput