Interface INamedCellStyle

interface INamedCellStyle {
    alignment: ICellAlignment;
    border: ICellBorder;
    builtInID: number;
    fill: INoneFill | ISolidFill | IGradientFill | IPatternFill;
    font: IFont;
    hidden: boolean;
    iLevel: number;
    isCellStyle: true;
    isNamedCellStyle: true;
    name: string;
    namedStyle: string;
    namedStyleRef: INamedCellStyle;
    numberFormat: string;
    protection: ICellProtection;
    quotePrefix: boolean;
    bestFitSize(): Partial<Size>;
    hasEmptyStyling(): boolean;
    insets(): Rectangle;
    isNamed(): boolean;
    measureText(text, size?, family?): ExtendedTextMetrics;
    toJSON(): Partial<{
        alignment: string | CellAlignmentValues | 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;
        }>;
        border: string | CellBorderValues | Partial<{
            bottom: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            diagonalDown: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            diagonalUp: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            horizontal: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            left: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            right: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            top: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            vertical: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
        }>;
        fill: string | AdjustedColor | SolidFillValues | GradientFillValues | PatternFillValues | NoneFillValues | Partial<{
            val: string;
            adjustments: any;
            asCSS: any;
            isEqual: any;
            isImmutable: any;
            toHSLA: any;
            toHex: any;
            toJSON: any;
            toRGBA: any;
            toString: any;
        } | {
            color: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            fillType: string;
        } | {
            angle: string | number;
            fillTo: string | Rectangle | Partial<{
                bottom: string | number;
                left: string | number;
                right: string | number;
                top: string | number;
            }>;
            fillType: string;
            gradientType: string;
            stops: string | GradientStop[] | (string | GradientStop | Partial<{
                color: ...;
                offset?: ...;
            }>)[];
        } | {
            background: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            fillType: string;
            foreground: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            patternType: string;
        } | {
            fillType: string;
        }>;
        font: string | FontValues | Partial<{
            extend: string | Partial<boolean>;
            family: string;
            familyFallbacks: string | string[];
            fill: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            letterSpacing: string | number;
            outline: string | Partial<boolean>;
            scheme: string;
            shadow: string | Partial<boolean>;
            size: string | number;
            strike: string | Partial<boolean>;
            style: string;
            underline: string | boolean;
            verticalAlign: string;
            weight: string | number;
        }>;
        hidden: string | Partial<boolean>;
        iLevel: string | number;
        namedStyle: string;
        numberFormat: string;
        protection: string | CellProtectionValues | Partial<{
            formulaHidden: string | Partial<boolean>;
            locked: string | Partial<boolean>;
        }>;
        quotePrefix: string | Partial<boolean>;
    }>;
}

Hierarchy (view full)

Properties

alignment: ICellAlignment
border: ICellBorder
builtInID: number
font: IFont
hidden: boolean

If 'true' do not show this style in the application UI.

iLevel: number

Indicates that this formatting is for an outline style . When styles are applied to outline levels (using the outline feature), this value is set and the formatting specified on this cell style is applied to the corresponding level of the outline.

isCellStyle: true
isNamedCellStyle: true
name: string
namedStyle: string

The name of the namedStyle that is being referenced. For named styles this is null or ignored. If this is not specified then all unspecified fields will inherit from the normal style

namedStyleRef: INamedCellStyle

Returns an instance of the named style that this is derived from.

Remarks

If this style is a named styled then this will return self.

numberFormat: string

Format used for

protection: ICellProtection
quotePrefix: boolean

A boolean value indicating whether the text string in a cell should be prefixed by a single quote mark (e.g., 'text). In these cases, the quote is not stored in the Shared Strings Part.

Methods

  • This is used to determine if the style has rendering artifacts even if there is no content. (For example borders or background)

    Returns boolean

  • Returns insets used for content. This does not taking into account indent because this is alignment and type specific.

    Returns Rectangle

  • Returns if the current styled is a named style. This is useful when trying to determine if the style contains any customizations

    Returns boolean

  • Measure the text using the styling properties

    Parameters

    • text: string
    • Optional size: number

      optional size

    • Optional family: string

      optional family

    Returns ExtendedTextMetrics

    Default Value

    'to the cell font.size'
    

    Default Value

    'to the cell font.family'
    
  • Returns Partial<{
        alignment: string | CellAlignmentValues | 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;
        }>;
        border: string | CellBorderValues | Partial<{
            bottom: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            diagonalDown: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            diagonalUp: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            horizontal: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            left: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            right: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            top: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
            vertical: string | BorderStroke | Partial<{
                color: string | AdjustedColor | Partial<{
                    val: ...;
                    adjustments: any;
                    asCSS: any;
                    isEqual: any;
                    isImmutable: any;
                    toHSLA: any;
                    toHex: any;
                    toJSON: any;
                    toRGBA: any;
                    toString: any;
                }>;
                style: string;
            }>;
        }>;
        fill: string | AdjustedColor | SolidFillValues | GradientFillValues | PatternFillValues | NoneFillValues | Partial<{
            val: string;
            adjustments: any;
            asCSS: any;
            isEqual: any;
            isImmutable: any;
            toHSLA: any;
            toHex: any;
            toJSON: any;
            toRGBA: any;
            toString: any;
        } | {
            color: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            fillType: string;
        } | {
            angle: string | number;
            fillTo: string | Rectangle | Partial<{
                bottom: string | number;
                left: string | number;
                right: string | number;
                top: string | number;
            }>;
            fillType: string;
            gradientType: string;
            stops: string | GradientStop[] | (string | GradientStop | Partial<{
                color: ...;
                offset?: ...;
            }>)[];
        } | {
            background: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            fillType: string;
            foreground: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            patternType: string;
        } | {
            fillType: string;
        }>;
        font: string | FontValues | Partial<{
            extend: string | Partial<boolean>;
            family: string;
            familyFallbacks: string | string[];
            fill: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            letterSpacing: string | number;
            outline: string | Partial<boolean>;
            scheme: string;
            shadow: string | Partial<boolean>;
            size: string | number;
            strike: string | Partial<boolean>;
            style: string;
            underline: string | boolean;
            verticalAlign: string;
            weight: string | number;
        }>;
        hidden: string | Partial<boolean>;
        iLevel: string | number;
        namedStyle: string;
        numberFormat: string;
        protection: string | CellProtectionValues | Partial<{
            formulaHidden: string | Partial<boolean>;
            locked: string | Partial<boolean>;
        }>;
        quotePrefix: string | Partial<boolean>;
    }>