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

    Interface IStyleCollection

    The workbook's styling: its named cell styles and table styles (each a collection of its own), the theme and default font size the styles resolve against, color resolution, and the style algebra (normalize / resolve) with persistence.

    interface IStyleCollection {
        isIStyleCollection: true;
        addListeners(
            listeners: IStyleCollection.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 | null;
        getNamedStyles(): INamedStyleCollection;
        getNormal(): IStyle;
        getNormalRanged(): ICellRanged<IStyle.Properties<Serializable>>;
        getTableStyle(name?: string): ITableStyle | null;
        getTableStyles(): ITableStyleCollection;
        getTheme(): ITheme;
        indexedLookup(): IndexedLookup;
        normalize(
            modifiers: IStyle.Modifiers,
            name?: string,
        ): Partial<IStyle.Modifiers>;
        parseColor(str: any): IColor;
        recentColors(): readonly IColor[];
        resolve(
            modifiers: IStyle.Modifiers,
            name?: string,
        ): Partial<IStyle.Properties>;
        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
    isIStyleCollection: true

    For runtime type checking.

    • 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 the document's own named styles, customized built-ins included.

      Returns IStyle.INamed[]

      Use getNamedStyles().getItems({ type: 'custom' }); removed in the next release.

    • Returns the document's own table styles, customized built-ins included.

      Returns ITableStyle[]

      Use getTableStyles().getItems({ type: 'custom' }); removed in the next release.

    • 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 style a table is given when it is created without one.

      Returns ITableStyle

      Use getTableStyles().getDefault(); removed in the next release.

    • 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 with the given name, or null if there is none.

      Parameters

      • name: string

      Returns IStyle.INamed | null

      Use getNamedStyles().getByName(name); removed in the next release.

    • Return a the Normal styles as an IStyle.;

      Returns IStyle

    • 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

      Use getTableStyles().getByName(name) (or .getNone()); removed in the next release.

    • Returns the current theme

      Returns ITheme

    • 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

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

    • 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

    • 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

      • name: string

      Returns void

      Use getTableStyles().setDefault(name); removed in the next release.

    • 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