/** * Timeline Diagram Wrapper Class * * A unified API for building, mutating, and querying timeline diagrams. * Provides a fluent interface that wraps the TimelineAST. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { RenderOptions } from './types/render-options.js'; import type { TimelineAST, TimelineEvent, TimelinePeriod, TimelineSection } from './types/timeline.js'; /** * Query options for finding periods */ export interface FindTimelinePeriodsQuery { /** Find periods in this section */ section?: string; /** Find periods whose name contains this string */ nameContains?: string; /** Find periods with events */ hasEvents?: boolean; } /** * Query options for finding events */ export interface FindTimelineEventsQuery { /** Find events in this section */ section?: string; /** Find events in this period */ period?: string; /** Find events whose text contains this string */ textContains?: string; } /** * A fluent wrapper for TimelineAST that supports building, mutating, and querying. */ export declare class Timeline extends DiagramWrapper { private constructor(); /** * Create a new empty timeline diagram */ static create(title?: string): Timeline; /** * Create a Timeline wrapper from an existing AST */ static from(ast: TimelineAST): Timeline; /** * Parse Mermaid syntax and create a Timeline wrapper */ static parse(text: string): Timeline; /** * Render to Mermaid syntax */ render(options?: RenderOptions): string; /** * Create a deep clone of this timeline */ clone(): Timeline; /** * Get the diagram title */ get title(): string | undefined; /** * Get all sections */ get sections(): TimelineSection[]; /** * Get section count */ get sectionCount(): number; /** * Get total period count */ get periodCount(): number; /** * Get total event count */ get eventCount(): number; /** * Set the diagram title */ setTitle(title: string): this; /** * Add a new section */ addSection(name: string): this; /** * Get a section by name */ getSection(name: string): TimelineSection | undefined; /** * Remove a section and all its periods/events */ removeSection(name: string): this; /** * Rename a section */ renameSection(oldName: string, newName: string): this; /** * Add a period to a section */ addPeriod(sectionName: string, periodName: string): this; /** * Get a period by name (searches all sections) */ getPeriod(periodName: string): TimelinePeriod | undefined; /** * Remove a period */ removePeriod(periodName: string): this; /** * Rename a period */ renamePeriod(oldName: string, newName: string): this; /** * Add an event to a period */ addEvent(periodName: string, eventText: string): this; /** * Add an event to a period, creating the period if needed */ addEventWithPeriod(sectionName: string, periodName: string, eventText: string): this; /** * Remove an event from a period */ removeEvent(periodName: string, eventText: string): this; /** * Update event text */ updateEvent(periodName: string, oldText: string, newText: string): this; /** * Get all periods */ getAllPeriods(): TimelinePeriod[]; /** * Get all events */ getAllEvents(): TimelineEvent[]; /** * Find periods matching a query */ findPeriods(query: FindTimelinePeriodsQuery): TimelinePeriod[]; /** * Find events matching a query */ findEvents(query: FindTimelineEventsQuery): TimelineEvent[]; /** * Get events for a specific period */ getEventsForPeriod(periodName: string): TimelineEvent[]; /** * Get the section containing a period */ getSectionForPeriod(periodName: string): TimelineSection | undefined; } //# sourceMappingURL=timeline.d.ts.map