SheetXL - v0.3.20
    Preparing search index...

    Interface Updater

    Provides an API for updating styles.

    interface Updater {
        getAlignment(): ITextBoxAlignment;
        getBorder(): IBorder;
        getFill(): IFill;
        getFont(): IStyledFont;
        setAlignment(
            alignment:
                | string
                | ITextBoxAlignment
                | Partial<
                    {
                        horizontal?: string;
                        indent?: string
                        | number;
                        justifyLastLine?: string | Partial<boolean>;
                        overflow?: string;
                        readingDirection?: string;
                        relativeIndent?: string | number;
                        rotation?: string | number;
                        stacked?: string | Partial<boolean>;
                        vertical?: string;
                    },
                >,
            options?: UpdateOptions,
        ): ITextBoxAlignment;
        setBorder(
            border:
                | string
                | IBorder
                | Partial<
                    {
                        bottom?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        diagonalDown?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        diagonalUp?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        horizontal?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        left?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        right?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        top?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                        vertical?: | string
                        | StrokeProperties<Serializable>
                        | Partial<
                            {
                                color?: | string
                                | IColor
                                | Partial<
                                    {
                                        adjust: string
                                        | ((adjustments: ...) => ...)
                                        | Partial<(...)>;
                                        getAdjustments: string | (() => ...) | Partial<(...)>;
                                        getType: string | (() => ...) | Partial<(...)>;
                                        getVal: string | (() => ...) | Partial<(...)>;
                                        isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                        isIColor: string | true;
                                        toBlackOrWhite:
                                            | string
                                            | ((darkMode?: ..., threshold?: ...) => ...)
                                            | Partial<(...)>;
                                        toCSS:
                                            | string
                                            | ((darkMode?: ..., alpha?: ...) => ...)
                                            | Partial<(...)>;
                                        toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                        toString: string | (() => ...) | Partial<(...)>;
                                    },
                                >;
                                style?: string;
                            },
                        >;
                    },
                >,
            options?: UpdateOptions,
        ): IBorder;
        setFill(
            fill: string | IFill | Partial<{ type: string }>,
            options?: UpdateOptions,
        ): IFill;
        setFont(
            font: string | IFill | Partial<{ type: string }>,
            options?: UpdateOptions,
        ): IFill;
        setNumberFormat(numFmt: string, options?: UpdateOptions): this;
        setQuotePrefix(quotePrefix: boolean, options?: UpdateOptions): this;
        update(style: IStyle.Update, options?: UpdateOptions): this;
    }
    Index

    Methods

    • Retrieves the border updater.

      Returns IBorder

      An IBorder.Updater object.

    • Retrieves the fill updater.

      Returns IFill

      An IFIll.Updater object.

    • Sets the alignment style.

      This method allows updating alignments using an ITextFrame.IAlignment or a shorthand property object.

      Parameters

      • alignment:
            | string
            | ITextBoxAlignment
            | Partial<
                {
                    horizontal?: string;
                    indent?: string
                    | number;
                    justifyLastLine?: string | Partial<boolean>;
                    overflow?: string;
                    readingDirection?: string;
                    relativeIndent?: string | number;
                    rotation?: string | number;
                    stacked?: string | Partial<boolean>;
                    vertical?: string;
                },
            >

        The alignment object or a shorthand property object to apply. Pass null to clear.

      • Optionaloptions: UpdateOptions

        Optional configuration for the update.

      Returns ITextBoxAlignment

      The ITextFrame.IAlignment.Updater object for further modifications.

    • Sets the border style.

      This method allows updating borders using an IBorder or a shorthand property object.

      Parameters

      • border:
            | string
            | IBorder
            | Partial<
                {
                    bottom?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    diagonalDown?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    diagonalUp?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    horizontal?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    left?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    right?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    top?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                    vertical?: | string
                    | StrokeProperties<Serializable>
                    | Partial<
                        {
                            color?: | string
                            | IColor
                            | Partial<
                                {
                                    adjust: string
                                    | ((adjustments: ...) => ...)
                                    | Partial<(...)>;
                                    getAdjustments: string | (() => ...) | Partial<(...)>;
                                    getType: string | (() => ...) | Partial<(...)>;
                                    getVal: string | (() => ...) | Partial<(...)>;
                                    isEqual: string | ((other: ...) => ...) | Partial<(...)>;
                                    isIColor: string | true;
                                    toBlackOrWhite:
                                        | string
                                        | ((darkMode?: ..., threshold?: ...) => ...)
                                        | Partial<(...)>;
                                    toCSS:
                                        | string
                                        | ((darkMode?: ..., alpha?: ...) => ...)
                                        | Partial<(...)>;
                                    toHex: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toHSLA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toRGBA: string | ((darkMode?: ...) => ...) | Partial<(...)>;
                                    toString: string | (() => ...) | Partial<(...)>;
                                },
                            >;
                            style?: string;
                        },
                    >;
                },
            >

        The border object or a shorthand property object to apply. Pass null to clear.

      • Optionaloptions: UpdateOptions

        Optional configuration for the update.

      Returns IBorder

      The IBorder.Updater object for further modifications.

    • Sets the fill style.

      This method allows updating fill using an IFill or a shorthand property object.

      Parameters

      • fill: string | IFill | Partial<{ type: string }>

        The fill object or a shorthand property object to apply. Pass null to clear.

      • Optionaloptions: UpdateOptions

        Optional configuration for the update.

      Returns IFill

      The IFill.Updater object for further modifications.

    • Sets the font style.

      This method allows updating fill using an IStyledFont or a shorthand property object.

      Parameters

      • font: string | IFill | Partial<{ type: string }>

        The font object or a shorthand property object to apply. Pass null to clear.

      • Optionaloptions: UpdateOptions

        Optional configuration for the update.

      Returns IFill

      The IStyledFont.Updater object for further modifications.

    • Sets or removes the quote prefix for the range.

      The quote prefix ensures that values in cells are treated as text.

      Parameters

      Returns this

    • Updates multiple style properties at once.

      This method is the most versatile way to update styles, allowing bulk updates with nested properties, shorthand strings, or function callbacks.

      Parameters

      • style: IStyle.Update

        An object describing the style updates.

      • Optionaloptions: UpdateOptions

        Optional configuration for the update.

      Returns this

      The current Updater instance for chaining.

      updater.update({
      font: { bold: true, color: "blue" },
      fill: { pattern: "solid", color: "yellow" }
      });