Interface: X12TransactionSet
A single ST..SE transaction set inside a functional group. Phase 2
decodes every body segment via "./segment.js".decodeSegment so
segments carries typed X12Segment entries (ST through SE,
inclusive). rawSegments mirrors the same list as the verbatim raw
segment strings (terminator stripped) so a byte-exact round-trip survives
any downstream consumer that needs to re-emit the source.
elements on the ST and SE segments themselves IS decoded at envelope
time so envelope invariants can be checked (ST-02 ↔ SE-02 control-number
reconciliation, SE-01 segment count).
Example
import type { X12TransactionSet } from "@cosyte/x12";
declare const tx: X12TransactionSet;
tx.st.elements[1]; // ST-01 - transaction set ID (e.g. "835")
tx.segments[1]?.id; // first body segment id
tx.rawSegments[1]; // first body segment raw text
Properties
rawSegments
readonlyrawSegments: readonlystring[]
se
readonlyse: {elements: readonlystring[];raw:string; } |undefined
segments
readonlysegments: readonlyX12Segment[]
st
readonlyst:object
elements
readonlyelements: readonlystring[]
raw
readonlyraw:string