tolkfmt-test-dev
Version:
Code formatter for the Tolk programming language
58 lines • 1.82 kB
TypeScript
import type { Node } from "web-tree-sitter";
import type { CommentMap } from "./comments";
export type Doc = Text | Line | SoftLine | HardLine | Indent | Group | Concat | LineSuffix | BreakParent | IfBreak | Empty;
export interface Text {
readonly $: "Text";
readonly value: string;
}
export declare const text: (value: string) => Doc;
export interface Line {
readonly $: "Line";
}
export declare const line: () => Doc;
export interface SoftLine {
readonly $: "SoftLine";
}
export declare const softLine: () => Doc;
export interface HardLine {
readonly $: "HardLine";
}
export declare const hardLine: () => Doc;
export interface LineSuffix {
readonly $: "LineSuffix";
readonly suffix: Doc;
}
export declare const lineSuffix: (suffix: Doc) => Doc;
export interface BreakParent {
readonly $: "BreakParent";
}
export declare const breakParent: () => Doc;
export interface IfBreak {
readonly $: "IfBreak";
readonly breakContent: Doc | undefined;
readonly flatContent: Doc | undefined;
}
export declare const ifBreak: (breakContent: Doc | undefined, flatContent?: Doc | undefined) => Doc;
export interface Indent {
readonly $: "Indent";
readonly indent: number;
readonly content: Doc;
}
export declare const indent: (content: Doc) => Doc;
export interface Group {
readonly $: "Group";
readonly content: Doc;
}
export declare const group: (content: Doc[]) => Doc;
export interface Concat {
readonly $: "Concat";
readonly parts: Doc[];
}
export declare const concat: (parts: Doc[]) => Doc;
export interface Empty {
readonly $: "Empty";
}
export declare const empty: () => Doc;
export declare function blankLinesBetween(a: Node, b: Node, comments: CommentMap): number;
export declare const blank: (n: number) => Doc;
//# sourceMappingURL=doc.d.ts.map