import { Chain } from "../types/chain.js"; import { Transport } from "../types/transport.js"; import { Client } from "../types/client.js"; import { GetBlockCountReturnType } from "./getBlockCount.js"; //#region src/actions/watchBlockNumber.d.ts type OnBlockNumberParameter = GetBlockCountReturnType; type OnBlockNumberFn = (blockNumber: OnBlockNumberParameter, prevBlockNumber: OnBlockNumberParameter | undefined) => Promise; type WatchBlockNumberParameters = { /** The callback to call when a new block number is received. */onBlockNumber: OnBlockNumberFn; /** The callback to call when an error occurred when trying to get for a new block. */ onError?: ((error: Error) => void) | undefined; } & { /** Whether or not to emit the missed block numbers to the callback. */emitMissed?: boolean | undefined; /** Whether or not to emit the latest block number to the callback when the subscription opens. */ emitOnBegin?: boolean | undefined; /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */ pollingInterval?: number | undefined; }; type WatchBlockNumberReturnType = () => void; /** * Watches and returns incoming block numbers. * @param client - Client to use * @param parameters - {@link WatchBlockNumberParameters} * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType} */ declare function watchBlockNumber(client: Client, { emitOnBegin, emitMissed, onBlockNumber, onError, pollingInterval }: WatchBlockNumberParameters): WatchBlockNumberReturnType; //#endregion export { OnBlockNumberFn, OnBlockNumberParameter, WatchBlockNumberParameters, WatchBlockNumberReturnType, watchBlockNumber }; //# sourceMappingURL=watchBlockNumber.d.ts.map