import { type Observable } from 'rxjs';
import { type PrimativeKey, type Maybe, type ReadRequiredKeyFunction } from '@dereekb/util';
import { type DbxTableColumn } from './table';
import { type DbxTableStore } from './table.store';
export interface DbxTableReaderCellPair<C, T> {
    readonly column: DbxTableColumn<C>;
    readonly item: T;
}
export interface DbxTableReaderCellDataPair<C, T, O> extends DbxTableReaderCellPair<C, T> {
    readonly value: O;
}
/**
 * Key used for tracking columns.
 *
 * Generally the table name is used for this.
 */
export type DbxTableReaderColumnKey = string;
/**
 * Key used for tracking items.
 *
 * Generally the item's unique identifier is used for this.
 */
export type DbxTableReaderItemKey = PrimativeKey;
/**
 * Default track by function for DbxTableColumn.
 *
 * Returns the column name.
 *
 * @param column
 * @returns
 */
export declare const DEFAULT_DBX_TABLE_READER_COLUMN_TRACK_BY: ReadRequiredKeyFunction<DbxTableColumn<DbxTableReaderColumnKey>>;
/**
 * Function used for tracking unique columns using the column's data.
 *
 * If the column key value is the same between those two columns, then the metadata of both columns will be considered the same/equal.
 */
export type DbxTableReaderColumnTrackByFunction<C> = ReadRequiredKeyFunction<DbxTableColumn<C>, DbxTableReaderColumnKey>;
/**
 * Function used for tracking unique columns using the column's data.
 *
 * If the column key value is the same between those two columns, then the metadata of both columns will be considered the same/equal.
 */
export type DbxTableReaderItemTrackByFunction<T> = ReadRequiredKeyFunction<T, DbxTableReaderItemKey>;
export interface DbxTableReaderDelegate<C, T, O> {
    /**
     * Retrieves the data for a specific column and item/row.
     *
     * @param column
     * @param item
     */
    readItemCellDataForColumn(column: DbxTableColumn<C>, item: T): Observable<O>;
    /**
     * Used for tracking unique columns.
     *
     * Use if the metadata between columns should be used for unique identification.
     *
     * Defaults to using the column name as the key if not defined.
     */
    trackColumn?: DbxTableReaderColumnTrackByFunction<C>;
    /**
     * Used for tracking unique items/rows.
     *
     * Use if the metadata between items should be used for unique identification.
     *
     * Defaults to using the item itself as the key if not defined.
     */
    trackItem: DbxTableReaderItemTrackByFunction<T>;
}
export interface DbxTableReaderConfig<C, T, O, G = any> {
    /**
     * Delegate used for retrieving the data for a specific column and item/row.
     */
    readonly delegate: DbxTableReaderDelegate<C, T, O>;
    /**
     * The table store used for retrieving the items.
     */
    readonly tableStore: DbxTableStore<any, C, T, G>;
}
export interface DbxTableReader<C, T, O, G = any> extends DbxTableReaderConfig<C, T, O, G> {
    /**
     * Retrieves all cell data pairs for a specific column.
     */
    cellDataPairsForColumn(column: DbxTableColumn<C>): Observable<DbxTableReaderCellDataPair<C, T, O>[]>;
    /**
     * Retrieves all cell data for a specific column.
     */
    cellDataForColumn(column: DbxTableColumn<C>): Observable<O[]>;
    /**
     * Retrieves the cell data pair for a specific column and item.
     *
     * Returns null if the column is not visible or the item is not found.
     */
    cellDataPairForColumnAndItem(column: DbxTableColumn<C>, item: T): Observable<Maybe<DbxTableReaderCellDataPair<C, T, O>>>;
    /**
     * Retrieves the cell data for a specific column and item.
     *
     * Returns null if the column is not visible or the item is not found.
     */
    cellDataForColumnAndItem(column: DbxTableColumn<C>, item: T): Observable<Maybe<O>>;
}
export declare function dbxTableReader<C, T, O, G = any>(config: DbxTableReaderConfig<C, T, O, G>): DbxTableReader<C, T, O, G>;
