/**
 * Lamport logical clock for causal message ordering.
 *
 * Leslie Lamport (TLA+, Turing Award):
 *   "The fundamental idea is that a process increments its counter before
 *    each event in that process."
 *
 * Properties:
 * - Thread-safe for single-process use (no async operations modify counter)
 * - O(1) time complexity for all operations
 * - Provides partial ordering guarantee
 *
 * Usage:
 * ```typescript
 * const clock = new LamportClock();
 *
 * // Before local event
 * clock.tick();
 *
 * // Before sending message
 * const timestamp = clock.send();
 * message.lamportClock = timestamp;
 *
 * // On receiving message
 * clock.receive(message.lamportClock);
 * ```
 */
export declare class LamportClock {
    /**
     * The logical clock counter.
     * Incremented on local events and message sends.
     * Updated to max(local, remote) + 1 on message receives.
     */
    private _counter;
    /**
     * Get current clock value (read-only).
     * Do not modify the counter directly - use tick(), send(), or receive().
     */
    get value(): number;
    /**
     * Tick clock for a local event.
     *
     * Call this before executing any local event that should be causally ordered.
     * Returns the new clock value.
     *
     * Example:
     * ```typescript
     * clock.tick();
     * await processLocalEvent();
     * ```
     */
    tick(): number;
    /**
     * Prepare to send a message.
     *
     * Call this when preparing to send a message. Returns the timestamp
     * that should be attached to the message.
     *
     * Example:
     * ```typescript
     * const timestamp = clock.send();
     * transport.publish(topic, { ...payload, __lamportClock: timestamp });
     * ```
     *
     * @returns The Lamport timestamp to attach to the message
     */
    send(): number;
    /**
     * Process a received message with remote timestamp.
     *
     * Call this when receiving a message with a Lamport timestamp.
     * Updates local clock to respect causality: C := max(C, remote) + 1
     *
     * Example:
     * ```typescript
     * const message = await receive();
     * clock.receive(message.lamportClock);
     * processMessage(message);
     * ```
     *
     * @param remoteTimestamp - The Lamport timestamp from the received message
     * @returns The new local clock value
     */
    receive(remoteTimestamp: number): number;
    /**
     * Reset clock to zero.
     * Useful for testing. Should NOT be used in production.
     */
    reset(): void;
    /**
     * Create a snapshot of the current clock state (for debugging).
     */
    snapshot(): {
        value: number;
    };
    /**
     * Compare two Lamport timestamps for causal ordering.
     *
     * Returns:
     *  - negative if a < b (a causally precedes b)
     *  - zero if a === b (concurrent or same event)
     *  - positive if a > b (b causally precedes a)
     *
     * Note: Equal timestamps do NOT prove events are concurrent - they may be
     * from different processes with no causal relationship.
     */
    static compare(a: number, b: number): number;
    /**
     * Merge two Lamport clocks (takes maximum).
     * Useful when combining state from multiple sources.
     *
     * Example:
     * ```typescript
     * const merged = LamportClock.merge(clock1.value, clock2.value);
     * clock.receive(merged);
     * ```
     */
    static merge(a: number, b: number): number;
}
//# sourceMappingURL=LamportClock.d.ts.map