import { ReplicatedData } from '.'; import { Serializable } from '../serializable'; import * as Long from 'long'; /** * A replicated map of counters. * * @typeParam Key - Type of keys for the Replicated Counter Map * * @public */ export declare class ReplicatedCounterMap implements ReplicatedData { private counters; private removed; private cleared; /** * Get the value at the given key. * * @param key - The key to get * @returns The counter value, or undefined if no value is defined at that key */ get: (key: Key) => number | undefined; /** * Get the value as a long at the given key. * * @param key - The key to get * @returns The counter value as a long, or undefined if no value is defined at that key */ getLong: (key: Key) => Long.Long | undefined; /** * Increment the counter at the given key by the given number. * * @param key - The key for the counter to increment * @param increment - The amount to increment the counter by. If negative, it will be decremented instead * @returns This counter map */ increment: (key: Key, increment: Long.Long | number) => ReplicatedCounterMap; /** * Decrement the counter at the given key by the given number. * * @param key - The key for the counter to decrement * @param decrement - The amount to decrement the counter by. If negative, it will be incremented instead. * @returns This counter map */ decrement: (key: Key, decrement: Long.Long | number) => ReplicatedCounterMap; /** * Check whether this map contains a value of the given key. * * @param key - The key to check * @returns True if this counter map contains a value for the given key */ has: (key: Key) => boolean; /** * The number of elements in this map. */ get size(): number; /** * Return an (iterable) iterator of the keys of this counter map. */ keys: () => IterableIterator; /** * Delete the counter at the given key. * * @param key - The key to delete * @returns This counter map */ delete: (key: Key) => ReplicatedCounterMap; /** * Clear all counters from this counter map. * * @returns This counter map */ clear: () => ReplicatedCounterMap; private getOrCreateCounter; toString: () => string; }