import type * as Doc from "../Doc.js" /** * Represents a list of nesting level/document pairs that are yet to be laid * out. * * @internal */ export type LayoutPipeline = Nil | Cons | UndoAnnotation /** @internal */ export interface Nil { readonly _tag: "Nil" } /** @internal */ export interface Cons { readonly _tag: "Cons" readonly indent: number readonly document: Doc.Doc readonly pipeline: LayoutPipeline } /** @internal */ export interface UndoAnnotation { readonly _tag: "UndoAnnotation" readonly pipeline: LayoutPipeline } /** @internal */ export const nil: LayoutPipeline = { _tag: "Nil" } /** @internal */ export const cons = ( indent: number, document: Doc.Doc, pipeline: LayoutPipeline ): LayoutPipeline => ({ _tag: "Cons", indent, document, pipeline }) /** @internal */ export const undoAnnotation = (pipeline: LayoutPipeline): LayoutPipeline => ({ _tag: "UndoAnnotation", pipeline })