import { InjectionToken, OnInit } from '@angular/core';
import { BaseDataSourceViewer, DataSourceViewerId } from '@rxap/data-source';
import { PageEvent, PaginatorLike } from '@rxap/data-source/pagination';
import { MethodWithParameters } from '@rxap/pattern';
import { BehaviorSubject, Observable, TeardownLogic } from 'rxjs';
import { AbstractTableDataSource, FilterLike, Sort, SortLike } from './abstract-table.data-source';
import { TableDataSourceMetadata } from './table.data-source';
import * as i0 from "@angular/core";
/**
 * @deprecated removed use RXAP_TABLE_METHOD instead
 */
export declare const RXAP_TABLE_REMOTE_METHOD: InjectionToken<unknown>;
export interface TableEvent<Parameters = any> {
    start: number;
    end: number;
    page?: PageEvent | null;
    sort?: Sort | null;
    filter?: Record<string, any> | null | string;
    /** The custom table parameter */
    parameters?: Parameters;
    /** time of the last refresh call */
    refresh?: number;
    setTotalLength?: (length: number) => void;
}
export interface DynamicTableDataSourceViewer<Parameters> extends BaseDataSourceViewer<Parameters> {
    parameters: Parameters;
}
export declare class DynamicTableDataSource<Data extends Record<any, any> = any, Parameters = any> extends AbstractTableDataSource<Data, Parameters> implements OnInit {
    protected readonly method: MethodWithParameters<Data[], TableEvent<Parameters>>;
    paginatorMap: Map<string, PaginatorLike>;
    sortMap: Map<string, SortLike>;
    filterMap: Map<string, FilterLike>;
    parametersMap: Map<string, Observable<Parameters>>;
    protected _refresh$: BehaviorSubject<number>;
    constructor(method: MethodWithParameters<Data[], TableEvent<Parameters>>, paginator?: PaginatorLike | null, sort?: SortLike | null, filter?: FilterLike | null, parameters?: Observable<Parameters> | null, metadata?: TableDataSourceMetadata | null);
    /**
     * @deprecated use method instead
     * @private
     */
    private get remoteMethod();
    ngOnInit(): void;
    setTotalLengthFactory(id?: string): (length: number) => void;
    setTotalLength(length: number, id?: string): void;
    refresh(): any;
    setPaginator(paginator: PaginatorLike | undefined, id?: string): void;
    setSort(sort: SortLike | null, id?: string): void;
    setFilter(tableFilter: FilterLike | undefined, id?: string): void;
    setParameters(parameters: Observable<Parameters> | undefined, id?: string): void;
    protected genericRetryFunction(error: any, retryCount: number): Observable<any>;
    protected _connect(viewer: BaseDataSourceViewer): [Observable<Data[]>, TeardownLogic] | Observable<Data[]>;
    protected _disconnect(viewerId: DataSourceViewerId): void;
    protected loadPage(tableEvent: TableEvent): Promise<Data[]>;
    protected handelError(error: any): void;
    protected hasDynamicInputs(id: string): boolean;
    private createTableDataLoader;
    static ɵfac: i0.ɵɵFactoryDeclaration<DynamicTableDataSource<any, any>, [{ optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<DynamicTableDataSource<any, any>>;
}
