Interface WalkerClipMethods

Methods used to create or capture clips of document content from a Walker.

Hierarchy

  • WalkerClipMethods

Index

Methods

caret

  • Returns the node at the current caret position as a clip.

    Returns Clip

    A clip of the node at the caret position, or null if there is no node at the caret position.

childField

  • childField(field: number): Clip
  • Returns a clip containing the entire contents of one of the fields of the node at this position. If the field number is negative, the field is counted backward from the last field. Hence, childField(-1) would return the contents of the last child field.

    Parameters

    • field: number

      The field number to clip children from.

    Returns Clip

    A clip of the field content, or null.

children

  • children(field: number, startIndex: number, endIndex: number): Clip
  • Returns a clip of a group of nodes from one of the fields of the node at this position.

    Parameters

    • field: number

      The field number to clip children from.

    • startIndex: number

      The index of the first child node to include.

    • endIndex: number

      The index after the last child node to include.

    Returns Clip

    A clip of the specified children, or null if the subset is empty.

field

  • Returns a clip of the entire contents of the current field, that is, the field that includes the current position.

    see

    Node.field

    Returns Clip

    A clip of the contents of the field, or null if the field is empty.

identifier

  • identifier(symbol: string, dataType?: "string" | "boolean" | "matrix" | DataType | "scalar" | "set" | "point" | "vector" | "tensor" | "unit_name" | "constant_boolean" | "constant_scalar" | "constant_set" | "constant_vector"): Clip
  • Returns a new clip of the specified identifier. See WalkerInsertionMethods.identifier for more information.

    Parameters

    • symbol: string

      The identifier name.

    • Optional dataType: "string" | "boolean" | "matrix" | DataType | "scalar" | "set" | "point" | "vector" | "tensor" | "unit_name" | "constant_boolean" | "constant_scalar" | "constant_set" | "constant_vector"

      The data type of the identifier (default is scalar).

    Returns Clip

    A clip of the specified identifier.

line

  • line(lineNumber: number): Clip
  • Returns a clip of the contents of the specified document line, counting from 0. If the line number is negative, the line is counted from the end of the document, similar to WalkerMovementMethods.line.

    Parameters

    • lineNumber: number

      The line number to clip, or a negative line number to count from the end.

    Returns Clip

    The content of the line as a clip, or null if the line is empty.

node

  • Returns a copy of the node at the current position as a clip. All of the node's children are included.

    see

    Node

    Returns Clip

    A clip of the current node, or null if there is no current node.

number

  • number(digits: string | number): Clip
  • Returns a new clip of the specified number. See WalkerInsertionMethods.number for more information.

    Parameters

    • digits: string | number

      The number to insert.

    Returns Clip

    A clip of the specified number.

object

  • Returns a new clip of the specified editor object. See WalkerInsertionMethods.object for more information.

    Parameters

    • apiName: MathObject

      The name of the object's editor command.

    Returns Clip

    A clip of the specified math object.

  • Returns a new clip of the specified editor object. See WalkerInsertionMethods.object for more information.

    Parameters

    Returns Clip

    A clip of the specified math object.

selection

  • Returns the current editor selection as a clip.

    Returns Clip

    A clip of the selection, or null if there is no selection.

style

  • Returns a new clip of the specified style. See WalkerInsertionMethods.style for more information.

    Parameters

    • color: Color

      The color to apply to styled content.

    • scale: number

    Returns Clip

    A clip of the specified style.

text

  • text(text: string): Clip
  • Returns a new clip of the specified text. See WalkerInsertionMethods.text for more information.

    Parameters

    • text: string

      The text content to insert.

    Returns Clip

    A clip of the specified text.

variable

  • variable(symbol: string, dataType?: "string" | "boolean" | "matrix" | DataType | "scalar" | "set" | "point" | "vector" | "tensor" | "unit_name" | "constant_boolean" | "constant_scalar" | "constant_set" | "constant_vector", accent?: AccentType): Clip
  • Returns a new clip of the specified variable. See WalkerInsertionMethods.variable for more information.

    Parameters

    • symbol: string

      The variable name, which must be exactly one letter.

    • Optional dataType: "string" | "boolean" | "matrix" | DataType | "scalar" | "set" | "point" | "vector" | "tensor" | "unit_name" | "constant_boolean" | "constant_scalar" | "constant_set" | "constant_vector"

      The data type of the variable (default is scalar).

    • Optional accent: AccentType

      The accent to place on the variable (default is none).

    Returns Clip

    A clip of the specified variable.

This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.