SheetXL - v0.3.20
    Preparing search index...

    Class StyleCollection

    Base implementation of IStyleCollection

    TODO - defaultFontSize move to theme?

    Implements

    Index

    Constructors

    • Parameters

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

      Returns StyleCollection

    Methods

    • 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 The named style from either a custom style or a builtIn.

      Parameters

      • name: string

      Returns IStyle.INamed

      Will try to return:

      1. The custom style for the name
      2. The builtin style for the name.
      3. nul if it doesn't exist.
    • Returns The table style. This can be either a custom or a built in table style.

      Parameters

      • name: string

      Returns ITableStyle

      Will try to return:

      1. The custom style for the name
      2. The builtIn style for the name.
      3. null if it doesn't exist.
    • This will add or update a table style.

      Parameters

      • name: string

        A string of the name of the table.

      • properties: ITableStyle.ResolvableProperties

        The values to set for the table style.

      Returns ITableStyle

      A new ITableStyle representing the updated style.

      Case insensitive; for duplicate detection purposes.

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

      Parameters

      • fontSize: number

        The new default font size.

      Returns void

    • Set the default table style to use if a table is created without specifying a style.

      Parameters

      • styleName: string

        A string of the name of the table

      Returns boolean

      The style must exist or the defaultStyle will be set to 'TableStyleMedium2'.

    • This will add or update a cell style.

      Parameters

      • modifiers: NamedUpdate

        The Style or Style Modifiers

      • mergeIfExists: boolean = false

        If true then the style will be merged with the existing style otherwise is a replace.

      Returns IStyle.INamed

      The new style after any merges.

      Names are case insensitive; for duplicate detection purposes.

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

      Parameters

      • name: string
      • checkDuplicates: boolean = false

      Returns void