Skip to main content
Version: v0.0.2

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?

readonly optional componentIndex?: number


elementIndex?

readonly optional elementIndex?: number


groupIndex?

readonly optional groupIndex?: number


interchangeIndex?

readonly optional interchangeIndex?: number


repetitionIndex?

readonly optional repetitionIndex?: number


segmentIndex

readonly segmentIndex: number


transactionIndex?

readonly optional transactionIndex?: number