import { EventEmitter, EventReturnType } from "./events";
import { InputEvent, CloseEvent, PeerJoinEvent, PeerLeaveEvent } from "./events/impls";
import { RainwayInputLevel, RainwayStreamType } from "./rainway-ffi";
import { Peer } from "./peer";
/**
 * Events emitted by {@link OutboundStream}
 */
export interface OutboundStreamEvents {
    /**
     * Raised when an input (keyboard, mouse, gamepad...) is received from a remote device, before we've processed the input.
     * Only input attempts enabled by the stream's InputLevel cause these events.
     *
     * You can listen to this event and call `preventDefault` on the event to cancel input processing.
     */
    input: (ev: InputEvent) => EventReturnType;
    /**
     * Raised when the channel has been closed.
     */
    close: (ev: CloseEvent) => EventReturnType;
    /**
     * Raised when a peer joins the stream.
     */
    "peer-join": (ev: PeerJoinEvent) => EventReturnType;
    /**
     * Raised when a peer leaves the stream.
     */
    "peer-leave": (ev: PeerLeaveEvent) => EventReturnType;
}
/**
 * An outbound stream from our device to another Peer on the Rainway Network.
 */
export declare class OutboundStream extends EventEmitter<OutboundStreamEvents> {
    private _peerJoinHandler;
    private _peerLeaveHandler;
    private _closeHandler;
    private _inputHandler;
    /**
     * The id for this outbound stream.
     */
    readonly id: number;
    /**
     * The peer that owns this outbound stream.
     */
    readonly peer: Peer;
    /**
     * The type of this outbound stream.
     */
    readonly type: RainwayStreamType;
    /**
     * The process ids that this stream is limited to.
     * Only used if {@link OutboundStream.type} is {@link RainwayStreamType.AppIsolation}
     */
    readonly processIds: number[];
    /**
     * Gets or sets the default permissions granted to peers within this outbound stream.
     * See also {@link OutboundStream.getPeerPermission} which facilities modifying specific peer permissions, overriding this default.
     */
    get permissions(): RainwayInputLevel;
    set permissions(value: RainwayInputLevel);
    /** @internal */
    constructor(owner: Peer, id: number, type: RainwayStreamType, processIds?: number[]);
    /**
     * Retrieve the (optional) override permissions for a given peer.
     * This overrides {@link OutboundStream.permissions} for a specific peer.
     * If no override is present, the value of {@link OutboundStream.permissions} will be returned.
     * @param peer - peer or peer id
     * @returns permissions
     */
    getPeerPermission(peer: Peer | BigInt): RainwayInputLevel;
    /**
     * Set the (optional) override permissions for a given peer.
     * This overrides {@link OutboundStream.permissions} for a specific peer.
     * @param peer - peer or peer id
     * @param value - permissions
     */
    setPeerPermission(peer: Peer | BigInt, value: RainwayInputLevel): void;
    /**
     * Destroys the peer connection, including all sub resources.
     */
    close(): void;
}
