/** * Static utility methods for blog content processing. * * @example * ```ts * import BlogUtils from '@leafpad/blogs'; * * BlogUtils.calculateReadTime(post.htmlContent); // '4 min read' * BlogUtils.formatDate(post.createdAt); // 'January 15, 2024' * BlogUtils.slugify('Hello World!'); // 'hello-world' * ``` */ export default class BlogUtils { /** * Utility: Calculate reading time for content */ static calculateReadTime(content: string): string; /** * Utility: Format date for display */ static formatDate(dateString: string, options?: Intl.DateTimeFormatOptions): string; /** * Utility: Extract text content from HTML */ static extractTextFromHtml(html: string, maxLength?: number): string; /** * Convert text to a URL-safe slug. * Lowercases, removes special characters, replaces spaces/underscores with hyphens. * @example `"Hello World!"` → `"hello-world"` */ static slugify(text: string): string; /** * Attach an IntersectionObserver to a TOC element by id. * Call this client-side after the page has rendered. * @param tocId - The id of the TOC container element (default: 'toc') * @returns `{ observer, destroy }` — call `destroy()` on component unmount */ static attachTocListener(tocId?: string): { observer: IntersectionObserver; destroy: () => void; }; } //# sourceMappingURL=BlogUtils.d.ts.map