SheetXL - v0.3.20
    Preparing search index...

    Interface ICell

    A single unit of data and meta data within an ICellRange, located at a specific row and column.

    interface ICell {
        isICell: true;
        createTemporaryCell(modifiers: ICell.Update): ICell;
        getA1(): string;
        getBestFit(
            colWidth?: number,
            minContent?: boolean,
        ): Readonly<Partial<Dimensions>>;
        getCalcStatus(): CalcStatus;
        getColumnFilter(): IColumn;
        getComments(): Readonly<IComment.Properties>;
        getCoords(): Readonly<IRange.CellCoords>;
        getErrors(): readonly string[];
        getExtrusions(): Readonly<IRange.Coords>;
        getFormula(): IFormula;
        getFormulaText(): string;
        getHyperlink(): IHyperlink;
        getInsets(): Readonly<Rectangle>;
        getNumberFormat(override?: string): Parsed;
        getProtection(): ICellProtection;
        getRenderHorizontalAlignment(): ITextFrame.HorizontalAlignment;
        getSource<S>(): S;
        getSpans(): Readonly<Dimensions>;
        getSpill(): ICellRange;
        getStyle(specific?: boolean): IStyle;
        getTextFrame(useFormula?: boolean): ITextFrame;
        getTextOverflow(): Readonly<HorizontalOverflow>;
        getType(): ScalarType;
        getValue(): Scalar;
        getWarnings(): readonly string[];
        isContentful(): boolean;
        isEditAllowed(): boolean;
        isEmpty(): boolean;
        isEqual(other: ICell): boolean;
        isFormulaHidden(): boolean;
        isSpillOverflow(): boolean;
        isTopLeft(): boolean;
        select(options?: ITypes.SelectOptions): Promise<boolean>;
        toDate(): Date;
        toText(): string;
        toTextUnformatted(useFormula?: boolean): string;
    }
    Index

    Properties

    isICell: true

    For runtime type checking.

    Methods

    • Creates a temporary copy of the cell with the specified updates applied.

      Parameters

      Returns ICell

      The original cell remains unchanged, making this useful for temporary modifications.

    • Returns an A1-style string address (e.g., 'A1', 'B5').

      Returns string

    • Calculates the optimal size required to display the cell's content.

      Parameters

      • OptionalcolWidth: number

        The column width, used for text wrapping calculations. Default value the current column width.

      • OptionalminContent: boolean

        If true, calculates the size using the min width possible. For decimal numbers this will round.

      Returns Readonly<Partial<Dimensions>>

      Returns null if this cell should be ignored for sizing purposes. Either dimension can also be null, indicating that the specific direction should not be used.

    • Return an IAutoFilter.IColumn if the cell is the the first row of an AutoFiltered range.

      Returns IColumn

    • Retrieves a list of comments associated with the cell.

      Note: This feature is not yet implemented.

      Returns Readonly<IComment.Properties>

    • Retrieves any errors attached to the cell.

      Returns readonly string[]

    • Returns the extruding range of the cell if it extends beyond its original coordinates.

      Returns Readonly<IRange.Coords>

      Useful for cells that have been merged or have text overflow. This can also be included when iterating ranges with the extendedRange flag set to true.

    • Returns the formula assigned to the cell.

      Returns IFormula

      Returns null if the cell has no formula.

    • Returns the formula text assigned to the cell.

      Returns string

      Returns null if the cell has no formula.

    • Returns the hyperlink assigned to the cell.

      Returns IHyperlink

      Returns null if no hyperlink is set.

    • Returns the padding around the cell's content.

      Returns Readonly<Rectangle>

      Insets do not affect the fill or background of the cell.

    • Returns the cell's value as a string with additional number format details.

      Parameters

      • Optionaloverride: string

        A custom number format to apply (optional).

      Returns Parsed

      This method always returns a formatted string and never null.

    • Returns the Sheet.

      Type Parameters

      • S

        The callback return type.

      Returns S

    • Returns the span dimensions for merged cells.

      Returns Readonly<Dimensions>

    • Returns the style information applied to the cell.

      Parameters

      • Optionalspecific: boolean

        default true

      Returns IStyle

      If true, Returns the style directly set on the cell. Otherwise, returns the rendered style, which may include effects like conditional or table formatting.

    • Retrieves a ITextFrame containing text layout details, such as wrapping and alignment.

      Parameters

      • OptionaluseFormula: boolean

        If true this will return a text frame for formula (if there is one).

      Returns ITextFrame

      Returns null if the cell does not contain text or does not contain a formula. This includes text formatting, rich text, and number formatting.

    • Returns the overflow details for the cell's text overflow or null if the cell does not overflow.

      Returns Readonly<HorizontalOverflow>

      • This will only return a value if iterating using ICellRange.Orientation.Row.
    • Returns the value of the cell.

      Returns Scalar

      Returns null if the cell has no value.

    • Retrieves any warnings attached to the cell.

      Returns readonly string[]

      Warnings differ from errors in that they may alter the display of the cell's value or type.

    • Returns true if the cell contains a value.

      Returns boolean

      A cell can be contentful even if it has no value but contains styling or other characteristics like row/col spans or borders.

    • Returns true if the cell is read-only.

      Returns boolean

      A cell can be read-only due to protection or other reasons.

    • Returns true if the cell is empty, meaning it has no value and its style is set to 'Normal'.

      Returns boolean

    • Compares the current cell to another instance to determine if they are logically equal.

      Parameters

      • other: ICell

        The cell to compare to.

      Returns boolean

      • To be equal the cells must have the same values and be at the same address.
      • Useful when ICells are dynamically generated because '===' comparison is not valid.
    • Returns true if the formula is hidden.

      Returns boolean

    • Returns true if the cell is a spill and not the top left.

      Returns boolean

    • Returns true if the cell is the top-left cell of a merged region, or if it is not part of a merged region.

      Returns boolean

    • Selects the current cell.

      Parameters

      Returns Promise<boolean>

      An async boolean indicating the cell was selected.

    • Returns the cell's value as a JavaScript Date object if the cell contains a date.

      Returns Date

      Only returns a date if the number formatting is a date format and the cell's value can be interpreted as a valid JavaScript Date. Otherwise, returns null.

    • Returns the cell's value as a formatted string, applying any number formatting.

      Returns string

    • Returns the cell's value as an unformatted string.

      Parameters

      • OptionaluseFormula: boolean

        If true this will return a text frame for formula (if there is one else).

      Returns string

      Minimum formatting is still applied to certain values, such as dates, times, and percentages.