mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
17 lines
677 B
TypeScript
17 lines
677 B
TypeScript
import type { StyledText } from "@opentui/core"
|
|
import type { DiagramCanvas } from "../core/canvas.js"
|
|
import { renderDiagramGridStyledText } from "../core/render-grid.js"
|
|
import type { GanttStyleColors } from "./style.js"
|
|
import type { GanttCellStyle } from "./types.js"
|
|
|
|
export type GanttGrid = DiagramCanvas<GanttCellStyle>
|
|
|
|
export function renderGanttGridText(grid: GanttGrid): string {
|
|
return grid.toString({ trimBottom: true })
|
|
}
|
|
|
|
export function renderGanttGridStyledText(grid: GanttGrid, colors: GanttStyleColors): StyledText {
|
|
return renderDiagramGridStyledText(grid, (run) => (run.style ? colors[run.style] : undefined), undefined, {
|
|
trimBottom: true,
|
|
})
|
|
}
|