reset

View as MarkdownOpen in Claude

Clear all top-level sections from the builder, returning it to an empty initial state. Also clears the internal section lookup map used by hasSection() and getSection().

Returns

this — returns the builder for fluent chaining.

Example

import { PomBuilder } from '@signalwire/sdk';
const pom = new PomBuilder();
pom.addSection('Intro', { body: 'Welcome.' });
pom.addSection('Rules', { bullets: ['Be nice.', 'Stay on topic.'] });
pom.reset();
console.log(pom.renderMarkdown()); // "" (empty)