Types
All types are exported from @veridtools/dmn-diff-highlight.
DiffFormat
typescript
type DiffFormat = 'semantic' | 'rows' | 'json' | 'xml' | 'auto';The 4 output formats produced by @veridtools/dmn-diff, plus 'auto' for automatic detection.
| Value | Description |
|---|---|
'semantic' | Human-readable prose format with +/-/~ sigils and indented field changes |
'rows' | Row-diff table format with [ETYPE] brackets and one row per changed field |
'json' | Structured JSON output — the raw DiffResult serialized |
'xml' | Raw XML line diff with + /- / prefixes |
'auto' | Auto-detect based on text content (default in highlightDiff) |
HighlightOptions
typescript
interface HighlightOptions {
format?: DiffFormat;
className?: string;
}Options for highlightDiff and mountDiff.
| Property | Type | Default | Description |
|---|---|---|---|
format | DiffFormat | 'auto' | Format to use for tokenization. |
className | string | — | Extra CSS class on the root <pre> element. |
HighlightResultOptions
typescript
interface HighlightResultOptions {
format?: 'semantic' | 'rows' | 'json';
className?: string;
}Options for highlightResult. Excludes 'xml' and 'auto' since those are not applicable.
DiffResult
Re-exported from @veridtools/dmn-diff:
typescript
import type { DiffResult } from '@veridtools/dmn-diff-highlight';See the dmn-diff types reference for the full shape.
CSS custom properties
The default style.css uses these CSS custom properties on :root. Override on .dmn-dh or a scoped class to customize the theme.
| Property | Dark value | Light value | Used by |
|---|---|---|---|
--dmn-dh-bg | #1e1e2e | #eff1f5 | Root background |
--dmn-dh-fg | #cdd6f4 | #4c4f69 | Default text |
--dmn-dh-added | #a6e3a1 | #40a02b | .dmn-dh-added |
--dmn-dh-removed | #f38ba8 | #d20f39 | .dmn-dh-removed |
--dmn-dh-modified | #cba6f7 | #8839ef | .dmn-dh-modified |
--dmn-dh-field-breaking | #f38ba8 | #d20f39 | .dmn-dh-field-breaking |
--dmn-dh-field-change | #fab387 | #fe640b | .dmn-dh-field-change |
--dmn-dh-field-cosmetic | #6c7086 | #9ca0b0 | .dmn-dh-field-cosmetic |
--dmn-dh-warn | #f38ba8 | #d20f39 | .dmn-dh-warn, .dmn-dh-warn-header |
--dmn-dh-header | #cdd6f4 | #4c4f69 | .dmn-dh-header |
--dmn-dh-summary | #6c7086 | #9ca0b0 | .dmn-dh-summary |
--dmn-dh-context | #585b70 | #acb0be | .dmn-dh-context |
--dmn-dh-no-changes | #a6e3a1 | #40a02b | .dmn-dh-no-changes |
--dmn-dh-arrow | #89dceb | #04a5e5 | .dmn-dh-arrow |
--dmn-dh-fname | #89b4fa | #1e66f5 | .dmn-dh-fname |
--dmn-dh-etype | #cba6f7 | #8839ef | .dmn-dh-etype |
--dmn-dh-eid | #6c7086 | #9ca0b0 | .dmn-dh-eid |
--dmn-dh-fval-from | #f38ba8 | #d20f39 | .dmn-dh-fval-from |
--dmn-dh-fval-to | #a6e3a1 | #40a02b | .dmn-dh-fval-to |
--dmn-dh-jkey | #89b4fa | #1e66f5 | .dmn-dh-jkey |
--dmn-dh-jstring | #a6e3a1 | #40a02b | .dmn-dh-jstring |
--dmn-dh-jnumber | #fab387 | #fe640b | .dmn-dh-jnumber |
--dmn-dh-jbool | #cba6f7 | #8839ef | .dmn-dh-jbool |
--dmn-dh-jnull | #cba6f7 | #8839ef | .dmn-dh-jnull |
--dmn-dh-jpunct | #6c7086 | #9ca0b0 | .dmn-dh-jpunct |
CSS class reference
Line-level classes
| Class | Applied to |
|---|---|
dmn-dh-line | Every line wrapper <span> |
dmn-dh-header | File header line (before.dmn → after.dmn) |
dmn-dh-warn-header | Warning summary line starting with ⚠ |
dmn-dh-added | Added element lines / rows |
dmn-dh-removed | Removed element lines / rows |
dmn-dh-modified | Modified element header lines |
dmn-dh-field-change | Field change lines (non-breaking) |
dmn-dh-field-breaking | Field change lines with ⚠ BREAKING |
dmn-dh-field-cosmetic | Field change lines marked (cosmetic) |
dmn-dh-summary | Summary count line |
dmn-dh-context | XML context lines (2-space prefix) |
dmn-dh-no-changes | (no differences) line in XML format |
Inline token classes
| Class | Applied to |
|---|---|
dmn-dh-arrow | → arrow character |
dmn-dh-sigil | +, -, ~ sigil character |
dmn-dh-etype | Element type word (decision, outputClause, etc.) |
dmn-dh-ename | Quoted element name |
dmn-dh-eid | Element ID in parentheses |
dmn-dh-fname | Field name |
dmn-dh-fval-from | Old field value |
dmn-dh-fval-to | New field value |
dmn-dh-warn | ⚠ warning symbol |
dmn-dh-tag | [BREAKING], [cosmetic], or (cosmetic) badge |
JSON token classes
| Class | Applied to |
|---|---|
dmn-dh-jkey | Object key strings |
dmn-dh-jstring | String values |
dmn-dh-jnumber | Number values |
dmn-dh-jbool | true / false |
dmn-dh-jnull | null |
dmn-dh-jpunct | {, }, [, ], :, , |
