|
|
@@ -623,22 +623,16 @@ export default class Selection {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `model:` string,
|
|
|
- * for example `model:selection`. Type is a string which usually equal to a name of the class written in camelCase convention.
|
|
|
- * If the object is a class instance, which has a parent class with `is()` method, then type verification returns `true`
|
|
|
- * for any type match for an entire child-parent chain.
|
|
|
+ * Checks whether this object is of the given.
|
|
|
*
|
|
|
- * const selection = new Selection( ... );
|
|
|
+ * selection.is( 'selection' ); // -> true
|
|
|
+ * selection.is( 'model:selection' ); // -> true
|
|
|
*
|
|
|
- * selection.is( 'selection' ); // true
|
|
|
- * selection.is( 'model:selection' ); // true
|
|
|
- * selection.is( 'node' ); // false
|
|
|
- * selection.is( 'element' ); // false
|
|
|
- * selection.is( 'view:selection' ); // false
|
|
|
+ * selection.is( 'view:selection' ); // -> false
|
|
|
+ * selection.is( 'range' ); // -> false
|
|
|
*
|
|
|
- * Acceptable type for this class is `selection` and its prefixed version.
|
|
|
+ * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
|
|
|
*
|
|
|
- * See also: {@link module:engine/model/node~Node#is `Node#is()`}.
|
|
|
* @param {String} type
|
|
|
* @returns {Boolean}
|
|
|
*/
|