Skip to main content
Version: v0.0.2

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

readonly rawSegments: readonly string[]


se

readonly se: { elements: readonly string[]; raw: string; } | undefined


segments

readonly segments: readonly X12Segment[]


st

readonly st: object

elements

readonly elements: readonly string[]

raw

readonly raw: string