RevisionsRepository (revision-history)
@ckeditor/ckeditor5-revision-history/src/revisionsrepository
Manages revisions list.
Filtering
Methods
-
addRevision( revision, [ index ] )
module:revision-history/revisionsrepository~RevisionsRepository#addRevision
Adds revision to the repository on a given index.
Parameters
revision : Revision
The revision instance to add.
[ index ] : Number
Index on which the revision should be added. If not set, the revision will be added as the first revision.
Defaults to
0
-
createRevision( revisionData ) → Revision
module:revision-history/revisionsrepository~RevisionsRepository#createRevision
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
-
getIndex( revisionId ) → Number
module:revision-history/revisionsrepository~RevisionsRepository#getIndex
Returns the index of the revision with a given revision id.
Parameters
revisionId : String
Returns
Number
-
getRevision( revisionIdOrIndex ) → Revision | null
module:revision-history/revisionsrepository~RevisionsRepository#getRevision
Returns the revision with a given revision id or at a given index.
-
getRevisions( [ options ] = { [options.toJSON] } ) → Array.<(Revision | Object)>
module:revision-history/revisionsrepository~RevisionsRepository#getRevisions
Returns all revisions added to the repository.
Parameters
[ options ] : Object
-
Properties
[ options.toJSON ] : Boolean
Return the data in JSON format.
Defaults to
false
Returns
Array.<(Revision | Object)>
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.