Skip to content

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.

ValueDescription
'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.

PropertyTypeDefaultDescription
formatDiffFormat'auto'Format to use for tokenization.
classNamestringExtra 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.

PropertyDark valueLight valueUsed by
--dmn-dh-bg#1e1e2e#eff1f5Root background
--dmn-dh-fg#cdd6f4#4c4f69Default 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

ClassApplied to
dmn-dh-lineEvery line wrapper <span>
dmn-dh-headerFile header line (before.dmn → after.dmn)
dmn-dh-warn-headerWarning summary line starting with
dmn-dh-addedAdded element lines / rows
dmn-dh-removedRemoved element lines / rows
dmn-dh-modifiedModified element header lines
dmn-dh-field-changeField change lines (non-breaking)
dmn-dh-field-breakingField change lines with ⚠ BREAKING
dmn-dh-field-cosmeticField change lines marked (cosmetic)
dmn-dh-summarySummary count line
dmn-dh-contextXML context lines (2-space prefix)
dmn-dh-no-changes(no differences) line in XML format

Inline token classes

ClassApplied to
dmn-dh-arrow arrow character
dmn-dh-sigil+, -, ~ sigil character
dmn-dh-etypeElement type word (decision, outputClause, etc.)
dmn-dh-enameQuoted element name
dmn-dh-eidElement ID in parentheses
dmn-dh-fnameField name
dmn-dh-fval-fromOld field value
dmn-dh-fval-toNew field value
dmn-dh-warn warning symbol
dmn-dh-tag[BREAKING], [cosmetic], or (cosmetic) badge

JSON token classes

ClassApplied to
dmn-dh-jkeyObject key strings
dmn-dh-jstringString values
dmn-dh-jnumberNumber values
dmn-dh-jbooltrue / false
dmn-dh-jnullnull
dmn-dh-jpunct{, }, [, ], :, ,

Released under the MIT License.