Skip to main content

tw5-typed / modules/utils/parsetree

Module: modules/utils/parsetree

Table of contents

Functions

Functions

addAttributeToParseTreeNode

addAttributeToParseTreeNode(node, name, value?): void

Add attribute to parse tree node.

Parameters

NameTypeDescription
nodeanyThe parse tree node.
namestring | objectThe name of the attribute.
value?anyThe 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

NameTypeDescription
nodeanyThe parse tree node.
classStringstringThe 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

NameTypeDescription
nodeanyThe parse tree node.
namestringThe name of the style.
valuestringThe 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

NameTypeDescription
nodeArrayany[]The array of parse tree nodes.
searchObjectThe search object.
search.tagstring-
search.typestring-

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

NameTypeDescription
nodeanyThe parse tree node.
namestringThe name of the attribute.
defaultValue?anyThe 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

NameTypeDescription
nodeanyThe 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

NameTypeDescription
treeanyThe parse tree node or array of nodes.

Returns

string

The text of the parse tree node or array of nodes.

Description

获取解析树节点或节点数组的文本。

Defined in

src/modules/utils/parsetree.d.ts:80