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

    Class StyleCollection

    Base implementation of IStyleCollection

    TODO - defaultFontSize move to theme?

    Implements

    Index
    • Parameters

      • theme: ITheme | null = null
      • indexedColors: string[] | null = null
      • defaultFontSize: number = 11

      Returns StyleCollection

    • Add a color to the mru list. This is used to populate color pickers.

      Parameters

      • color: IColor

        The color to record.

      Returns readonly IColor[]

      Any color can be added but generally this should be limited to custom/non-themed color

    • Themes do not contain font sizes but it is possible to set a default font size at the document or application level.

      Returns number

    • Returns an array of colors that will be used to resolve any colors that use IndexXX or ColorXX as a key.

      Returns readonly IColor[]

    • Returns the table style with the given name, or null if there is none; with no name, the style of a table that has none.

      Parameters

      • Optionalname: string

      Returns ITableStyle | null

    • Converts a list of IStyle.Modifiers that contain shorthand values into native values.

      Parameters

      Returns Partial<IStyle.Properties>

      A valid IStyle.Modifiers with values that match the normal style removed.

      Will also remove any value that resolve to the same values as the referenced named style (or Normal if this is not specified).

    • Flattens a style against the named style it references, resolving shorthand values as it goes.

      Parameters

      Returns Partial<IStyle.Properties>

      A valid IStyle.Properties with the referenced style's values merged in.

      The inverse of IStyleCollection.normalize: where normalize reduces a style to what it authors over its named style, this restores what that authorship actually resolves to. Formats that store a style as a self-contained record rather than as a delta (OOXML xf) need this on the way out.

    • Set the default fontSize. Note - A theme does NOT contain this.

      Parameters

      • fontSize: number

        The new default font size.

      Returns void

    • Sets the style a table is given when it is created without one.

      Parameters

      • styleName: string

      Returns void

    • Checks the current name to see if this is a valid sheetName.

      Parameters

      • name: string
      • checkDuplicates: boolean = false

      Returns void