export * from "../src/index.js"; export let useV2: boolean; export namespace encV1 { const encodeStateAsUpdate: (doc: Y.Doc, encodedTargetStateVector?: Uint8Array | undefined) => Uint8Array; const mergeUpdates: (updates: Uint8Array[]) => Uint8Array; const applyUpdate: (ydoc: Y.Doc, update: Uint8Array, transactionOrigin?: any) => void; const logUpdate: (update: Uint8Array) => void; const updateEventName: string; const diffUpdate: (update: Uint8Array, sv: Uint8Array) => Uint8Array; } export namespace encV2 { const encodeStateAsUpdate_1: (doc: Y.Doc, encodedTargetStateVector?: Uint8Array | undefined, encoder?: import("../src/internals.js").UpdateEncoderV2 | Y.UpdateEncoderV1 | undefined) => Uint8Array; export { encodeStateAsUpdate_1 as encodeStateAsUpdate }; const mergeUpdates_1: (updates: Uint8Array[], YDecoder?: typeof import("../src/internals.js").UpdateDecoderV1 | typeof import("../src/internals.js").UpdateDecoderV2 | undefined, YEncoder?: typeof import("../src/internals.js").UpdateEncoderV2 | typeof Y.UpdateEncoderV1 | undefined) => Uint8Array; export { mergeUpdates_1 as mergeUpdates }; const applyUpdate_1: (ydoc: Y.Doc, update: Uint8Array, transactionOrigin?: any, YDecoder?: typeof import("../src/internals.js").UpdateDecoderV1 | typeof import("../src/internals.js").UpdateDecoderV2 | undefined) => void; export { applyUpdate_1 as applyUpdate }; const logUpdate_1: (update: Uint8Array, YDecoder?: typeof import("../src/internals.js").UpdateDecoderV1 | typeof import("../src/internals.js").UpdateDecoderV2 | undefined) => void; export { logUpdate_1 as logUpdate }; const updateEventName_1: string; export { updateEventName_1 as updateEventName }; const diffUpdate_1: (update: Uint8Array, sv: Uint8Array, YDecoder?: typeof import("../src/internals.js").UpdateDecoderV1 | typeof import("../src/internals.js").UpdateDecoderV2 | undefined, YEncoder?: typeof import("../src/internals.js").UpdateEncoderV2 | typeof Y.UpdateEncoderV1 | undefined) => Uint8Array; export { diffUpdate_1 as diffUpdate }; } export namespace enc { } export class TestYInstance extends Y.Doc { /** * @param {TestConnector} testConnector * @param {number} clientID */ constructor(testConnector: TestConnector, clientID: number); userID: number; /** * @type {TestConnector} */ tc: TestConnector; /** * @type {Map>} */ receiving: Map>; /** * The list of received updates. * We are going to merge them later using Y.mergeUpdates and check if the resulting document is correct. * @type {Array} */ updates: Array; /** * Disconnect from TestConnector. */ disconnect(): void; /** * Append yourself to the list of known Y instances in testconnector. * Also initiate sync with all clients. */ connect(): void; /** * Receive a message from another client. This message is only appended to the list of receiving messages. * TestConnector decides when this client actually reads this message. * * @param {Uint8Array} message * @param {TestYInstance} remoteClient */ _receive(message: Uint8Array, remoteClient: TestYInstance): void; } /** * Keeps track of TestYInstances. * * The TestYInstances add/remove themselves from the list of connections maiained in this object. * I think it makes sense. Deal with it. */ export class TestConnector { /** * @param {prng.PRNG} gen */ constructor(gen: prng.PRNG); /** * @type {Set} */ allConns: Set; /** * @type {Set} */ onlineConns: Set; /** * @type {prng.PRNG} */ prng: prng.PRNG; /** * Create a new Y instance and add it to the list of connections * @param {number} clientID */ createY(clientID: number): TestYInstance; /** * Choose random connection and flush a random message from a random sender. * * If this function was unable to flush a message, because there are no more messages to flush, it returns false. true otherwise. * @return {boolean} */ flushRandomMessage(): boolean; /** * @return {boolean} True iff this function actually flushed something */ flushAllMessages(): boolean; reconnectAll(): void; disconnectAll(): void; syncAll(): void; /** * @return {boolean} Whether it was possible to disconnect a randon connection. */ disconnectRandom(): boolean; /** * @return {boolean} Whether it was possible to reconnect a random connection. */ reconnectRandom(): boolean; } export function init(tc: t.TestCase, { users }?: { users?: number; }, initTestObject?: InitTestObjectCallback | undefined): { testObjects: Array; testConnector: TestConnector; users: Array; array0: Y.Array; array1: Y.Array; array2: Y.Array; map0: Y.Map; map1: Y.Map; map2: Y.Map; map3: Y.Map; text0: Y.Text; text1: Y.Text; text2: Y.Text; xml0: Y.XmlElement; xml1: Y.XmlElement; xml2: Y.XmlElement; }; export function compare(users: Array): void; export function compareItemIDs(a: Y.Item | null, b: Y.Item | null): boolean; export function compareStructStores(ss1: import('../src/internals.js').StructStore, ss2: import('../src/internals.js').StructStore): undefined; export function compareDS(ds1: import('../src/internals.js').DeleteSet, ds2: import('../src/internals.js').DeleteSet): void; export function applyRandomTests(tc: t.TestCase, mods: ((arg0: Y.Doc, arg1: prng.PRNG, arg2: T) => void)[], iterations: number, initTestObject?: InitTestObjectCallback | undefined): { testObjects: Array; testConnector: TestConnector; users: Array; array0: Y.Array; array1: Y.Array; array2: Y.Array; map0: Y.Map; map1: Y.Map; map2: Y.Map; map3: Y.Map; text0: Y.Text; text1: Y.Text; text2: Y.Text; xml0: Y.XmlElement; xml1: Y.XmlElement; xml2: Y.XmlElement; }; export type InitTestObjectCallback = (y: TestYInstance) => T; import * as Y from "../src/index.js"; import * as prng from "lib0/prng"; import * as t from "lib0/testing"; //# sourceMappingURL=testHelper.d.ts.map