modern-xlsx API Reference - v1.3.0
    Preparing search index...

    Type Alias TokenType

    TokenType:
        | "number"
        | "string"
        | "boolean"
        | "error"
        | "cell_ref"
        | "range"
        | "name"
        | "function"
        | "operator"
        | "paren_open"
        | "paren_close"
        | "comma"
        | "semicolon"
        | "colon"
        | "percent"
        | "prefix_op"
        | "array_open"
        | "array_close"
        | "array_row_sep"
        | "array_col_sep"
        | "column_range"
        | "row_range"
        | "structured_ref"

    The kind of a Token.

    'range' is never produced by tokenize: a range such as A1:B2 lexes as cell_ref, colon, cell_ref. The member is deprecated and is removed in 2.0.

    Type Declaration

    • "number"

      Numeric literal (1, 3.14, .5, 1E+3); the value is the source text.

    • "string"

      String literal; the value is the unescaped content without quotes.

    • "boolean"

      TRUE or FALSE (any case); the value is upper-cased.

    • "error"

      One of the Excel error literals (#N/A, #SPILL!, ...). A sheet-qualified literal such as Sheet1!#REF! is one token whose value is the literal alone and whose span covers the prefix.

    • "cell_ref"

      Cell reference with any sheet or 3-D prefix: A1, $B$2, Sheet1!A1, Sheet1:Sheet3!A1. Every one lies inside the grid A1:XFD1048576.

    • "range"

      Deprecated: never emitted by tokenize(); removed in 2.0. A1:B2 tokenizes as cell_ref, colon, cell_ref; parseFormula() joins them into an AST node of type 'range', so match that node type instead.

    • "name"

      Defined name: an identifier that is not a function, boolean or cell reference inside the grid (so XFE1 and A0 are names, as in Excel), or quoted text with no ! after it.

    • "function"

      Identifier immediately followed by (; the value excludes the parenthesis.

    • "operator"

      Binary operator: + - * / ^ & = <> < > <= >=, or ' ' (a single space) for the intersection operator, emitted for a whitespace run between a reference and the start of another reference.

    • "paren_open"
    • "paren_close"
    • "comma"

      , outside an array constant.

    • "semicolon"

      ; outside an array constant. Stored formulas use ; only as the array-constant row separator, so this token is always accompanied by the error "';' at position N is only valid as an array-constant row separator".

    • "colon"

      : that is not part of a column_range, row_range or 3-D prefix.

    • "percent"
    • "prefix_op"

      Unary + or -.

    • "array_open"
    • "array_close"
    • "array_row_sep"

      ; inside an array constant.

    • "array_col_sep"

      , inside an array constant.

    • "column_range"

      Whole-column range with any sheet prefix: A:A, $A:$C, Data!B:C; both columns within XFD.

    • "row_range"

      Whole-row range with any sheet prefix: 1:1, $2:$5, Sheet1!2:5; both rows within 1..1048576.

    • "structured_ref"

      Structured table reference: Table1[Col], Table1[[#Headers],[Col]], [@Col].