export function warnPrematureAccess(): void; export class ArraySearchMarker { /** * @param {Item} p * @param {number} index */ constructor(p: Item, index: number); p: Item; index: number; timestamp: number; } export function findMarker(yarray: AbstractType, index: number): ArraySearchMarker | null; export function updateMarkerChanges(searchMarker: Array, index: number, len: number): void; export function getTypeChildren(t: AbstractType): Array; export function callTypeObservers(type: AbstractType, transaction: Transaction, event: EventType): void; /** * @template EventType * Abstract Yjs Type class */ export class AbstractType { /** * @type {Item|null} */ _item: Item | null; /** * @type {Map} */ _map: Map; /** * @type {Item|null} */ _start: Item | null; /** * @type {Doc|null} */ doc: Doc | null; _length: number; /** * Event handlers * @type {EventHandler} */ _eH: EventHandler; /** * Deep event handlers * @type {EventHandler>,Transaction>} */ _dEH: EventHandler>, Transaction>; /** * @type {null | Array} */ _searchMarker: null | Array; /** * @return {AbstractType|null} */ get parent(): AbstractType | null; /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item|null} item */ _integrate(y: Doc, item: Item | null): void; /** * @return {AbstractType} */ _copy(): AbstractType; /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {AbstractType} */ clone(): AbstractType; /** * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder */ _write(_encoder: UpdateEncoderV1 | UpdateEncoderV2): void; /** * The first non-deleted item */ get _first(): Item | null; /** * Creates YEvent and calls all type observers. * Must be implemented by each type. * * @param {Transaction} transaction * @param {Set} _parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction: Transaction, _parentSubs: Set): void; /** * Observe all events that are created on this type. * * @param {function(EventType, Transaction):void} f Observer function */ observe(f: (arg0: EventType, arg1: Transaction) => void): void; /** * Observe all events that are created by this type and its children. * * @param {function(Array>,Transaction):void} f Observer function */ observeDeep(f: (arg0: Array>, arg1: Transaction) => void): void; /** * Unregister an observer function. * * @param {function(EventType,Transaction):void} f Observer function */ unobserve(f: (arg0: EventType, arg1: Transaction) => void): void; /** * Unregister an observer function. * * @param {function(Array>,Transaction):void} f Observer function */ unobserveDeep(f: (arg0: Array>, arg1: Transaction) => void): void; /** * @abstract * @return {any} */ toJSON(): any; } export function typeListSlice(type: AbstractType, start: number, end: number): Array; export function typeListToArray(type: AbstractType): Array; export function typeListToArraySnapshot(type: AbstractType, snapshot: Snapshot): Array; export function typeListForEach(type: AbstractType, f: (arg0: any, arg1: number, arg2: any) => void): void; export function typeListMap(type: AbstractType, f: (arg0: C, arg1: number, arg2: AbstractType) => R): R[]; export function typeListCreateIterator(type: AbstractType): IterableIterator; export function typeListForEachSnapshot(type: AbstractType, f: (arg0: any, arg1: number, arg2: AbstractType) => void, snapshot: Snapshot): void; export function typeListGet(type: AbstractType, index: number): any; export function typeListInsertGenericsAfter(transaction: Transaction, parent: AbstractType, referenceItem: Item | null, content: Array<{ [x: string]: any; } | Array | boolean | number | null | string | Uint8Array>): void; export function typeListInsertGenerics(transaction: Transaction, parent: AbstractType, index: number, content: Array<{ [x: string]: any; } | Array | number | null | string | Uint8Array>): void; export function typeListPushGenerics(transaction: Transaction, parent: AbstractType, content: Array<{ [x: string]: any; } | Array | number | null | string | Uint8Array>): void; export function typeListDelete(transaction: Transaction, parent: AbstractType, index: number, length: number): void; export function typeMapDelete(transaction: Transaction, parent: AbstractType, key: string): void; export function typeMapSet(transaction: Transaction, parent: AbstractType, key: string, value: Object | number | null | Array | string | Uint8Array | AbstractType): void; export function typeMapGet(parent: AbstractType, key: string): { [x: string]: any; } | number | null | Array | string | Uint8Array | AbstractType | undefined; export function typeMapGetAll(parent: AbstractType): { [x: string]: { [x: string]: any; } | number | null | Array | string | Uint8Array | AbstractType | undefined; }; export function typeMapHas(parent: AbstractType, key: string): boolean; export function typeMapGetSnapshot(parent: AbstractType, key: string, snapshot: Snapshot): { [x: string]: any; } | number | null | Array | string | Uint8Array | AbstractType | undefined; export function typeMapGetAllSnapshot(parent: AbstractType, snapshot: Snapshot): { [x: string]: { [x: string]: any; } | number | null | Array | string | Uint8Array | AbstractType | undefined; }; export function createMapIterator(type: AbstractType & { _map: Map; }): IterableIterator>; import { Item } from "../structs/Item.js"; import { Transaction } from "../utils/Transaction.js"; import { Doc } from "../utils/Doc.js"; import { EventHandler } from "../utils/EventHandler.js"; import { YEvent } from "../utils/YEvent.js"; import { UpdateEncoderV1 } from "../utils/UpdateEncoder.js"; import { UpdateEncoderV2 } from "../utils/UpdateEncoder.js"; import { Snapshot } from "../utils/Snapshot.js"; //# sourceMappingURL=AbstractType.d.ts.map