import { BaseGridPlugin, ScrollEvent } from '../../core/plugin/base-plugin';
import { ServerSideConfig, ServerSideDataSource } from './types';
/**
 * Server-Side Data Plugin for tbw-grid
 *
 * Enables lazy loading of data from a remote server with caching and block-based fetching.
 * Ideal for large datasets where loading all data upfront is impractical.
 *
 * ## Installation
 *
 * ```ts
 * import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `pageSize` | `number` | `100` | Rows per block |
 * | `cacheBlockSize` | `number` | `pageSize` | Cache block size |
 * | `maxConcurrentRequests` | `number` | `2` | Max parallel data requests |
 *
 * ## DataSource Interface
 *
 * ```ts
 * interface ServerSideDataSource {
 *   getRows(params: GetRowsParams): Promise<GetRowsResult>;
 * }
 * ```
 *
 * ## Programmatic API
 *
 * | Method | Signature | Description |
 * |--------|-----------|-------------|
 * | `setDataSource` | `(ds: ServerSideDataSource) => void` | Set the data source |
 * | `refresh` | `() => void` | Refresh current data |
 * | `clearCache` | `() => void` | Clear all cached blocks |
 *
 * @example Basic Server-Side Loading
 * ```ts
 * import '@toolbox-web/grid';
 * import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';
 *
 * const dataSource = {
 *   async getRows(params) {
 *     const response = await fetch(
 *       `/api/data?start=${params.startRow}&end=${params.endRow}`
 *     );
 *     const data = await response.json();
 *     return { rows: data.rows, totalRowCount: data.total };
 *   },
 * };
 *
 * const plugin = new ServerSidePlugin({ pageSize: 50 });
 * grid.gridConfig = {
 *   columns: [...],
 *   plugins: [plugin],
 * };
 *
 * grid.ready().then(() => plugin.setDataSource(dataSource));
 * ```
 *
 * @see {@link ServerSideConfig} for configuration options
 * @see {@link ServerSideDataSource} for data source interface
 *
 * @internal Extends BaseGridPlugin
 */
export declare class ServerSidePlugin extends BaseGridPlugin<ServerSideConfig> {
    /** @internal */
    readonly name = "serverSide";
    /** @internal */
    protected get defaultConfig(): Partial<ServerSideConfig>;
    private dataSource;
    private totalRowCount;
    private loadedBlocks;
    private loadingBlocks;
    private lastRequestId;
    private scrollDebounceTimer?;
    /** @internal */
    detach(): void;
    /**
     * Check current viewport and load any missing blocks.
     */
    private loadRequiredBlocks;
    /** @internal */
    processRows(rows: readonly unknown[]): unknown[];
    /** @internal */
    onScroll(event: ScrollEvent): void;
    /**
     * Set the data source for server-side loading.
     * @param dataSource - Data source implementing the getRows method
     */
    setDataSource(dataSource: ServerSideDataSource): void;
    /**
     * Refresh all data from the server.
     */
    refresh(): void;
    /**
     * Clear all cached data without refreshing.
     */
    purgeCache(): void;
    /**
     * Get the total row count from the server.
     */
    getTotalRowCount(): number;
    /**
     * Check if a specific row is loaded in the cache.
     * @param rowIndex - Row index to check
     */
    isRowLoaded(rowIndex: number): boolean;
    /**
     * Get the number of loaded cache blocks.
     */
    getLoadedBlockCount(): number;
}
//# sourceMappingURL=ServerSidePlugin.d.ts.map