import { EventEmitter, EventReturnType } from "./events";
import { MessageEvent } from "./events/impls";
import { Peer } from "./peer";
import { RainwayChannelMode } from "./rainway-ffi";
/**
 * Events emitted by {@link DataChannel}
 */
export interface DataChannelEvents {
    /**
     * Raised when a message arrives via the data channel.
     */
    message: (ev: MessageEvent) => EventReturnType;
}
/**
 * A data channel from our device to another Peer on the Rainway Network.
 */
export declare class DataChannel extends EventEmitter<DataChannelEvents> {
    private _onData;
    /**
     * The id (label) of the data channel.
     */
    readonly id: string;
    /**
     * The mode of the data channel.
     */
    readonly mode: RainwayChannelMode;
    /**
     * The peer that owns this data channel.
     */
    readonly peer: Peer;
    /** @internal */
    constructor(peer: Peer, mode: RainwayChannelMode, id: string);
    /**
     * Sends a binary message via this data channel.
     * If a string is given, it will be utf-8 encoded before transmission.
     * @param data - data to transmit
     */
    send(data: string | Uint8Array): void;
}
