SheetXL - v0.3.20
    Preparing search index...

    Interface IStyleCollection

    Contains collections of Named and Table Styles.

    interface IStyleCollection {
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        addRecentColor(color: IColor): readonly IColor[];
        beginPersist(): IStyleCollection.IPersistScope;
        clearRecentColors(): void;
        getCustomIndexedColors(): readonly IColor[];
        getCustomNamed(): IStyle.INamed[];
        getCustomTableStyles(): ITableStyle[];
        getDefaultFontSize(): number;
        getDefaultTableStyle(): ITableStyle;
        getIndexedColors(): readonly IColor[];
        getNamed(name: string): IStyle.INamed;
        getNormal(): IStyle;
        getNormalRanged(): ICellRanged<IStyle.Properties<Serializable>>;
        getTableStyle(name?: string): ITableStyle;
        getTheme(): ITheme;
        indexedLookup(): IndexedLookup;
        normalize(modifiers: IStyle.Modifiers): Partial<IStyle.Modifiers>;
        parseColor(str: any): IColor;
        recentColors(): readonly IColor[];
        schemeLookup(): SchemeLookup;
        setCustomIndexedColors(colors: readonly IColor[]): void;
        setCustomTableStyle(
            name: string,
            properties: ITableStyle.ResolvableProperties,
        ): ITableStyle;
        setDefaultFontSize(fontSize: number): void;
        setDefaultTableStyle(name: string): void;
        setNamed(modifiers: NamedUpdate, mergeIfExists?: boolean): IStyle.INamed;
        setTheme(theme: ITheme): void;
        validateStyleName(name: string, checkDuplicates?: boolean): void;
    }

    Implemented by

    Index

    Methods

    • Add Listeners.

      Parameters

      Returns Remove

      IListener.ISource.addListeners

    • 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

    • Clears the mru color list

      Returns void

    • Returns the customized Indexed colors.

      Returns readonly IColor[]

    • Returns all customized named cell styles.

      Returns IStyle.INamed[]

      This includes new style names and builtin overrides.

    • Returns all customized table styles.

      Returns ITableStyle[]

      This includes new table styles and builtin overrides.

    • 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 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.
    • Return a the Normal styles as an IStyle.;

      Returns IStyle

    • Returns The table style. This can be either a custom or a built in table style.

      Parameters

      • Optionalname: 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.
    • Converts a list of IStyle.Modifiers that contain shorthand values into native values.

      Parameters

      Returns Partial<IStyle.Modifiers>

      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).

    • Parses the color using the Theme being used by this style

      Parameters

      • str: any

        Any string that represents a color IColor.

      Returns IColor

    • This is available for functions that want to resolve colors for the theme used specifically for this style.

      Returns SchemeLookup

    • Override the default indexed colors.

      Parameters

      • colors: readonly IColor[]

        An array of colors.

      Returns void

    • 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

      • name: string

        A string of the name of the table

      Returns void

      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

      • OptionalmergeIfExists: boolean

        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.

      false
      

      Names are case insensitive; for duplicate detection purposes.

    • Set the theme used to calculate styles.

      Parameters

      • theme: ITheme

        The ITheme to use.

      Returns void

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

      Parameters

      • name: string
      • OptionalcheckDuplicates: boolean

      Returns void