tw5-typed / modules/utils/parsetree
Module: modules/utils/parsetree
Table of contents
Functions
- addAttributeToParseTreeNode
- addClassToParseTreeNode
- addStyleToParseTreeNode
- findParseTreeNode
- getAttributeValueFromParseTreeNode
- getOrderedAttributesFromParseTreeNode
- getParseTreeText
Functions
addAttributeToParseTreeNode
▸ addAttributeToParseTreeNode(node
, name
, value?
): void
Add attribute to parse tree node.
Parameters
Name | Type | Description |
---|---|---|
node | any | The parse tree node. |
name | string | object | The name of the attribute. |
value? | any | The value of the attribute. |
Returns
void
Description
向解析树节点添加属性。
Defined in
src/modules/utils/parsetree.d.ts:13
addClassToParseTreeNode
▸ addClassToParseTreeNode(node
, classString
): void
Add class to parse tree node.
Parameters
Name | Type | Description |
---|---|---|
node | any | The parse tree node. |
classString | string | The class string to add. |
Returns
void
Description
向解析树节点添加类。
Defined in
src/modules/utils/parsetree.d.ts:47
addStyleToParseTreeNode
▸ addStyleToParseTreeNode(node
, name
, value
): void
Add style to parse tree node.
Parameters
Name | Type | Description |
---|---|---|
node | any | The parse tree node. |
name | string | The name of the style. |
value | string | The value of the style. |
Returns
void
Description
向解析树节点添加样式。
Defined in
src/modules/utils/parsetree.d.ts:56
findParseTreeNode
▸ findParseTreeNode(nodeArray
, search
): any
Find parse tree node.
Parameters
Name | Type | Description |
---|---|---|
nodeArray | any [] | The array of parse tree nodes. |
search | Object | The search object. |
search.tag | string | - |
search.type | string | - |
Returns
any
The parse tree node.
Description
查找解析树节点。
Defined in
src/modules/utils/parsetree.d.ts:69
getAttributeValueFromParseTreeNode
▸ getAttributeValueFromParseTreeNode(node
, name
, defaultValue?
): any
Get attribute value from parse tree node.
Parameters
Name | Type | Description |
---|---|---|
node | any | The parse tree node. |
name | string | The name of the attribute. |
defaultValue? | any | The default value of the attribute. |
Returns
any
The value of the attribute.
Description
从解析树节点获取属性值。
Defined in
src/modules/utils/parsetree.d.ts:35
getOrderedAttributesFromParseTreeNode
▸ getOrderedAttributesFromParseTreeNode(node
): any
[]
Get ordered attributes from parse tree node.
Parameters
Name | Type | Description |
---|---|---|
node | any | The parse tree node. |
Returns
any
[]
The ordered attributes.
Description
从解析树节点获取有序属性。
Defined in
src/modules/utils/parsetree.d.ts:25
getParseTreeText
▸ getParseTreeText(tree
): string
Get the text of a parse tree node or array of nodes.
Parameters
Name | Type | Description |
---|---|---|
tree | any | The parse tree node or array of nodes. |
Returns
string
The text of the parse tree node or array of nodes.
Description
获取解析树节 点或节点数组的文本。