toDict

View as MarkdownOpen in Claude

Convert the POM to a list of section data objects. Useful for serializing the POM for storage or passing to other components.

Parameters

None.

Returns

PomSectionData[] — Serialized section list. Each object contains keys like "title", "body", and "bullets".

Example

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4pom.addSection('Role', { body: 'You are a helpful assistant.' });
5
6const data = pom.toDict();
7console.log(JSON.stringify(data, null, 2));