/** * Rich Text Utilities * Helpers for working with Notion's rich text format */ export interface RichTextItem { type: 'text'; text: { content: string; link?: { url: string; } | null; }; annotations: { bold: boolean; italic: boolean; strikethrough: boolean; underline: boolean; code: boolean; color: string; }; plain_text?: string; href?: string | null; } export type Color = 'default' | 'gray' | 'brown' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'red'; /** * Create simple rich text */ export declare function text(content: string): RichTextItem; /** * Create bold text */ export declare function bold(content: string): RichTextItem; /** * Create italic text */ export declare function italic(content: string): RichTextItem; /** * Create code text */ export declare function code(content: string): RichTextItem; /** * Create link text */ export declare function link(content: string, url: string): RichTextItem; /** * Create colored text */ export declare function colored(content: string, color: Color): RichTextItem; /** * Apply multiple formatting styles */ export declare function formatText(content: string, options?: { bold?: boolean; italic?: boolean; code?: boolean; strikethrough?: boolean; underline?: boolean; color?: Color; link?: string; }): RichTextItem; /** * Extract plain text from rich text array * Optimized string accumulation avoids creating intermediate arrays * and reduces garbage collection pressure in hot paths. */ export declare function extractPlainText(richText: RichTextItem[] | undefined | null): string; /** * Merge multiple rich text items */ export declare function mergeRichText(...items: RichTextItem[]): RichTextItem[]; /** * Convert string array to rich text */ export declare function fromStrings(strings: string[]): RichTextItem[]; /** * Check if rich text is empty */ export declare function isEmpty(richText: RichTextItem[] | undefined | null): boolean; /** * Truncate rich text to max length */ export declare function truncate(richText: RichTextItem[], maxLength: number): RichTextItem[]; //# sourceMappingURL=richtext.d.ts.map