import { HttpProvider } from 'open-jsonrpc-provider';
import { IpLocation, ShardedNodes, TransactionOptions } from './types.js';
import { SelectMethod, ShardedNode } from '../common/index.js';
import { UploadOption, Uploader } from '../transfer/index.js';
import { StorageNode } from '../node/index.js';
import { RetryOpts } from '../types.js';
import { AbstractFile } from '../file/AbstractFile.js';
import { Signer } from 'ethers';
export declare class Indexer extends HttpProvider {
    constructor(url: string);
    getShardedNodes(): Promise<ShardedNodes>;
    getNodeLocations(): Promise<Map<string, IpLocation>>;
    getFileLocations(rootHash: string): Promise<ShardedNode[]>;
    /**
     * Select `expectedReplica` complete sharding sets from the indexer's
     * trusted nodes and return them as StorageNode clients.
     *
     * @param expectedReplica  Number of full replicas required.
     * @param method           Node ordering before selection (default 'min').
     */
    selectNodes(expectedReplica: number, method?: SelectMethod): Promise<[StorageNode[], Error | null]>;
    newUploaderFromIndexerNodes(blockchain_rpc: string, signer: Signer, expectedReplica: number, opts?: TransactionOptions): Promise<[Uploader | null, Error | null]>;
    upload(file: AbstractFile, blockchain_rpc: string, signer: Signer, uploadOpts?: UploadOption, retryOpts?: RetryOpts, opts?: TransactionOptions): Promise<[
        ({
            txHash: string;
            rootHash: string;
            txSeq: number;
        } | {
            txHashes: string[];
            rootHashes: string[];
            txSeqs: number[];
        }),
        Error | null
    ]>;
    /**
     * Downloads a single file by root hash, writing to `filePath`.
     * Node.js only — uses the `fs` module.
     */
    download(rootHash: string, filePath: string, proof?: boolean): Promise<Error | null>;
    /**
     * Downloads multiple files by root hashes and concatenates them.
     * Node.js only — uses the `fs` module.
     */
    download(rootHashes: string[], filePath: string, proof?: boolean): Promise<Error | null>;
    private downloadFragments;
    private downloadSingle;
    /**
     * Downloads a single file into a Blob — browser and Node.js safe.
     * Fetches file locations from the indexer and selects nodes with
     * the 'random' method for load balancing.
     */
    downloadToBlob(rootHash: string, proof?: boolean): Promise<[Blob, Error | null]>;
    /**
     * Downloads multiple files and concatenates them into a single Blob —
     * browser and Node.js safe.
     */
    downloadToBlob(rootHashes: string[], proof?: boolean): Promise<[Blob, Error | null]>;
    private downloadSingleToBlob;
    /**
     * Creates a Downloader whose node list is the minimal covering set for
     * `rootHash`, selected with the 'random' method for load balancing.
     */
    private newDownloaderFromIndexerNodes;
}
//# sourceMappingURL=Indexer.d.ts.map