@casual-simulation/aux-common
Version:
Common library for AUX projects
31 lines • 1.46 kB
TypeScript
import type { VersionVector } from '../common';
import type { Doc, Text } from 'yjs';
import { RelativePosition } from 'yjs';
/**
* Return the states as a Map<client,clock>.
* Note that clock refers to the next expected clock id.
*
* @param store
*/
export declare function getStateVector(doc: Doc): VersionVector;
/**
* Gets the latest clock value for the given client.
* @param doc The document.
* @param client The client.
*/
export declare function getClock(doc: Doc, client: number): number;
/**
* Creates a relative position from an absolute position based on the given state vector.
* @param text The text that the position should be created from.
* @param vector The version vector that the position should be calculated from.
* @param index The index.
*/
export declare function createRelativePositionFromStateVector(text: Text, vector: VersionVector, index: number, assoc?: number, includeDeleted?: boolean): RelativePosition;
/**
* Creates a relative position from an absolute position based on the given state vector.
* @param text The text that the position should be created from.
* @param vector The version vector that the position should be calculated from.
* @param index The index.
*/
export declare function createAbsolutePositionFromStateVector(doc: Doc, text: Text, vector: VersionVector, index: number, assoc?: number, includeDeleted?: boolean): import("yjs").AbsolutePosition;
//# sourceMappingURL=YjsHelpers.d.ts.map