Skip to content

Type Editor


Type Editor / @type-editor/changeset / tokenizer/tokenize-textNode / tokenizeTextNode

Function: tokenizeTextNode()

ts
function tokenizeTextNode<T>(
  textNode,
  encoder,
  rangeStart,
  rangeEnd,
  nodeOffset,
  target,
): void;

Defined in: tokenizer/tokenize-textNode.ts:16

Tokenize a text node by encoding each character within the specified range.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
textNodeNode_2The text node to tokenize.
encoderTokenEncoder<T>The encoder to use for converting characters to tokens.
rangeStartnumberThe start position in the document.
rangeEndnumberThe end position in the document.
nodeOffsetnumberThe offset of this node in the document.
targetT[]The array to append tokens to.

Returns

void