Interface: DicomParseWarning
Data shape for every Tier-2 warning emitted by the parser. Warnings are
plain data (distinct from DicomParseError, which is a thrown Error
subclass) so they can be safely accumulated into Dataset.warnings and
passed to onWarning callbacks.
Per D-07 there is intentionally NO snippet field on warnings:
real-world files routinely produce 50+ warnings and a per-warning
snippet would balloon retained memory. Snippets appear only on
DicomParseError (the strict-mode escalation path).
Example
import type { DicomParseWarning } from "@cosyte/dicom";
const w: DicomParseWarning = {
code: "DICOM_MISSING_PREAMBLE",
message: "No DICM magic at offset 128.",
position: { byteOffset: 0 },
};
Properties
code
readonlycode:WarningCode
message
readonlymessage:string
position
readonlyposition:DicomPosition