Extends
Methods
canNodeContainContent(type) → {boolean}
#
Check if a node can contain content.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node contains content
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
canNodeHaveChildren(type) → {boolean}
#
Check if a node can have children.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node can have children
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
canNodeHaveChildrenNotContent(type) → {boolean}
#
Check if a node can have children but not content nor be content.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node can have children but not content nor be content
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
canNodeSerializeAsContent(type) → {boolean}
#
Check if a node can be serialized into a content position
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node is content or can be round-tripped into a content position
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
canNodeTakeAnnotation(type, annotation) → {boolean}
#
Check if node can take an annotation.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
annotation |
ve.dm.Annotation | Annotation to test |
- Source:
Returns:
Node can take annotations of this type
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
createFromElement(element, […args]) → {ve.dm.Model}
#
Create a new item from a model element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
Object | Model element |
|
args |
any |
optional repeatable |
Arguments to pass to the constructor |
- Inherited from:
- Source:
Returns:
Model constructed from element
- Type
- ve.dm.Model
Throws:
-
Element must have a .type property
- Type
- Error
doesNodeHandleOwnChildren(type) → {boolean}
#
Check if the node handles its own children.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node handles its own children
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
doesNodeHaveSignificantWhitespace(type) → {boolean}
#
Check if the node has significant whitespace.
Can only be true if canContainContent is also true.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node has significant whitespace
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
getChildNodeTypes(type) → {Array.<string>|null
}
#
null
}
#
getDataElement(type, attributes) → {Object}
#
getParentNodeTypes(type) → {Array.<string>|null
}
#
null
}
#
getSuggestedParentNodeTypes(type) → {Array.<string>|null
}
#
null
}
#
isMetaData(type) → {boolean}
#
Check if a node is a meta item element
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node is meta data
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeContent(type) → {boolean}
#
Check if a node is content.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
The node is content
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeDeletable(type) → {boolean}
#
Check if node is deletable.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node is internal
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeFocusable(type) → {boolean}
#
Check if the node is focusable.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node is focusable
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeInternal(type) → {boolean}
#
Check if the node is internal.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node is internal
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeUnwrappable(type) → {boolean}
#
Check if a node is unwrappable.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node is unwrappable
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isNodeWrapped(type) → {boolean}
#
Check if a node has a wrapped element in the document data.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node has a wrapping element
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error
isRemovableMetaData(type) → {boolean}
#
Check if a given type of meta item is removable
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Meta item type |
- Source:
Returns:
The type is removable
- Type
- boolean
Throws:
-
Unknown item type
- Type
- Error
shouldIgnoreChildren(type) → {boolean}
#
Check if the node's children should be ignored.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Node type |
- Source:
Returns:
Whether the node's children should be ignored
- Type
- boolean
Throws:
-
Unknown node type
- Type
- Error