import type { CstChildrenDictionary, Rules } from "@hylimo/core"; import type { IToken, CstNode } from "chevrotain"; import type { AstPath, Doc, ParserOptions } from "prettier"; /** * CST node type used by prettier */ export type Node = { [K in keyof CstChildrenDictionary]: CstChildrenDictionary[K] extends IToken[] ? IToken[] : CstChildrenDictionary[K] extends CstNode[] ? Node[] : never; } & Pick & { name: Rules; } & { comments?: Comment[]; }; /** * Path type used by prettier */ export type Path = AstPath; /** * Recursive print function provided by prettier */ export type Print = (path: Path) => Doc; /** * Prettier parser options */ export type Options = ParserOptions; /** * Context passed to all printers */ export interface PrintContext { ctx: Node; path: Path; options: Options; print: Print; } /** * Prettier comment type */ export interface Comment extends IToken { leading?: boolean; trailing?: boolean; printed?: boolean; } //# sourceMappingURL=types.d.ts.map