Interface: X12Position
Positional context attached to every warning and fatal error. Fields are 1-indexed against the X12 spec convention (interchange first, then group, then transaction, then segment, then element within that segment, then component within that element).
All fields past segmentIndex are optional - for a top-level fatal like
X12_EMPTY_INPUT only segmentIndex: 0 is populated; for a per-element
warning deep inside a transaction every field may be set.
Remarks
With exactOptionalPropertyTypes: true, do not pass interchangeIndex: undefined explicitly - omit the key instead.
Example
import type { X12Position } from "@cosyte/x12";
const pos: X12Position = { segmentIndex: 0, interchangeIndex: 0 };
Properties
componentIndex?
readonlyoptionalcomponentIndex?:number
elementIndex?
readonlyoptionalelementIndex?:number
groupIndex?
readonlyoptionalgroupIndex?:number
interchangeIndex?
readonlyoptionalinterchangeIndex?:number
repetitionIndex?
readonlyoptionalrepetitionIndex?:number
segmentIndex
readonlysegmentIndex:number
transactionIndex?
readonlyoptionaltransactionIndex?:number