SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Type Alias GrepField

    GrepField:
        | "display"
        | "value"
        | "formula"
        | "hyperlink"
        | "numberFormat"
        | "comment"
        | "shape"
        | "chart"
        | "name"

    The layers grep can match against.

    Type Declaration

    • "display"

      The cell as displayed — number format applied.

      4%, 2024-01-01, $1,234.57, TRUE, #N/A, hello.

      Not named text: that reads as "cells containing text", and there is no longer an SDK method of that name to be consistent with. display and value name what they are and pair without explanation.

      Runs through the shared encoder, which is the point: whatever text a values read printed, grep finds, because one encoder produced both. A second display path would fail on exactly the strings an agent copied out of the previous tool call.

    • "value"

      The stored scalar — what getValue() returns, with no number format applied.

      1234.5678 where display shows $1,234.57, 0.4 where it shows 40%, dates as serial numbers. This is the layer a cell report's Value line and the IRange / stats reads print, so it is the field that makes those printed values greppable — the round-trip that display provides for formatted reads. Not a default: serials and unrounded floats are noise until they are the question.

      Identical to display for every cell whose format only decorates (General, plain text) — a search of both dedupes that case per cell rather than reporting it twice.

    • "formula"

      Formula text, A1 style (=SUM(A1:A10)). Cells without a formula contribute nothing.

    • "hyperlink"

      Hyperlink target — the address, not the display text (which is already display).

    • "numberFormat"

      The number format code — 0.00%, $#,##0.00, mm/dd/yyyy.

      Authored text (it is literally what was typed into Format Cells), canonical, and regex is its native matcher. --fields numberFormat "%" is the well-posed form of "which cells are percentages" — the rendered 40% is not. Matches cells with a direct format, including value-less ones (a formatted-but-empty column is a real finding).

    • "comment"

      The comment or note on a cell, and every reply in its thread — each its own row.

      A cell layer like the others: the match is the commented cell, and a cell that matches in its display AND its comment is one cell. A comment on an empty cell is still found.

    • "shape"

      The text written on a shape — a text box, a callout — and its alt text.

      The match is the shape, addressed by the cells it is anchored over (F2:H6), which is what range.getMovables() takes to get back to it.

    • "chart"

      What a chart says in words: its title, its axis titles, the series names written into it, and its alt text. Addressed like a shape.

      A series named by a cell (=Sales!$C$3) is not repeated here — that text is the cell's, and display already finds it there.

    • "name"

      Defined names and tables: the name, what it refers to (=Summary!$B$4, =0.21) and its comment.

      The match is the name, spelled as a formula writes it ('EU Ops'!Rate when sheet-scoped) — a name has no cell of its own. Under a scope a name is searched when it is scoped to a searched sheet or designates cells inside the searched range.

    These are not ICell.Content. That enum also carries formats, tables, merges and warnings, which have no text to match — selection by attribute is the regions read, not grep.

    The rule, which predicts any future member: a grep field is a layer whose text was authored by a person or is read by one.

    display and value are read; formula, hyperlink and numberFormat are authored. A layer that fails the rule fails it because its payload has no canonical text — a fill's "red" may be stored as FF0000, a theme slot, or an indexed palette entry, so any pattern against it silently matches less than it claims: a confident wrong answer, which is worse than a missing feature. Color wants nearness, not matching — that is selection by attribute, and it belongs to the regions read.

    The rule does not stop at the cell. A callout, a chart title, a comment and a defined name are all text a person wrote into the workbook, and none of it is in any cell — so comment, shape, chart and name are layers too, tagged the same way. A search that finds the cell reading Fund Size and misses the callout explaining it has answered a narrower question than the one asked.

    There is no note field: a note is a comment that says so (IComment.isNote), and comment searches both.