Interface ISizeCellStyleValues

interface ISizeCellStyleValues {
    alignment: ICellAlignment;
    border: ICellBorder;
    fill: INoneFill | ISolidFill | IGradientFill | IPatternFill;
    font: IFont;
    isCellStyle: true;
    namedStyle: string;
    namedStyleRef: INamedCellStyle;
    numberFormat: string;
    protection: ICellProtection;
    quotePrefix: boolean;
    size?: number;
    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;
        }>;
        namedStyle: string;
        numberFormat: string;
        protection: string | CellProtectionValues | Partial<{
            formulaHidden: string | Partial<boolean>;
            locked: string | Partial<boolean>;
        }>;
        quotePrefix: string | Partial<boolean>;
    }>;
}

Hierarchy

Properties

alignment: ICellAlignment
border: ICellBorder
font: IFont
isCellStyle: true
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.

size?: number

Methods

  • Returns the best fit size assuming no content.

    Returns Partial<Size>

  • 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;
        }>;
        namedStyle: string;
        numberFormat: string;
        protection: string | CellProtectionValues | Partial<{
            formulaHidden: string | Partial<boolean>;
            locked: string | Partial<boolean>;
        }>;
        quotePrefix: string | Partial<boolean>;
    }>