import { SerialParser } from '../types/index.js';
export interface RegexParserOptions {
    /** Regular expression used to split the incoming text stream. */
    regex: RegExp | string;
    /** Text encoding used to decode bytes. Defaults to `'utf-8'`. */
    encoding?: string;
}
/**
 * Creates a regex parser that decodes incoming bytes and emits string segments
 * split by the provided regular expression.
 *
 * @param options - Configuration options.
 * @returns A {@link SerialParser} that emits `string` values.
 *
 * @example
 * ```ts
 * import { AbstractSerialDevice, regexParser } from 'webserial-core';
 *
 * class MyDevice extends AbstractSerialDevice<string> {
 *   constructor() {
 *     super({ baudRate: 9600, parser: regexParser({ regex: /[\r\n]+/ }) });
 *   }
 * }
 * ```
 */
export declare function regexParser(options: RegexParserOptions): SerialParser<string>;
