Class

RevisionsRepository (revision-history)

@ckeditor/ckeditor5-revision-history/src/revisionsrepository

class

Manages revisions list.

Filtering

Methods

  • addRevision( revision )

    Adds revision to the repository.

    Parameters

    revision : Revision

    The revision instance to add.

  • createRevision( revisionData ) → Revision

    Creates a revision instance from plain object with revision data.

    Parameters

    revisionData : Object

    The object with the revision data. Should be compatible with the format of the object returned by Revision#toJSON().

    Returns

    Revision
  • getIndex( revisionId ) → Number

    Returns the index of the revision with a given revision id.

    Parameters

    revisionId : String

    Returns

    Number
  • getRevision( revisionIdOrIndex ) → Revision | null

    Returns the revision with a given revision id or at a given index.

    Parameters

    revisionIdOrIndex : String | Number

    Returns

    Revision | null
  • getRevisions( [ options ] = { [options.toJSON] } )

    Returns all revisions added to the repository.

    Parameters

    [ options ] : Object
    Properties
    [ options.toJSON ] : Boolean

    Return the data in JSON format.

    Defaults to false