import { VersionVector, VersionDot, POJO } from './common'; import AugmentedObjectManager, { AugmentedType } from './manager'; import { Element } from './element'; import PackedBuffer from '../thunk/packed'; export interface IJsonPayloadType { writePayload(buf: PackedBuffer, x: T): void; readPayload(buf: PackedBuffer): T; readonly initialPayload: T; } /** * An element with Last-Write-Wins semantics, where the payload is serializable with JSON. */ export declare abstract class LWWRegisterElement extends Element { protected modifiedDot: VersionDot; protected x: T; constructor(mgr: AugmentedObjectManager, ser?: PackedBuffer | LWWRegisterElement); toPackedBuffer(buf: PackedBuffer): void; get type(): AugmentedType & IJsonPayloadType; valueOf(): any; toStateString(): string; get boolean(): boolean; get number(): number; get string(): string; get modificationVV(): VersionVector; set(x: unknown): boolean; /** * Sets the POJO, optionally forcing update even if the content matches, e.g. if we edited in-place. */ setPojo(x: T, force?: boolean): void; synchronize(src: this): void; }