declare module '@metamask/eth-query' { // What it says on the tin. We omit `null`, as that value is used for a // successful response to indicate a lack of an error. type EverythingButNull = | string | number | boolean // eslint-disable-next-line @typescript-eslint/ban-types | object | symbol | undefined; type Json = | null | boolean | number | string | Json[] | { [prop: string]: Json }; type JsonRpcParams = Json[] | Record; type ProviderSendAsyncResponse = { error?: { message: string }; result?: Result; }; type ProviderSendAsyncCallback = ( error: unknown, response: ProviderSendAsyncResponse, ) => void; type Provider = { sendAsync( payload: SendAsyncPayload, callback: ProviderSendAsyncCallback, ): void; }; type SendAsyncPayload = { id: number; jsonrpc: '2.0'; method: string; params: Params; }; type SendAsyncCallback = ( ...args: | [error: EverythingButNull, result: undefined] | [error: null, result: Result] ) => void; export default class EthQuery { constructor(provider: Provider); sendAsync( opts: Partial>, callback: SendAsyncCallback, ): void; [method: string]: (...args: any[]) => void; } }