toYaml

View as MarkdownOpen in Claude

Serialize the entire model to a YAML string. Internally calls toDict() and dumps the result. Restore later via fromYaml().

Parameters

None.

Returns

string — YAML-serialized array of section data.

Example

1import { PromptObjectModel } from '@signalwire/sdk';
2
3const pom = new PromptObjectModel();
4pom.addSection('Intro', { body: 'Welcome.' });
5
6const yaml = pom.toYaml();
7const restored = PromptObjectModel.fromYaml(yaml);