webserial-core
Version:
A strongly-typed, event-driven, abstract TypeScript library for the Web Serial API with custom parsers, command queue, handshake validation, and auto-reconnect.
21 lines (20 loc) • 679 B
TypeScript
import { SerialParser } from '../types/index.js';
/**
* Creates a ccTalk parser that emits complete ccTalk packets as `Uint8Array`.
*
* @param maxDelayBetweenBytesMs - Maximum allowed silence between bytes before
* the buffer is discarded. Defaults to `50`.
* @returns A {@link SerialParser} that emits `Uint8Array` values.
*
* @example
* ```ts
* import { AbstractSerialDevice, ccTalk } from 'webserial-core';
*
* class CoinAcceptor extends AbstractSerialDevice<Uint8Array> {
* constructor() {
* super({ baudRate: 9600, parser: ccTalk(100) });
* }
* }
* ```
*/
export declare function ccTalk(maxDelayBetweenBytesMs?: number): SerialParser<Uint8Array>;