import { ApiPromise } from '@polkadot/api'; import { RegisteredTypes } from '@polkadot/types/types'; import { ApiConnectionError, NetworkMetadataPayload, IApiConnectionSpecific, IBlock } from '@subql/node-core'; import { IEndpointConfig } from '@subql/types-core'; import * as SubstrateUtil from '../utils/substrate'; import { ApiAt, BlockContent, LightBlockContent } from './types'; export type FetchFunc = typeof SubstrateUtil.fetchBlocksBatches | typeof SubstrateUtil.fetchBlocksBatchesLight; export type GetFetchFunc = () => FetchFunc; export declare class ApiPromiseConnection implements IApiConnectionSpecific[] | IBlock[]> { unsafeApi: ApiPromise; private fetchBlocksBatches; readonly networkMeta: NetworkMetadataPayload; private constructor(); static create(endpoint: string, fetchBlocksBatches: GetFetchFunc, args: { chainTypes?: RegisteredTypes; }, config: IEndpointConfig): Promise; safeApi(height: number): ApiAt; fetchBlocks(heights: number[], overallSpecVer?: number): Promise[] | IBlock[]>; apiConnect(): Promise; apiDisconnect(): Promise; updateChainTypes(chainTypes: RegisteredTypes): Promise; handleError: typeof ApiPromiseConnection.handleError; static handleError(e: Error): ApiConnectionError; }