import { ForkName, ForkPostGloas, ForkPreDeneb } from "@lodestar/params";
import { BlobIndex, ColumnIndex, SignedBeaconBlock, Slot, deneb, fulu } from "@lodestar/types";
import { VersionedHashes } from "../../../execution/index.js";
import { AddBlob, AddBlock, AddColumn, BlobMeta, BlobWithSource, BlockInputInit, ColumnWithSource, CreateBlockInputMeta, DAData, DAType, IBlockInput, LogMetaBasic, LogMetaBlobs, LogMetaColumns, MissingColumnMeta, PromiseParts, SourceMeta } from "./types.js";
export type BlockInput = BlockInputPreData | BlockInputBlobs | BlockInputColumns | BlockInputNoData;
export declare function isBlockInputPreDeneb(blockInput: IBlockInput): blockInput is BlockInputPreData;
export declare function isBlockInputBlobs(blockInput: IBlockInput): blockInput is BlockInputBlobs;
export declare function isBlockInputColumns(blockInput: IBlockInput): blockInput is BlockInputColumns;
export declare function isBlockInputNoData(blockInput: IBlockInput): blockInput is BlockInputNoData;
type BlockInputState<F extends ForkName> = {
    hasBlock: false;
    hasAllData: false;
} | {
    hasBlock: false;
    hasAllData: true;
} | {
    hasBlock: true;
    hasAllData: false;
    block: SignedBeaconBlock<F>;
    source: SourceMeta;
} | {
    hasBlock: true;
    hasAllData: true;
    block: SignedBeaconBlock<F>;
    source: SourceMeta;
    timeCompleteSec: number;
};
declare abstract class AbstractBlockInput<F extends ForkName = ForkName, TData extends DAData = DAData> implements IBlockInput<F, TData> {
    abstract type: DAType;
    daOutOfRange: boolean;
    timeCreatedSec: number;
    forkName: ForkName;
    slot: Slot;
    blockRootHex: string;
    parentRootHex: string;
    abstract state: BlockInputState<F>;
    protected blockPromise: PromiseParts<SignedBeaconBlock<F>>;
    protected dataPromise: PromiseParts<TData>;
    constructor(init: BlockInputInit);
    abstract addBlock(props: AddBlock<F>): void;
    abstract getSerializedCacheKeys(): object[];
    hasBlock(): boolean;
    getBlock(): SignedBeaconBlock<F>;
    getBlockSource(): SourceMeta;
    hasAllData(): boolean;
    hasBlockAndAllData(): boolean;
    getLogMeta(): LogMetaBasic;
    getTimeComplete(): number;
    waitForBlock(timeout: number, signal?: AbortSignal): Promise<SignedBeaconBlock<F>>;
    waitForAllData(timeout: number, signal?: AbortSignal): Promise<TData>;
    waitForBlockAndAllData(timeout: number, signal?: AbortSignal): Promise<this>;
}
type BlockInputPreDataState = {
    hasBlock: true;
    hasAllData: true;
    block: SignedBeaconBlock<ForkPreDeneb>;
    source: SourceMeta;
    timeCompleteSec: number;
};
/**
 * Pre-DA, BlockInput only has a single state.
 * - the block simply exists
 */
export declare class BlockInputPreData extends AbstractBlockInput<ForkPreDeneb, null> {
    type: DAType.PreData;
    state: BlockInputPreDataState;
    private constructor();
    static createFromBlock(props: AddBlock & CreateBlockInputMeta): BlockInputPreData;
    addBlock(_: AddBlock, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    getSerializedCacheKeys(): object[];
}
export type ForkBlobsDA = ForkName.deneb | ForkName.electra;
type BlockInputBlobsState = {
    hasBlock: true;
    hasAllData: true;
    versionedHashes: VersionedHashes;
    block: SignedBeaconBlock<ForkBlobsDA>;
    source: SourceMeta;
    timeCompleteSec: number;
} | {
    hasBlock: true;
    hasAllData: false;
    versionedHashes: VersionedHashes;
    block: SignedBeaconBlock<ForkBlobsDA>;
    source: SourceMeta;
} | {
    hasBlock: false;
    hasAllData: false;
};
/**
 * With blobs, BlockInput has several states:
 * - The block is seen and all blobs are seen
 * - The block is seen and all blobs are not yet seen
 * - The block is yet not seen and its unknown if all blobs are seen
 */
export declare class BlockInputBlobs extends AbstractBlockInput<ForkBlobsDA, deneb.BlobSidecars> {
    type: DAType.Blobs;
    state: BlockInputBlobsState;
    private blobsCache;
    private constructor();
    static createFromBlock(props: AddBlock<ForkBlobsDA> & CreateBlockInputMeta): BlockInputBlobs;
    static createFromBlob(props: AddBlob & CreateBlockInputMeta): BlockInputBlobs;
    getLogMeta(): LogMetaBlobs;
    addBlock({ blockRootHex, block, source, seenTimestampSec, peerIdStr }: AddBlock<ForkBlobsDA>, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    hasBlob(blobIndex: BlobIndex): boolean;
    getBlob(blobIndex: BlobIndex): deneb.BlobSidecar | undefined;
    addBlob({ blockRootHex, blobSidecar, source, peerIdStr, seenTimestampSec }: AddBlob, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    getVersionedHashes(): VersionedHashes;
    getMissingBlobMeta(): BlobMeta[];
    getAllBlobsWithSource(): BlobWithSource[];
    getBlobs(): deneb.BlobSidecars;
    getSerializedCacheKeys(): object[];
}
export type ForkColumnsDA = ForkName.fulu;
type BlockInputColumnsState = {
    hasBlock: true;
    hasAllData: true;
    hasComputedAllData: boolean;
    versionedHashes: VersionedHashes;
    block: SignedBeaconBlock<ForkColumnsDA>;
    source: SourceMeta;
    timeCompleteSec: number;
} | {
    hasBlock: true;
    hasAllData: false;
    hasComputedAllData: false;
    versionedHashes: VersionedHashes;
    block: SignedBeaconBlock<ForkColumnsDA>;
    source: SourceMeta;
} | {
    hasBlock: false;
    hasAllData: true;
    hasComputedAllData: boolean;
    versionedHashes: VersionedHashes;
} | {
    hasBlock: false;
    hasAllData: false;
    hasComputedAllData: false;
    versionedHashes: VersionedHashes;
};
/**
 * With columns, BlockInput has several states:
 * - The block is seen and all required sampled columns are seen
 * - The block is seen and all required sampled columns are not yet seen
 * - The block is not yet seen and all required sampled columns are seen
 * - The block is not yet seen and all required sampled columns are not yet seen
 */
export declare class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.DataColumnSidecars> {
    type: DAType.Columns;
    state: BlockInputColumnsState;
    private columnsCache;
    private readonly sampledColumns;
    private readonly custodyColumns;
    /**
     * This promise resolves when all sampled columns are available
     *
     * This is different from `dataPromise` which resolves when all data is available or could become available (e.g. through reconstruction)
     */
    protected computedDataPromise: PromiseParts<import("@chainsafe/ssz").ValueOfFields<{
        index: import("@chainsafe/ssz").UintNumberType;
        column: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
        kzgCommitments: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
        kzgProofs: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
        signedBlockHeader: import("@chainsafe/ssz").ContainerType<{
            message: import("@chainsafe/ssz").ContainerType<{
                slot: import("@chainsafe/ssz").UintNumberType;
                proposerIndex: import("@chainsafe/ssz").UintNumberType;
                parentRoot: import("@chainsafe/ssz").ByteVectorType;
                stateRoot: import("@chainsafe/ssz").ByteVectorType;
                bodyRoot: import("@chainsafe/ssz").ByteVectorType;
            }>;
            signature: import("@chainsafe/ssz").ByteVectorType;
        }>;
        kzgCommitmentsInclusionProof: import("@chainsafe/ssz").VectorCompositeType<import("@chainsafe/ssz").ByteVectorType>;
    }>[]>;
    private constructor();
    get columnCount(): number;
    static createFromBlock(props: AddBlock<ForkColumnsDA> & CreateBlockInputMeta & {
        sampledColumns: ColumnIndex[];
        custodyColumns: ColumnIndex[];
    }): BlockInputColumns;
    static createFromColumn(props: AddColumn & CreateBlockInputMeta & {
        sampledColumns: ColumnIndex[];
        custodyColumns: ColumnIndex[];
    }): BlockInputColumns;
    getLogMeta(): LogMetaColumns;
    addBlock(props: AddBlock<ForkColumnsDA>, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    addColumn({ blockRootHex, columnSidecar, source, seenTimestampSec, peerIdStr }: AddColumn, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    hasColumn(columnIndex: number): boolean;
    getColumn(columnIndex: number): fulu.DataColumnSidecar | undefined;
    getVersionedHashes(): VersionedHashes;
    getCustodyColumns(): fulu.DataColumnSidecars;
    getSampledColumnsWithSource(): ColumnWithSource[];
    getSampledColumns(): fulu.DataColumnSidecars;
    getAllColumnsWithSource(): ColumnWithSource[];
    getAllColumns(): fulu.DataColumnSidecars;
    getMissingSampledColumnMeta(): MissingColumnMeta;
    hasComputedAllData(): boolean;
    waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<fulu.DataColumnSidecars>;
    getSerializedCacheKeys(): object[];
}
type BlockInputNoDataState = {
    hasBlock: true;
    hasAllData: true;
    block: SignedBeaconBlock<ForkPostGloas>;
    source: SourceMeta;
    timeCompleteSec: number;
};
export declare class BlockInputNoData extends AbstractBlockInput<ForkPostGloas, null> {
    type: DAType.NoData;
    state: BlockInputNoDataState;
    private constructor();
    static createFromBlock(props: AddBlock<ForkPostGloas> & CreateBlockInputMeta): BlockInputNoData;
    addBlock(_: AddBlock<ForkPostGloas>, opts?: {
        throwOnDuplicateAdd: boolean;
    }): void;
    getBlobKzgCommitments(): deneb.BlobKzgCommitments;
    getSerializedCacheKeys(): object[];
}
export {};
//# sourceMappingURL=blockInput.d.ts.map