Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge 1649b5f into 0e0cae6
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator authored Jan 3, 2019
2 parents 0e0cae6 + 1649b5f commit cd0edb8
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 46 deletions.
4 changes: 1 addition & 3 deletions src/model/documentselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,7 @@ export default class DocumentSelection {
*
* @see module:engine/model/writer~Writer#setSelection
* @protected
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/node~Node|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
8 changes: 2 additions & 6 deletions src/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ export default class Model {
*
* @fires insertContent
* @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/item~Item|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} [selectable=model.document.selection]
* @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
* The selection into which the content should be inserted. If not provided the current model document selection will be used.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
* This param defines a position in relation to that item.
Expand Down Expand Up @@ -650,9 +648,7 @@ export default class Model {
* // Creates backward selection.
* const selection = writer.createSelection( range, { backward: true } );
*
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/element~Element|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
24 changes: 18 additions & 6 deletions src/model/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ export default class Selection {
* // Creates backward selection.
* const selection = writer.createSelection( range, { backward: true } );
*
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/element~Element|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -368,9 +366,7 @@ export default class Selection {
* // Sets backward selection.
* const selection = writer.createSelection( range, { backward: true } );
*
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/node~Node|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -849,3 +845,19 @@ function findAncestorBlock( node ) {
parent = parent.parent;
}
}

/**
* An entity that is used to set selection.
*
* See also {@link module:engine/model/selection~Selection#setTo}
*
* @typedef {
* module:engine/model/selection~Selection|
* module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|
* module:engine/model/node~Node|
* Iterable.<module:engine/model/range~Range>|
* module:engine/model/range~Range|
* null
* } module:engine/model/selection~Selectable
*/
4 changes: 1 addition & 3 deletions src/model/utils/insertcontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ import Selection from '../selection';
* @param {module:engine/model/model~Model} model The model in context of which the insertion
* should be performed.
* @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/element~Element|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} [selectable=model.document.selection]
* @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
* Selection into which the content should be inserted.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
*/
Expand Down
8 changes: 2 additions & 6 deletions src/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,7 @@ export default class Writer {
/**
* Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.
*
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/element~Element|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -1127,9 +1125,7 @@ export default class Writer {
*
* Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.
*
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/node~Node|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} selectable
* @param {module:engine/model/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
7 changes: 2 additions & 5 deletions src/view/documentselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ export default class DocumentSelection {
* // Creates fake selection with label.
* const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/position~Position|
* Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} [selectable=null]
* @param {module:engine/view/selection~Selectable} [selectable=null]
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -331,8 +329,7 @@ export default class DocumentSelection {
*
* @protected
* @fires change
* @param {module:engine/view/selection~Selection|module:engine/view/position~Position|
* Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|module:engine/view/item~Item|null} selectable
* @param {module:engine/view/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
7 changes: 2 additions & 5 deletions src/view/downcastwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ export default class DowncastWriter {
* // (and be properly handled by screen readers).
* writer.setSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/position~Position|
* Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|module:engine/view/item~Item|null} selectable
* @param {module:engine/view/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -1076,9 +1075,7 @@ export default class DowncastWriter {
* // Creates fake selection with label.
* const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} [selectable=null]
* @param {module:engine/view/selection~Selectable} [selectable=null]
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
24 changes: 18 additions & 6 deletions src/view/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ export default class Selection {
* // Creates fake selection with label.
* const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} [selectable=null]
* @param {module:engine/view/selection~Selectable} [selectable=null]
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -479,9 +477,7 @@ export default class Selection {
* selection.setTo( range, { fake: true, label: 'foo' } );
*
* @fires change
* @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} selectable
* @param {module:engine/view/selection~Selectable} selectable
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down Expand Up @@ -697,3 +693,19 @@ export default class Selection {
}

mix( Selection, EmitterMixin );

/**
* An entity that is used to set selection.
*
* See also {@link module:engine/model/selection~Selection#setTo}
*
* @typedef {
* module:engine/view/selection~Selection|
* module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|
* Iterable.<module:engine/view/range~Range>|
* module:engine/view/range~Range|
* module:engine/view/item~Item|
* null
* } module:engine/view/selection~Selectable
*/
4 changes: 1 addition & 3 deletions src/view/upcastwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,7 @@ export default class UpcastWriter {
* // Creates fake selection with label.
* const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} [selectable=null]
* @param {module:engine/view/selection~Selectable} [selectable=null]
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down
4 changes: 1 addition & 3 deletions src/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,7 @@ export default class View {
* // Creates fake selection with label.
* const selection = view.createSelection( range, { fake: true, label: 'foo' } );
*
* @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection|
* module:engine/view/position~Position|Iterable.<module:engine/view/range~Range>|module:engine/view/range~Range|
* module:engine/view/item~Item|null} [selectable=null]
* @param {module:engine/view/selection~Selectable} [selectable=null]
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
* @param {Object} [options]
* @param {Boolean} [options.backward] Sets this selection instance to be backward.
Expand Down

0 comments on commit cd0edb8

Please sign in to comment.