SheetXL - v0.3.20
    Preparing search index...

    Interface ISheet

    An ISheet represents a collection of elements (such as ranges, tables, etc) contained within and visualized through a view.

    This interface provides methods for accessing its elements and event handling.

    Most interactions with a sheet are done using either a range or ranges.

    While a sheet can be used stand-alone it is typically used within the context of a workbook.

    interface ISheet {
        isISheet: true;
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        beginCommit(options?: string | OperationOptions): ITransaction;
        close(): void;
        createTemporaryCell(
            update: ICell.Update,
            coords?: IRange.FixableCellCoords,
        ): ICell;
        delete(): void;
        doBatch<R = any>(
            callback: (commit: ICommit) => R | Promise<R>,
            options?: string | OperationOptions,
        ): R | Promise<R>;
        duplicate(): Promise<ISheet>;
        find(text: string, options?: FindOptions): Iterator<ICell>;
        getCalculation(): ICalculation;
        getColumnHeaders(): ISheetHeader;
        getColumnWidthAsFontUnit(pixelWidth: number): number;
        getEntireRange(options?: GetRangeOptions): ICellRange;
        getFilter(): IAutoFilter;
        getMovables(): IMovableCollection;
        getName(): string;
        getNames(): INamedCollection;
        getProtection(): ISheetProtection;
        getRange(
            address: ICellRange.Address,
            options?: GetRangeOptions,
        ): ICellRange;
        getRangeAtBounds(bounds: Bounds, options?: GetRangeOptions): ICellRange;
        getRanges(
            address: ICellRanges.Address,
            options?: GetRangeOptions,
        ): ICellRanges;
        getResources(): IResourceCollection;
        getRowHeaders(): ISheetHeader;
        getSelectedCell(): ICell;
        getSelectedRange(options?: GetRangeOptions): ICellRange;
        getSelectedRanges(options?: GetRangeOptions): ICellRanges;
        getSelection(): IRangeSelection;
        getSort(): IAutoSort;
        getStrings(): IStringCollection;
        getStyles(): IStyleCollection;
        getTabColor(): IColor;
        getTables(): ITableCollection;
        getTransactions(): IStore;
        getUsedRange(options?: GetRangeOptions): ICellRange;
        getUUID(): string;
        getView(): ISheetView;
        getVisibility(): Visibility;
        insertFilter(address?: ICellRange.Address): IAutoFilter;
        insertSort(address?: ICellRange.Address): IAutoSort;
        isClosed(): boolean;
        isDate1904(): boolean;
        scrollTo(
            coords: Partial<IRange.Coords>,
            options: ScrollToOptions,
        ): Promise<boolean>;
        select(options?: ITypes.SelectOptions): Promise<ISheet>;
        setName(name: string): ISheet;
        setPosition(index: number): ISheet;
        setTabColor(color: string | IColor): this;
        setView(view: ISheetView): this;
        setVisibility(visibility?: boolean | Visibility): ISheet;
        toJSON(excludeData?: boolean): Promise<ISheet.JSON>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    isISheet: true

    For runtime type checking.

    Methods

    • Add Listeners.

      Parameters

      Returns Remove

      IListener.ISource.addListeners

    • Batches all 'transactional' changes until they have all be committed or rolled back.

      Parameters

      • Optionaloptions: string | OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns ITransaction

      Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.

      Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.

    • Free all resources associated with the sheet.

      Returns void

      • Called by workbooks when the workbook is is closed.
      • This is different than delete which removes the sheet from the workbook.

      ISheet.addListeners for closeEvent

    • Creates a cell that is not including at a coordinate but adopts all rendering.

      Useful for previewing values such as tooltip. If the coords are passed it will return a disconnect cell update for that value.

      Parameters

      Returns ICell

      A detached ICell

      Does not add to the sheet but provides a standalone ICell.

    • Removes from a container. This is usually the Workbook. If this is being used standalone this operation will throw an exception.

      Returns void

    • Provides a mechanism to perform a set of operations in a batch.

      Type Parameters

      • R = any

      Parameters

      • callback: (commit: ICommit) => R | Promise<R>

        A callback that performs multiple operations all within the same transaction.

      • Optionaloptions: string | OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns R | Promise<R>

    • Returns a promise that will resolve to a copy of the current sheet.

      Returns Promise<ISheet>

    • Returns an iterator of ICells that match the results.

      Parameters

      • text: string

        The text to search for.

      • Optionaloptions: FindOptions

      Returns Iterator<ICell>

      This is the equivalent of getEntireRange().find.

    • Returns the display name for the sheet.

      Returns string

    • Returns the selected cell.

      Returns ICell

    • Returns the current selection.

      Returns IRangeSelection

      This allows for listening to selection changes and advanced navigation.

    • Return a custom color or null if no custom color has been set.

      Returns IColor

      null
      
    • Returns the current shared resources.

      Returns IStore

    • A unique identifier for the record. This will never change.

      Returns string

      This enables the record to be identified across transactions and users in a collaborative environment.

    • Returns the current view settings View settings determine how the sheet is displayed and interacted with (e.g., frozen panes, zoom level, selection) but do not affect the underlying data itself.

      Returns ISheetView

      The ISheetView object representing the current view settings.

    • Returns true if the sheet has been closed.

      Returns boolean

    • Indicates if the sheet is using 1904 dates.

      Returns boolean

      This can not be set on the ISheet. This is managed by the sheet's container.

    • Set the display name for the sheet.

      Parameters

      • name: string

      Returns ISheet

    • Reorders the ISheet with in the container. This is generally the tab order within an IWorkbook but may be the zIndex if the ISheets are movable. This only affects visual listings of the sheets (but selection doesn't change).

      Parameters

      • index: number

      Returns ISheet

      This is zero-based.

    • See the tab color for the sheet.

      Parameters

      • color: string | IColor

        The color

      Returns this

      • If set to null the color will revert to the default.
      • The tab color is not used by the sheet but rather by the workbook.
    • Set a specific view.

      Parameters

      Returns this

    • Change the visibility of the sheet.

      Parameters

      Returns ISheet

      ISheet.Visibility.Visible
      
    • Returns a JSON representation of the sheet.

      Parameters

      • OptionalexcludeData: boolean

        If true only meta data about the sheet will be saved.

      Returns Promise<ISheet.JSON>