Skip to main content
Version: v0.0.8

Interface: TelecomSegment

A decoded segment: its identification code, name, and ordered fields.

Properties

byteOffset

readonly byteOffset: number

Byte offset of the segment in the raw message.


fields

readonly fields: readonly TelecomField[]

The segment's data fields, in wire order. The AM field is not repeated here once it has been read into segmentId; when it could not be (MALFORMED_SEGMENT_ID), it stays in this list instead of being dropped.


name?

readonly optional name?: string

Paraphrased segment name when segmentId is recognized.


segmentId

readonly segmentId: string

The Segment Identification (111-AM) code, e.g. "07".

Always either exactly two characters or empty. It is empty when the segment did not begin with an AM field (MISSING_SEGMENT_ID) and when it did but that field's value was not two characters (MALFORMED_SEGMENT_ID); in the second case the AM field itself is kept in fields, verbatim, so no byte is lost. The bound is what makes this field safe for a consumer to interpolate into its own diagnostics: fields[].value is not.