declare namespace wasm_bindgen {
    /* tslint:disable */
    /* eslint-disable */
    /**
     * The `ReadableStreamType` enum.
     *
     * *This API requires the following crate features to be activated: `ReadableStreamType`*
     */

    export type ReadableStreamType = "bytes";

    /**
     * A live tunnel to a connectR daemon.
     */
    export class ClientSession {
        private constructor();
        free(): void;
        [Symbol.dispose](): void;
        /**
         * Close the tunnel.
         */
        close(): void;
        /**
         * Dial the daemon whose identity is derived from (alias, password) and
         * prove knowledge of the derived secret (the password).
         *
         * Retries while address lookup and relay handshakes warm up. A wrong
         * alias/password derives a different EndpointId, which is never
         * resolvable, so the attempt eventually fails with a friendly error.
         */
        static connect(alias: string, password: string): Promise<ClientSession>;
        /**
         * The EndpointId of the daemon this session is connected to.
         */
        endpoint_id(): string;
        /**
         * Fetch one path from the local service through the tunnel.
         *
         * `headers` is a JS array of `[name, value]` pairs; `body` is an optional
         * Uint8Array (POST/PUT payloads). Returns `{ status, headers, body }`
         * where `headers` is a plain object and `body` a Uint8Array.
         */
        fetch(path: string, method: string, headers: Array<any>, body?: Uint8Array | null): Promise<any>;
    }

    export class IntoUnderlyingByteSource {
        private constructor();
        free(): void;
        [Symbol.dispose](): void;
        cancel(): void;
        pull(controller: ReadableByteStreamController): Promise<any>;
        start(controller: ReadableByteStreamController): void;
        readonly autoAllocateChunkSize: number;
        readonly type: ReadableStreamType;
    }

    export class IntoUnderlyingSink {
        private constructor();
        free(): void;
        [Symbol.dispose](): void;
        abort(reason: any): Promise<any>;
        close(): Promise<any>;
        write(chunk: any): Promise<any>;
    }

    export class IntoUnderlyingSource {
        private constructor();
        free(): void;
        [Symbol.dispose](): void;
        cancel(): void;
        pull(controller: ReadableStreamDefaultController): Promise<any>;
    }

    export function start(): void;

}
declare type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

declare interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly __wbg_clientsession_free: (a: number, b: number) => void;
    readonly clientsession_close: (a: number) => void;
    readonly clientsession_connect: (a: number, b: number, c: number, d: number) => number;
    readonly clientsession_endpoint_id: (a: number, b: number) => void;
    readonly clientsession_fetch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
    readonly start: () => void;
    readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
    readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
    readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
    readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
    readonly intounderlyingbytesource_cancel: (a: number) => void;
    readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
    readonly intounderlyingbytesource_start: (a: number, b: number) => void;
    readonly intounderlyingbytesource_type: (a: number) => number;
    readonly intounderlyingsink_abort: (a: number, b: number) => number;
    readonly intounderlyingsink_close: (a: number) => number;
    readonly intounderlyingsink_write: (a: number, b: number) => number;
    readonly intounderlyingsource_cancel: (a: number) => void;
    readonly intounderlyingsource_pull: (a: number, b: number) => number;
    readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
    readonly __wasm_bindgen_func_elem_6419: (a: number, b: number, c: number, d: number) => void;
    readonly __wasm_bindgen_func_elem_6434: (a: number, b: number, c: number, d: number) => void;
    readonly __wasm_bindgen_func_elem_2531: (a: number, b: number, c: number) => void;
    readonly __wasm_bindgen_func_elem_1199: (a: number, b: number, c: number) => void;
    readonly __wasm_bindgen_func_elem_3372: (a: number, b: number, c: number) => void;
    readonly __wasm_bindgen_func_elem_2445: (a: number, b: number) => void;
    readonly __wasm_bindgen_func_elem_2905: (a: number, b: number) => void;
    readonly __wasm_bindgen_func_elem_6357: (a: number, b: number) => void;
    readonly __wbindgen_export: (a: number, b: number) => number;
    readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
    readonly __wbindgen_export3: (a: number) => void;
    readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
    readonly __wbindgen_export5: (a: number, b: number) => void;
    readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
    readonly __wbindgen_start: () => void;
}

/**
 * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
 * for everything else, calls `WebAssembly.instantiate` directly.
 *
 * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
 *
 * @returns {Promise<InitOutput>}
 */
declare function wasm_bindgen (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
