import { ApiPromise } from '@polkadot/api';
import { ApiOptions } from '@polkadot/api/types';
import { ProviderInterface } from '@polkadot/rpc-provider/types';
/**
 * Detector is an API for providing an instance of the PolkadotJS API configured
 * to use a WASM-based light client.  It takes care of detecting whether the
 * user has the substrate connect browser extension installed or not and
 * configures the PolkadotJS API appropriately; falling back to a provider
 * which instantiates the WASM light client in the page when the extension is
 * not available.
 *
 * @example
 *
 * ```
 * import { Detector } from '@substrate/connect';
 *
 * // Create a new UApp with a unique name
 * const app = new Detector('burnr-wallet');
 * const westend = await app.connect('westend');
 * const kusama = await app.connect('kusama');
 *
 * await westend.rpc.chain.subscribeNewHeads((lastHeader) => {
 *   console.log(lastHeader.hash);
 * );
 * await kusama.rpc.chain.subscribeNewHeads((lastHeader) => {
 *   console.log(lastHeader.hash);
 * });
 *
 * // Interact with westend and kusama APIs ...
 *
 * await westend.disconnect();
 * await kusama.disconnect();
 * ```
 */
export declare class Detector {
    #private;
    /**
     * name is the name of the app. This is used by the extension to identify
     * your app in the user interface
     */
    get name(): string;
    /**
     * @param name - the name of your app.
     *
     * @remarks
     *
     * You should make a best effort to make your app name unique to avoid
     * confusion for users in the extension user interface
     */
    constructor(name: string);
    /**
     * connect attempts to detect the extension and configures the PolkadotJS
     * API instance to return appropriately.
     *
     * There are 3 bundled networks: "polkadot", "kusama" and "westend" which
     * require no further configuration.
     *
     * Alternatively you may supply a chain spec and options to connect to a
     * custom chain with a light client (in-page only).
     *
     * @param chainName - the name of the blockchain network to connect to
     * @param chainSpec - an optional chainSpec to connect to a different network
     * @param options - any extra API options to passed to PolkadotJS when
     * constructing it.
     * @returns a promise that resolves to an instance of the PolkadotJS API
     *
     * @remarks
     *
     * When providing a custom chain spec, detect will always configure and return
     * an in-page light client and not use the extension
     *
     * Typically options is used to pass custom types to PolkadotJS API.
     *
     * See the PolkadotJS docs for documentation on using PolkadotJS.
     *
     * {@link https://polkadot.js.org/docs/}
     */
    connect: (chainName: string, chainSpec?: string | undefined, options?: ApiOptions | undefined) => Promise<ApiPromise>;
    /**
     * Detects and returns an appropriate PolkadotJS provider depending on whether the user has the substrate connect extension installed
     *
     * @param chainName - the name of the blockchain network to connect to
     * @param chainSpec - an optional chainSpec to connect to a different network
     * @returns a provider will be used in a ApiPromise create for PolkadotJS API
     *
     * @internal
     *
     * @remarks
     * This is used internally for advanced PolkadotJS use cases and is not supported.  Use {@link connect} instead.
     */
    provider: (chainName: string, chainSpec?: string | undefined) => ProviderInterface;
    /**
     * disconnect disconnects the PolkadotJS API isntance
     *
     * @param chainName - the name of the blockchain network to disconnect from
     */
    disconnect: (chainName: string) => Promise<void>;
}
//# sourceMappingURL=Detector.d.ts.map