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

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