/** * GitGraph Diagram Wrapper * * Provides a fluent API for creating and manipulating gitGraph diagrams. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { GitGraphAST, GitGraphDirection, GitStatement, GitCommit, GitBranch } from './types/gitgraph.js'; import type { RenderOptions } from './types/render-options.js'; /** * Options for adding a commit */ export interface AddCommitOptions { id?: string; message?: string; tag?: string; commitType?: 'NORMAL' | 'REVERSE' | 'HIGHLIGHT'; } /** * Options for adding a branch */ export interface AddBranchOptions { order?: number; } /** * Options for merging */ export interface MergeOptions { id?: string; tag?: string; commitType?: 'NORMAL' | 'REVERSE' | 'HIGHLIGHT'; } /** * Options for cherry-picking */ export interface CherryPickOptions { tag?: string; parent?: string; } /** * Query for finding commits */ export interface FindCommitsQuery { id?: string; tag?: string; commitType?: 'NORMAL' | 'REVERSE' | 'HIGHLIGHT'; } /** * Query for finding branches */ export interface FindBranchesQuery { name?: string; } /** * GitGraph diagram wrapper class */ export declare class GitGraph extends DiagramWrapper { private constructor(); /** * Creates a new empty gitGraph diagram */ static create(direction?: GitGraphDirection): GitGraph; /** * Creates a GitGraph from an existing AST */ static from(ast: GitGraphAST): GitGraph; /** * Parses gitGraph syntax into a GitGraph instance */ static parse(text: string): Promise; /** * Renders the diagram to Mermaid syntax */ render(options?: RenderOptions): string; /** * Creates a deep clone of this diagram */ clone(): GitGraph; /** * Sets the graph direction */ setDirection(direction: GitGraphDirection): this; /** * Gets the graph direction */ getDirection(): GitGraphDirection | undefined; /** * Sets the diagram title */ setTitle(title: string): this; /** * Gets the diagram title */ getTitle(): string | undefined; /** * Removes the diagram title */ removeTitle(): this; /** * Sets the accessibility title */ setAccTitle(title: string): this; /** * Gets the accessibility title */ getAccTitle(): string | undefined; /** * Sets the accessibility description */ setAccDescr(descr: string): this; /** * Gets the accessibility description */ getAccDescr(): string | undefined; /** * Adds a commit */ commit(options?: AddCommitOptions): this; /** * Gets the number of commits */ get commitCount(): number; /** * Finds commits matching the query */ findCommits(query?: FindCommitsQuery): GitCommit[]; /** * Gets a commit by ID */ getCommit(id: string): GitCommit | undefined; /** * Creates a new branch */ branch(name: string, options?: AddBranchOptions): this; /** * Checks out a branch */ checkout(branchName: string): this; /** * Gets the number of branches */ get branchCount(): number; /** * Finds branches matching the query */ findBranches(query?: FindBranchesQuery): GitBranch[]; /** * Gets a branch by name */ getBranch(name: string): GitBranch | undefined; /** * Merges a branch into the current branch */ merge(branchName: string, options?: MergeOptions): this; /** * Gets the number of merges */ get mergeCount(): number; /** * Cherry-picks a commit */ cherryPick(commitId: string, options?: CherryPickOptions): this; /** * Gets all statements */ getStatements(): GitStatement[]; /** * Gets the total number of statements */ get statementCount(): number; } //# sourceMappingURL=gitgraph.d.ts.map