Interface IStylesPersistScope

A transient scope for persisting styles with a given set of StyleIDs. This is required because many styles may be inactive (for example the undo stack or a collaboration session)

interface IStylesPersistScope {
    endPersist(): void;
    fromJSON(json): void;
    getSharedStyle(id, ref): ICellStyle;
    toJSON(): SheetStyleJSON;
    toResourceId(style): number;
}

Methods

  • End the persist scope. This will clear the stack and stop tracking access to this.

    Returns void

  • Load a JSON for a SheetStyle object.

    Parameters

    Returns void

    Remarks

    Once this is called the getSharedStyle is available for all the ids defined in the JSON for the current scope.

  • Given the id return the style. This assumes that the fromJSON has been called previously.

    Parameters

    • id: number
    • ref: any

    Returns ICellStyle

  • This can be called multiple times.

    Returns SheetStyleJSON

    Remarks

    Only shared styles that have had the toResourceId called will be shown in the persisted json.

  • A 0-based style id for the given style. If this is a named style or a style that is not available with the styles then this will return null.

    Parameters

    Returns number

    Remarks

    This is a side effect operation. Calling this will cause the style to be persisted as part of the toJSON