import enums from '../enums';
export declare class GrammarError extends Error {
    constructor(...params: any[]);
}
/**
 * Implement OpenPGP message grammar based on: https://www.rfc-editor.org/rfc/rfc9580.html#section-10.3 .
 * It is slightly more lenient as it also allows standalone ESK sequences, as well as empty (signed) messages.
 * This latter case is needed to allow unknown packets.
 * A new `MessageGrammarValidator` instance must be created for each packet sequence, as the instance is stateful:
 * - `recordPacket` must be called for each packet in the sequence; the function will throw as soon as
 *  an invalid packet is detected.
 * - `recordEnd` must be called at the end of the packet sequence to confirm its validity.
 */
export declare class MessageGrammarValidator {
    private state;
    private leadingOnePassSignatureCounter;
    /**
     * Determine validity of the next packet in the sequence.
     * NB: padding, marker and unknown packets are expected to already be filtered out on parsing,
     * and are not accepted by `recordPacket`.
     * @param packet - packet to validate
     * @param additionalAllowedPackets - object containing packets which are allowed anywhere in the sequence, except they cannot precede a OPS packet
     * @throws {GrammarError} on invalid `packet` input
     */
    recordPacket(packet: enums.packet, additionalAllowedPackets?: {
        [key in enums.packet]: any;
    }): void;
    /**
     * Signal end of the packet sequence for final validity check
     * @throws {GrammarError} on invalid sequence
     */
    recordEnd(): void;
}
