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

    Interface IDatasource<T>

    Core datasource contract for data-driven views (table, repeater, etc.).

    Implementations provide the total item count and on-demand access to individual rows by index, optionally returning a Promise for rows that are fetched asynchronously.

    interface IDatasource<T = unknown> {
        getNumberOfItems(): number | Promise<number>;
        getObjectAtRowIndex(rowIndex: number): RowResult<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.