import * as VV from '@asmartbear/version-vectors'; import AugmentedObjectManager, { AugmentedType } from './manager'; import { LWWRegisterElement, IJsonPayloadType } from './lwwreg'; import PackedBuffer from '../thunk/packed'; declare type GCounterPojo = VV.VV; declare class GCounterType implements AugmentedType, IJsonPayloadType { readonly name = "gcounter"; isNativeTypeCompatible(x: unknown): x is GCounterSentinal; createFromExisting(mgr: AugmentedObjectManager, ser: PackedBuffer | GCounterElement): GCounterElement; createFromNative(mgr: AugmentedObjectManager, x: GCounterSentinal): GCounterElement; writePayload(buf: PackedBuffer, x: GCounterPojo): void; readPayload(buf: PackedBuffer): GCounterPojo; readonly initialPayload: {}; } declare const GCOUNTER_TYPE: GCounterType; export default GCOUNTER_TYPE; /** * An element that represents a synchronizable, increment-only counter. */ declare class GCounterElement extends LWWRegisterElement { get type(): GCounterType; valueOf(): any; set(x: unknown): boolean; synchronize(src: this): void; } declare class GCounterSentinal { readonly initialCounterValue: number; constructor(initialCounterValue: number); } /** * The way to initialize a new GCounter, is to call this function and add the result to a collection. * It will "melt away" immediately, appearing like a normal JavaScript number which can only be increased. */ export declare function GCounter(initialCounterValue?: number): number;