type Obis = string; interface ObisRegister { obis: Obis; rawValue: string; } declare class ObisParserResult { registers: ObisRegister[]; constructor(registers: ObisRegister[]); getValueOfObis(anObisCode: Obis): string | null; getMeterNumber(): string | null; } /** * @class ObisParser * * Unified LL(1) grammar supporting both single-block and multi-block OBIS formats: * * START → TRASH BLOCK+ * BLOCK → HEADER BODY+ OPTIONAL_TERMINATOR * HEADER → 0x01 0x4F 0x42 0x02 * OPTIONAL_TERMINATOR → ε | 0x03 | 0x21 EOL* * BODY → EOL* OBIS 0x28 VALUE 0x29 * OBIS → ALPHANUM+ (0x2E ALPHANUM+)* * VALUE → PRINTABLE* * EOL → 0x0D | 0x0A * * Traditional single-block: 0x01 O B 0x02 entries 0x03 (treated as 1 block) * Multi-block format: Control chars + entries separated by ! terminators (N blocks) */ interface ObisParserOptions { multiBlock?: boolean; expectedBlocks?: number; checksumValidation?: ChecksumValidation; } export declare enum ChecksumValidation { NONE = 0, CRC_INCLUDE_START = 1, CRC_INCLUDE_END = 2, CRC_EXCLUDE_BOTH = 3, CRC_INCLUDE_BOTH = 4 } export declare class ObisParser { byteArray: Uint8Array; position: number; registers: ObisRegister[]; multiBlockMode: boolean; expectedBlocks: number; startOfTextIndex: number; checksumValidation: ChecksumValidation; constructor(); error(debugString: any): void; incomplete(debugString: any): void; peekByte(byte: any, lookahead?: number): boolean; matchByte(byte: any): void; matchRegex(aRegex: any): string; peekRegex(aRegex: any, lookahead?: number): any; matchEnd(): boolean; matchAnyByte(): void; skipOne(): void; /** Multiblock (Holley) has simple header */ peekHeader(): boolean; trash(): void; optionalEndOfLine(): void; body(): void; oneOrMoreAlphaNumeric(): string; value(): string; obis(): string; /** * BODY+ → Parse one or more bodies * BODY → EOL* OBIS 0x28 VALUE 0x29 */ bodyPlus(): void; matchChecksum(): void; /** * Skip separators between blocks: optional 0x04 and optional checksum byte * * This may be joined with optionalTerminator in the future */ consumeInterBlockSeparator(): void; /** * Determine if another BODY production can be parsed */ canParseBody(): boolean; matchHeader(): void; /** * OPTIONAL_TERMINATOR → ε | 0x03 | 0x21 EOL* * Match optional block terminator */ optionalTerminator(): boolean; /** * BLOCK → HEADER BODY+ OPTIONAL_TERMINATOR * Parse a single block * * A block is considered complete if it ends with a terminator (0x03 or 0x21) */ block(): boolean; /** * START → TRASH BLOCK+ * Entry point for parsing */ start(): void; parse(byteArray: Uint8Array, options?: ObisParserOptions): ObisParserResult; } export {}; //# sourceMappingURL=ObisParser.d.ts.map