Skip to content

index

Estimated time to read: 3 minutes

POML TypeScript API


Functions

_readWithFile()

_readWithFile(element, options?, context?, stylesheet?, sourcePath?): Promise\<[string, undefined | PomlFile]>

Defined in: packages/poml/index.ts:42

Parameters

element

string | ReactElement\<unknown, string | JSXElementConstructor\<any>>

options?

PomlReaderOptions

context?
stylesheet?
sourcePath?

string

Returns

Promise\<[string, undefined | PomlFile]>


clearTrace()

clearTrace(): void

Defined in: packages/poml/util/trace.ts:54

Returns

void


commandLine()

commandLine(args): Promise\<void>

Defined in: packages/poml/index.ts:147

Parameters

args

CliArgs

Returns

Promise\<void>


dumpTrace()

dumpTrace(markup, context?, stylesheet?, result?, sourcePath?, prettyResult?): void

Defined in: packages/poml/util/trace.ts:98

Parameters

markup

string

context?

any

stylesheet?

any

result?

any

sourcePath?

string

prettyResult?

string

Returns

void


parseJsonWithBuffers()

parseJsonWithBuffers(text): any

Defined in: packages/poml/util/trace.ts:22

Parameters

text

string

Returns

any


poml()

poml(element): Promise\<RichContent>

Defined in: packages/poml/index.ts:114

Parameters

element

string | ReactElement\<unknown, string | JSXElementConstructor\<any>>

Returns

Promise\<RichContent>


read()

read(element, options?, context?, stylesheet?, sourcePath?): Promise\<string>

Defined in: packages/poml/index.ts:17

Parameters

element

string | ReactElement\<unknown, string | JSXElementConstructor\<any>>

options?

PomlReaderOptions

context?
stylesheet?
sourcePath?

string

Returns

Promise\<string>


setTrace()

setTrace(enabled, dir?): undefined | string

Defined in: packages/poml/util/trace.ts:34

Parameters

enabled

boolean = true

dir?

string

Returns

undefined | string


write()

Entry point for turning a parsed IR string into rich content or a list of speaker messages. The heavy lifting is done by EnvironmentDispatcher.

Call Signature

write(ir, options?): RichContent

Defined in: packages/poml/index.ts:82

Parameters
ir

string

options?

WriteOptionsNoSpeakerMode

Returns

RichContent

Call Signature

write(ir, options): Message[]

Defined in: packages/poml/index.ts:83

Parameters
ir

string

options

WriteOptionsSpeakerMode

Returns

Message[]

Call Signature

write(ir, options?): RichContent | Message[]

Defined in: packages/poml/index.ts:84

Parameters
ir

string

options?

WriteOptions

Returns

RichContent | Message[]


writeWithSourceMap()

Variant of write that also exposes a source map describing the mapping between input indices and output content.

Call Signature

writeWithSourceMap(ir, options?): SourceMapRichContent[]

Defined in: packages/poml/index.ts:98

Parameters
ir

string

options?

WriteOptionsNoSpeakerMode

Returns

SourceMapRichContent[]

Call Signature

writeWithSourceMap(ir, options): SourceMapMessage[]

Defined in: packages/poml/index.ts:99

Parameters
ir

string

options

WriteOptionsSpeakerMode

Returns

SourceMapMessage[]

Call Signature

writeWithSourceMap(ir, options?): SourceMapRichContent[] | SourceMapMessage[]

Defined in: packages/poml/index.ts:100

Parameters
ir

string

options?

WriteOptions

Returns

SourceMapRichContent[] | SourceMapMessage[]