/** * DOT syntax helpers * * Two small pieces that exist because a generated DOT that nobody parses is a DOT that WILL break: * * 1. `dotValue()` — the ONE place a runtime value (service name, api name, project name, title) * becomes safe to interpolate into a quoted DOT string. Inlining values at each call site is how * an unescaped `"` shipped and took the whole diagram down: in DOT a bare `"` TERMINATES the * string it appears in, so one bad node line makes the entire graph fail to parse. * 2. `assertValidDot()` — a structural check on the emitted DOT that turns exactly that class of * mistake into a thrown error at generation time, instead of a blank page with a Graphviz * "syntax error in line N" that only a human opening the HTML ever sees. */ /** * Escape a runtime value for use INSIDE a quoted DOT string. * * Only `\` and `"` matter: everything else (parens, spaces, `-`, `#`, unicode) is ordinary text once * it is inside quotes. Note this deliberately escapes `\` FIRST, so a value containing a backslash * cannot smuggle an escape sequence in. Callers compose label lines with a literal `\\n` AFTER * escaping their values — the separator is ours, the value is theirs. */ export declare function dotValue(value: string): string; /** * Escape a runtime value for a `record`/`Mrecord` label, on TOP of {@link dotValue}. * * A record label is not ordinary label text: `|` splits fields, `{}` toggles the layout direction * and `<>` delimit port names. A queue name carrying any of them would not merely look wrong — it * would restructure the node, splitting one queue box into two or rotating it. Graphviz's record * grammar escapes those with a backslash, and since {@link dotValue} has already doubled real * backslashes, the `\\` emitted here survives into the record parser as a single one. * * Leading and trailing spaces are also dropped by the record parser, which is exactly why the * horizontal-cylinder queue node uses a `" |"` prefix — that empty first field is deliberate. */ export declare function recordValue(value: string): string; /** Thrown when the generator produces DOT that Graphviz could not parse. */ export declare class InvalidDotError extends Error { constructor(message: string); } /** * Fail loudly on structurally broken DOT. * * This is not a full Graphviz parser — it is the check that catches the failure mode a string * builder actually has: a quote that ends a string early (or never ends it). It scans the quoted * strings honouring `\"` escapes and asserts each one is terminated and is bounded by DOT * punctuation rather than by bare text. An unescaped `"` inside a label always violates that: the * string ends mid-label, and the remaining label text becomes stray tokens. */ export declare function assertValidDot(dot: string, source: string): void;