@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Interface IRemovableDatasource<T>

    A datasource that supports removing items by index.

    Implement this interface when the datasource can give up items (e.g. as the source of a cross-list drag-and-drop transfer). UI components use the isRemovableDatasource type guard to detect this capability.

    interface IRemovableDatasource<T = unknown> {
        getNumberOfItems(): number | Promise<number>;
        getObjectAtRowIndex(rowIndex: number): RowResult<T>;
        removeItem(index: number): T;
    }

    Type Parameters

    • T = unknown

      The row object type.

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Returns the total number of items, synchronously or asynchronously.

      Returns number | Promise<number>

    • Returns the row object at the given index.

      Parameters

      • rowIndex: number

        Zero-based index of the row to retrieve.

      Returns RowResult<T>

      The row value, or a Promise that resolves to it.

    • Removes and returns the item at index, shifting subsequent items to the left.

      After this call, getNumberOfItems() must return one fewer than before.

      Parameters

      • index: number

        The zero-based position of the item to remove.

      Returns T

      The removed item.