import { ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from "@polkadot/rpc-provider/types";
interface SubscriptionHandler {
    callback: ProviderInterfaceCallback;
    type: string;
}
/**
 * SmoldotProvider
 *
 * The SmoldotProvider allows interacting with a smoldot-based
 * WASM light client.  I.e. without doing RPC to a remote node over HTTP
 * or websockets
 *
 * @example
 * ```javascript
 * import readFileSync from 'fs';
 * import Api from '@polkadot/api/promise';
 * import { SmoldotProvider } from '../';
 *
 * const chainSpec = readFileSync('./path/to/chainSpec.json');
 * const provider = new SmoldotProvider(chainSpec);
 * const api = new Api(provider);
 * ```
 * @example
 * ```javascript
 * import readFileSync from 'fs';
 * import Api from '@polkadot/api/promise';
 * import { SmoldotProvider } from '../';
 *
 * const chainSpec = readFileSync('./path/to/polkadot.json');
 * const pp = new SmoldotProvider(chainSpec);
 * const polkadotApi = new Api(pp);
 *
 * const chainSpec = readFileSync('./path/to/kusama.json');
 * const kp = new SmoldotProvider(chainSpec);
 * const kusamaApi = new Api(pp);
 * ```
 */
export declare class SmoldotProvider implements ProviderInterface {
    #private;
    healthPingerInterval: number;
    /**
     * @param chainSpec - The chainSpec for the WASM client
     * @param sm - (only used for testing) defaults to the actual smoldot module
     */
    constructor(chainSpec: string, parachain?: string, sm?: any);
    /**
     * Lets polkadot-js know we support subscriptions
     * @returns `true`
     */
    get hasSubscriptions(): boolean;
    /**
     * Returns a clone of the object
     * @throws throws an error as this is not supported.
     */
    clone(): SmoldotProvider;
    /**
     * "Connect" the WASM client - starts the smoldot WASM client
     */
    connect: () => Promise<void>;
    /**
     * Manually "disconnect" - drops the reference to the WASM client
     */
    disconnect(): Promise<void>;
    /**
     * Whether the node is connected or not.
     * @returns true if connected
     */
    get isConnected(): boolean;
    /**
     * Listen to provider events - in practice the smoldot provider only
     * emits a `connected` event after successfully starting the smoldot client
     * and `disconnected` after `disconnect` is called.
     * @param type - Event
     * @param sub  - Callback
     */
    on(type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void;
    /**
     * Send an RPC request  the wasm client
     * @param method       - The RPC methods to execute
     * @param params       - Encoded paramaters as applicable for the method
     * @param subscription - Subscription details (internally used by `subscribe`)
     */
    send(method: string, params: unknown[], isCacheable?: boolean, subscription?: SubscriptionHandler): Promise<any>;
    /**
     * subscribe
     * Allows subscribing to a specific event.
     * @param  type     - Subscription type
     * @param  method   - Subscription method
     * @param  params   - Parameters of type any[]
     * @param  callback - ProviderInterfaceCallback
     * @returns A promise (Promise\<number|string\>) resolving to the id of the subscription you can use with [[unsubscribe]].
     *
     * @example
     * <BR>
     *
     * ```javascript
     * const provider = new SmoldotProvider(client);
     * const rpc = new Rpc(provider);
     *
     * rpc.state.subscribeStorage([[storage.balances.freeBalance, <Address>]], (_, values) => {
     *   console.log(values)
     * }).then((subscriptionId) => {
     *   console.log('balance changes subscription id: ', subscriptionId)
     * })
     * ```
     */
    subscribe(type: string, method: string, params: any[], callback: ProviderInterfaceCallback): Promise<number | string>;
    /**
     * Allows unsubscribing to subscriptions made with [[subscribe]].
     */
    unsubscribe(type: string, method: string, id: number | string): Promise<boolean>;
    private emit;
}
export {};
//# sourceMappingURL=SmoldotProvider.d.ts.map