8
0
Эх сурвалжийг харах

Improve docs for views classes.

Mateusz Samsel 6 жил өмнө
parent
commit
4ea18f4c2a

+ 25 - 1
packages/ckeditor5-engine/src/view/attributeelement.js

@@ -125,7 +125,31 @@ export default class AttributeElement extends Element {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		attributeElement.is( 'attributeElement' ); // -> true
+	 *		attributeElement.is( 'element' ); // -> true
+	 *		attributeElement.is( 'node' ); // -> true
+	 *		attributeElement.is( 'view:attributeElement' ); // -> true
+	 *		attributeElement.is( 'view:element' ); // -> true
+	 *		attributeElement.is( 'view:node' ); // -> true
+	 *
+	 *		attributeElement.is( 'model:element' ); // -> false
+	 *		attributeElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is an attribute element, you can also check its
+	 * {@link module:engine/view/attributeelement~AttributeElement#name name}:
+	 *
+	 *		attributeElement.is( 'b' ); // -> true if this is a bold element
+	 *		attributeElement.is( 'attributeElement', 'b' ); // -> same as above
+	 *		text.is( 'b' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type && type.replace( /^view:/, '' );

+ 25 - 1
packages/ckeditor5-engine/src/view/containerelement.js

@@ -51,7 +51,31 @@ export default class ContainerElement extends Element {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		containerElement.is( 'containerElement' ); // -> true
+	 *		containerElement.is( 'element' ); // -> true
+	 *		containerElement.is( 'node' ); // -> true
+	 *		containerElement.is( 'view:containerElement' ); // -> true
+	 *		containerElement.is( 'view:element' ); // -> true
+	 *		containerElement.is( 'view:node' ); // -> true
+	 *
+	 *		containerElement.is( 'model:element' ); // -> false
+	 *		containerElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is a container element, you can also check its
+	 * {@link module:engine/view/containerelement~ContainerElement#name name}:
+	 *
+	 *		containerElement.is( 'div' ); // -> true if this is a div container element
+	 *		containerElement.is( 'contaienrElement', 'div' ); // -> same as above
+	 *		text.is( 'div' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type && type.replace( /^view:/, '' );

+ 8 - 6
packages/ckeditor5-engine/src/view/documentfragment.js

@@ -94,14 +94,16 @@ export default class DocumentFragment {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 * for example `view:documentFragment`. 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 type.
 	 *
-	 * Acceptable type for this class is `documentFragment` and its prefixed version.
+	 *		docFrag.is( 'documentFragment' ); // -> true
+	 *		docFrag.is( 'view:documentFragment' ); // -> true
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		docFrag.is( 'model:documentFragment' ); // -> false
+	 *		docFrag.is( 'element' ); // -> false
+	 *		docFrag.is( 'node' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 10 - 6
packages/ckeditor5-engine/src/view/documentselection.js

@@ -275,14 +275,18 @@ export default class DocumentSelection {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 * for example `view: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 type.
 	 *
-	 * Acceptable types for this class are `selection` and `documentSelection` and its prefixed version.
+	 *		docSelection.is( 'selection' ); // -> true
+	 *		docSelection.is( 'documentSelection' ); // -> true
+	 *		docSelection.is( 'view:selection' ); // -> true
+	 *		docSelection.is( 'view:documentSelection' ); // -> true
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		docSelection.is( 'model:documentSelection' ); // -> false
+	 *		docSelection.is( 'element' ); // -> false
+	 *		docSelection.is( 'node' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 25 - 1
packages/ckeditor5-engine/src/view/editableelement.js

@@ -67,7 +67,31 @@ export default class EditableElement extends ContainerElement {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		editableElement.is( 'editableElement' ); // -> true
+	 *		editableElement.is( 'element' ); // -> true
+	 *		editableElement.is( 'node' ); // -> true
+	 *		editableElement.is( 'view:editableElement' ); // -> true
+	 *		editableElement.is( 'view:element' ); // -> true
+	 *		editableElement.is( 'view:node' ); // -> true
+	 *
+	 *		editableElement.is( 'model:element' ); // -> false
+	 *		editableElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is an editbale element, you can also check its
+	 * {@link module:engine/view/editableelement~EditableElement#name name}:
+	 *
+	 *		editableElement.is( 'div' ); // -> true if this is a div element
+	 *		editableElement.is( 'editableElement', 'div' ); // -> same as above
+	 *		text.is( 'div' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type && type.replace( /^view:/, '' );

+ 16 - 16
packages/ckeditor5-engine/src/view/element.js

@@ -147,27 +147,27 @@ export default class Element extends Node {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 * for example `view:element`. 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.
 	 *
-	 * There is also possibility to check element's {@link #name} rather than just type. Name might be provided as second attribute
-	 * or might replace the type.
+	 *		element.is( 'element' ); // -> true
+	 *		element.is( 'node' ); // -> true
+	 *		element.is( 'view:element' ); // -> true
+	 *		element.is( 'view:node' ); // -> true
 	 *
-	 *		// obj is a `li` element
-	 *		obj.is( 'element' ); // true
-	 *		obj.is( 'view:element' ); // true
-	 *		obj.is( 'li' ); // true
-	 *		obj.is( 'element', 'li' ); // true
-	 *		obj.is( 'text' ); // false
-	 *		obj.is( 'element', 'img' ); // false
+	 *		element.is( 'model:element' ); // -> false
+	 *		element.is( 'documentSelection' ); // -> false
 	 *
-	 * Acceptable type for this class is `element` and its prefixed version, element's name or combination of both arguments.
+	 * Assuming that the object being checked is an element, you can also check its
+	 * {@link module:engine/view/element~Element#name name}:
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		element.is( 'img' ); // -> true if this is an <img> element
+	 *		element.is( 'element', 'img' ); // -> same as above
+	 *		text.is( 'img' ); -> false
 	 *
-	 * @param {String} type
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
 	 * @param {String} [name] Element name.
 	 * @returns {Boolean}
 	 */

+ 25 - 1
packages/ckeditor5-engine/src/view/emptyelement.js

@@ -44,7 +44,31 @@ export default class EmptyElement extends Element {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		emptyElement.is( 'emptyElement' ); // -> true
+	 *		emptyElement.is( 'element' ); // -> true
+	 *		emptyElement.is( 'node' ); // -> true
+	 *		emptyElement.is( 'view:emptyElement' ); // -> true
+	 *		emptyElement.is( 'view:element' ); // -> true
+	 *		emptyElement.is( 'view:node' ); // -> true
+	 *
+	 *		emptyElement.is( 'model:element' ); // -> false
+	 *		emptyElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is an empty element, you can also check its
+	 * {@link module:engine/view/emptyelement~EmptyElement#name name}:
+	 *
+	 *		emptyElement.is( 'img' ); // -> true if this is a img element
+	 *		emptyElement.is( 'emptyElement', 'img' ); // -> same as above
+	 *		text.is( 'img' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type.replace( /^view:/, '' );

+ 36 - 21
packages/ckeditor5-engine/src/view/node.js

@@ -290,32 +290,47 @@ export default class Node {
 	}
 
 	/**
-	 * Checks whether this view object is of the given type.
+	 * Checks whether this object is of the given type.
 	 *
-	 * This method is useful when processing view tree objects that are of unknown type. For example, a function
-	 * may return {@link module:engine/view/documentfragment~DocumentFragment} or {@link module:engine/view/node~Node}
-	 * that can be either text node or element. This method can be used to check what kind of object is returned.
-	 * All checked types might be prefixed with `view:` to narrow search exclusively to view's objects.
-	 * That should prevent of situation where `model:node` accidentally might be considered as `view:node`.
-	 * Types are defined as name of the class written in [camelCase](https://en.wikipedia.org/wiki/Camel_case) notation.
-	 * E.g. class `RootEditableElement` will get type `rootEditableElement`.
+	 * This method is useful when processing view objects that are of unknown type. For example, a function
+	 * may return a {@link module:engine/view/documentfragment~DocumentFragment} or a {@link module:engine/view/node~Node}
+	 * that can be either a text node or an element. This method can be used to check what kind of object is returned.
 	 *
-	 *		obj.is( 'node' ); // true for any node, false for document fragment and text fragment
-	 *		obj.is( 'view:node' ); // true for any node, false for document fragment and text fragment
-	 *		obj.is( 'documentFragment' ); // true for document fragment, false for any node
-	 *		obj.is( 'view:documentFragment' ); // true for document fragment, false for any node
-	 *		obj.is( 'element' ); // true for any element, false for text node or document fragment
-	 *		obj.is( 'view:element' ); // true for any element, false for text node or document fragment
-	 *		obj.is( 'element', 'p' ); // true only for element which name is 'p'
-	 *		obj.is( 'view:element', 'p' ); // true only for element which name is 'p'
-	 *		obj.is( 'p' ); // shortcut for obj.is( 'element', 'p' )
-	 *		obj.is( 'view:p' ); // shortcut for obj.is( 'view:element', 'p' )
-	 *		obj.is( 'text' ); // true for text node, false for element and document fragment
-	 *		obj.is( 'view:text' ); // true for text node, false for element and document fragment
+	 *		someObject.is( 'element' ); // -> true if this is an element
+	 *		someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
+	 *		someObject.is( 'documentFragment' ); // -> true if this is a document fragment
 	 *
+	 * Since this method is also available on a range of model objects, you can prefix the type of the object with
+	 * `model:` or `view:` to check, for example, if this is the model's or view's element:
 	 *
-	 * Acceptable types for this class is `node` and its prefixed version.
+	 *		viewElement.is( 'view:element' ); // -> true
+	 *		viewElement.is( 'model:element' ); // -> false
 	 *
+	 * By using this method it is also possible to check a name of an element:
+	 *
+	 *		imgElement.is( 'img' ); // -> true
+	 *		imgElement.is( 'element', 'img' ); // -> same as above
+	 *		imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
+	 *
+	 * The list of view objects which implement the `is()` method:
+	 *
+	 * * {@link module:engine/view/attributeelement~AttributeElement#is `AttributeElement#is()`}
+	 * * {@link module:engine/view/containerelement~ContainerElement#is `ContainerElement#is()`}
+	 * * {@link module:engine/view/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
+	 * * {@link module:engine/view/documentselection~DocumentSelection#is `DocumentSelection#is()`}
+	 * * {@link module:engine/view/editableelement~EditableElement#is `EditableElement#is()`}
+	 * * {@link module:engine/view/element~Element#is `Element#is()`}
+	 * * {@link module:engine/view/emptyelement~EmptyElement#is `EmptyElement#is()`}
+	 * * {@link module:engine/view/node~Node#is `Node#is()`}
+	 * * {@link module:engine/view/position~Position#is `Position#is()`}
+	 * * {@link module:engine/view/range~Range#is `Range#is()`}
+	 * * {@link module:engine/view/rooteditableelement~RootEditableElement#is `RootEditableElement#is()`}
+	 * * {@link module:engine/view/selection~Selection#is `Selection#is()`}
+	 * * {@link module:engine/view/text~Text#is `Text#is()`}
+	 * * {@link module:engine/view/textproxy~TextProxy#is `TextProxy#is()`}
+	 * * {@link module:engine/view/uielement~UIElement#is `UIElement#is()`}
+	 *
+	 * @method #is
 	 * @param {String} type
 	 * @returns {Boolean}
 	 */

+ 8 - 6
packages/ckeditor5-engine/src/view/position.js

@@ -207,14 +207,16 @@ export default class Position {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 * for example `view:position`. 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 type.
 	 *
-	 * Acceptable type for this class is `position` and its prefixed version.
+	 *		position.is( 'position' ); // -> true
+	 *		position.is( 'view:position' ); // -> true
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		position.is( 'model:position' ); // -> false
+	 *		position.is( 'element' ); // -> false
+	 *		position.is( 'range' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 8 - 6
packages/ckeditor5-engine/src/view/range.js

@@ -395,14 +395,16 @@ export default class Range {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 *  for example `view:range`. 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 type.
 	 *
-	 * Acceptable type for this class is `range` and its prefixed version.
+	 *		range.is( 'range' ); // -> true
+	 *		range.is( 'view:range' ); // -> true
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		range.is( 'model:range' ); // -> false
+	 *		range.is( 'element' ); // -> false
+	 *		range.is( 'selection' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 27 - 1
packages/ckeditor5-engine/src/view/rooteditableelement.js

@@ -38,7 +38,33 @@ export default class RootEditableElement extends EditableElement {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		rootEditableElement.is( 'rootEditableElement' ); // -> true
+	 *		rootEditableElement.is( 'editableElement' ); // -> true
+	 *		rootEditableElement.is( 'element' ); // -> true
+	 *		rootEditableElement.is( 'node' ); // -> true
+	 *		rootEditableElement.is( 'view:rootEditableElement' ); // -> true
+	 *		rootEditableElement.is( 'view:editableElement' ); // -> true
+	 *		rootEditableElement.is( 'view:element' ); // -> true
+	 *		rootEditableElement.is( 'view:node' ); // -> true
+	 *
+	 *		rootEditableElement.is( 'model:element' ); // -> false
+	 *		rootEditableElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is a root editbale element, you can also check its
+	 * {@link module:engine/view/rooteditableelement~RootEditableElement#name name}:
+	 *
+	 *		rootEditableElement.is( 'div' ); // -> true if this is a div root editable element
+	 *		rootEditableElement.is( 'rootEditableElement', 'div' ); // -> same as above
+	 *		text.is( 'div' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type.replace( /^view:/, '' );

+ 7 - 13
packages/ckeditor5-engine/src/view/selection.js

@@ -598,22 +598,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 `view:` string,
-	 * for example `view: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 type.
 	 *
-	 *		const selection = new Selection( ... );
+	 *		selection.is( 'selection' ); // -> true
+	 *		selection.is( 'view:selection' ); // -> true
 	 *
-	 *		selection.is( 'selection' ); // true
-	 *		selection.is( 'view:selection' ); // true
-	 *		selection.is( 'node' ); // false
-	 *		selection.is( 'element' ); // false
+	 *		selection.is( 'model:selection' ); // -> false
+	 *		selection.is( 'element' ); // -> false
+	 *		selection.is( 'range' ); // -> false
 	 *
-	 * Acceptable type for this class is `selection` and its prefixed version.
-	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
-
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 15 - 1
packages/ckeditor5-engine/src/view/text.js

@@ -42,7 +42,21 @@ export default class Text extends Node {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given type.
+	 *
+	 *		text.is( 'text' ); // -> true
+	 *		text.is( 'node' ); // -> true
+	 *		text.is( 'view:text' ); // -> true
+	 *		text.is( 'view:node' ); // -> true
+	 *
+	 *		text.is( 'model:text' ); // -> false
+	 *		text.is( 'element' ); // -> false
+	 *		text.is( 'range' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type
+	 * @returns {Boolean}
 	 */
 	is( type ) {
 		return type == 'text' || type == 'view:text' || super.is( type );

+ 8 - 6
packages/ckeditor5-engine/src/view/textproxy.js

@@ -141,14 +141,16 @@ export default class TextProxy {
 	}
 
 	/**
-	 * Method verifies if the checked object belongs to a given a type. Type's name might be prefixed with a `view:` string,
-	 * for example `view:textProxy`. 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 type.
 	 *
-	 * Acceptable type for this class is `textProxy` and its prefixed version.
+	 *		textProxy.is( 'textProxy' ); // -> true
+	 *		textProxy.is( 'view:textProxy' ); // -> true
 	 *
-	 * See also: {@link module:engine/view/node~Node#is `Node#is()`}.
+	 *		textProxy.is( 'model:textProxy' ); // -> false
+	 *		textProxy.is( 'element' ); // -> false
+	 *		textProxy.is( 'range' ); // -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
 	 *
 	 * @param {String} type
 	 * @returns {Boolean}

+ 25 - 1
packages/ckeditor5-engine/src/view/uielement.js

@@ -57,7 +57,31 @@ export default class UIElement extends Element {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Checks whether this object is of the given.
+	 *
+	 *		uiElement.is( 'uiElement' ); // -> true
+	 *		uiElement.is( 'element' ); // -> true
+	 *		uiElement.is( 'node' ); // -> true
+	 *		uiElement.is( 'view:uiElement' ); // -> true
+	 *		uiElement.is( 'view:element' ); // -> true
+	 *		uiElement.is( 'view:node' ); // -> true
+	 *
+	 *		uiElement.is( 'model:element' ); // -> false
+	 *		uiElement.is( 'documentFragment' ); // -> false
+	 *
+	 * Assuming that the object being checked is an ui element, you can also check its
+	 * {@link module:engine/view/uielement~UIElement#name name}:
+	 *
+	 *		uiElement.is( 'span' ); // -> true if this is a span ui element
+	 *		uiElement.is( 'uiElement', 'span' ); // -> same as above
+	 *		text.is( 'span' ); -> false
+	 *
+	 * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
+	 *
+	 * @param {String} type Type to check when `name` parameter is present.
+	 * Otherwise, it acts like the `name` parameter.
+	 * @param {String} [name] Element name.
+	 * @returns {Boolean}
 	 */
 	is( type, name = null ) {
 		const cutType = type.replace( /^view:/, '' );