yorkie-js-sdk

Home > yorkie-js-sdk > JSONArray

JSONArray type

JSONArray represents JSON array, but unlike regular JSON, it has time tickets created by a logical clock to resolve conflicts.

Signature:

export declare type JSONArray<T> = {
    getID?(): TimeTicket;
    getElementByID?(createdAt: TimeTicket): WrappedElement<T>;
    getElementByIndex?(index: number): WrappedElement<T>;
    getLast?(): WrappedElement<T>;
    deleteByID?(createdAt: TimeTicket): WrappedElement<T>;
    insertBefore?(nextID: TimeTicket, value: any): WrappedElement<T>;
    insertAfter?(prevID: TimeTicket, value: any): WrappedElement<T>;
    moveBefore?(nextID: TimeTicket, id: TimeTicket): void;
    moveAfter?(prevID: TimeTicket, id: TimeTicket): void;
    moveFront?(id: TimeTicket): void;
    moveLast?(id: TimeTicket): void;
} & Array<T>;

References: TimeTicket, WrappedElement