import { CdkTable } from '@angular/cdk/table';
import { ChangeDetectorRef, InjectionToken, OnDestroy, OnInit } from '@angular/core';
import type { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { PaginatorLike } from '@rxap/data-source/pagination';
import { AbstractTableDataSource, FilterLike, SortLike, TableEvent } from '@rxap/data-source/table';
import { Method } from '@rxap/pattern';
import { ToggleSubject } from '@rxap/rxjs';
import { Observable, Subject, Subscription } from 'rxjs';
import { TableFilterService } from './table-filter/table-filter.service';
import * as i0 from "@angular/core";
export { RXAP_TABLE_METHOD } from '@rxap/data-source/table';
/**
 * @deprecated use TABLE_METHOD instead
 */
export declare const TABLE_REMOTE_METHOD: InjectionToken<unknown>;
export declare const TABLE_REMOTE_METHOD_ADAPTER_FACTORY: InjectionToken<unknown>;
export declare const RXAP_TABLE_FILTER: InjectionToken<unknown>;
export declare const TABLE_DATA_SOURCE: InjectionToken<unknown>;
export type TableRemoteMethodAdapterFactory<Data extends Record<string, any> = Record<string, any>> = (method: Method, paginator?: PaginatorLike, sort?: SortLike | null, filter?: FilterLike | null, parameters?: Observable<Record<string, any>>) => Method<Data[], TableEvent>;
export declare class TableDataSourceDirective<Data extends Record<string, any> = any> implements OnInit, OnDestroy {
    private readonly matTable;
    protected readonly cdr: ChangeDetectorRef;
    private readonly sourceMethod;
    private readonly sourceDataSource;
    private readonly matSort;
    private readonly tableFilter;
    private readonly _tableFilter;
    /**
     * @deprecated use dataSource instead
     */
    set setDataSource(dataSource: AbstractTableDataSource<Data> | '');
    paginator?: MatPaginator;
    readonly loading$: ToggleSubject;
    id: string;
    parameters?: Observable<Record<string, any>>;
    dataSource?: AbstractTableDataSource<Data>;
    method?: Method<Data[], TableEvent>;
    readonly hasError$: ToggleSubject;
    readonly error$: Subject<unknown>;
    get lastRefreshed(): Date | null;
    /**
     * @deprecated use method instead
     */
    get remoteMethod(): Method<Data[], TableEvent> | undefined;
    /**
     * @deprecated use sourceMethod instead
     */
    get sourceRemoteMethod(): Method<Data[] | any, TableEvent | any> | null;
    protected _subscription: Subscription;
    private readonly adapterFactory;
    constructor(matTable: CdkTable<Data>, cdr: ChangeDetectorRef, sourceMethod: Method<Data[] | any, TableEvent | any> | null, sourceDataSource: AbstractTableDataSource<Data> | null, adapterFactory: any, matSort: MatSort | null, tableFilter: TableFilterService | null, _tableFilter: FilterLike | null);
    private trackBy;
    ngOnInit(): void;
    ngOnDestroy(): void;
    refresh(): void;
    retry(): void;
    reset(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<TableDataSourceDirective<any>, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<TableDataSourceDirective<any>, "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", ["rxapTableDataSource"], { "setDataSource": { "alias": "rxapTableDataSource"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; "id": { "alias": "id"; "required": true; }; "parameters": { "alias": "parameters"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
}
