/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Construction, Crypto, StorageContext } from "@matter/general";
/** Maximum 32 bit counter value. */
export declare const MAX_COUNTER_VALUE_32BIT = 4294967294;
export declare enum MessageCounterTypes {
    /**
     * Used for "Unsecure" sessions
     * Rollover allowed, Persistence: Optional
     */
    GlobalUnencrypted = 0,
    /**
     * Used for "Group" sessions to encode regular data messages encrypted with a group key.
     * Lifetime: Operational Group Key, Rollover allowed, Persistence: Mandatory
     */
    GlobalEncryptedData = 1,
    /**
     * Used for "Group" sessions to encode control messages encrypted with a group key.
     * Lifetime: Operational Group Key, Rollover allowed, Persistence: Mandatory
     */
    GlobalEncryptedControl = 2,
    /**
     * Used for "Unicast" sessions
     * Lifetime: Session Key, Rollover expires, Persistence: Optional
     */
    SecureSession = 3
}
/**
 * Represents a message counter which gets randomly initialized and then incremented for each message.
 * Rollover can be allowed or forbidden and a callback can be provided to be notified before a rollover would happen.
 */
export declare class MessageCounter {
    protected readonly onRollover?: (() => Promise<void>) | undefined;
    protected readonly rolloverInfoDifference: number;
    protected messageCounter: number;
    /**
     * Creates a new message counter with a random start value. If a aboutToRolloverCallback is provided this
     * counter is not allowed to rollover and the callback is called before a rollover would happen. Optionally provide
     * a number of messages before the rollover callback is called (Default 1000).
     */
    constructor(crypto: Crypto, onRollover?: (() => Promise<void>) | undefined, rolloverInfoDifference?: number);
    getIncrementedCounter(): Promise<number>;
}
/** Enhanced Message counter that can be persisted and will be initialized from the persisted value (if existing). */
export declare class PersistedMessageCounter extends MessageCounter {
    #private;
    private readonly storageContext;
    private readonly storageKey;
    get construction(): Construction<PersistedMessageCounter>;
    static create(crypto: Crypto, storageContext: StorageContext, storageKey: string, aboutToRolloverCallback?: () => Promise<void>, rolloverInfoDifference?: number): Promise<PersistedMessageCounter>;
    constructor(crypto: Crypto, storageContext: StorageContext, storageKey: string, aboutToRolloverCallback?: () => Promise<void>, rolloverInfoDifference?: number);
    getIncrementedCounter(): Promise<number>;
}
//# sourceMappingURL=MessageCounter.d.ts.map