import { EventEmitter } from 'stream';
import Movement from './components/movement';
import { DeltaItem, SnapshotItemTypes } from './enums_types/types';
import { MsgPacker } from './MsgPacker';
import { Snapshot } from './snapshot';
import { Game } from "./components/game";
import { SnapshotWrapper } from "./components/snapshot";
import { States } from "./enums_types/protocol";
import { Rcon } from "./components/rcon";
import { TwMap } from "./components/twmap";
declare interface iMessage {
    team: number;
    client_id: number;
    author?: {
        ClientInfo?: SnapshotItemTypes.ClientInfo;
        PlayerInfo?: SnapshotItemTypes.PlayerInfo;
    };
    message: string;
}
declare interface iEmoticon {
    client_id: number;
    emoticon: number;
    author?: {
        ClientInfo?: SnapshotItemTypes.ClientInfo;
        PlayerInfo?: SnapshotItemTypes.PlayerInfo;
    };
}
declare interface iKillMsg {
    killer_id: number;
    killer?: {
        ClientInfo?: SnapshotItemTypes.ClientInfo;
        PlayerInfo?: SnapshotItemTypes.PlayerInfo;
    };
    victim_id: number;
    victim?: {
        ClientInfo?: SnapshotItemTypes.ClientInfo;
        PlayerInfo?: SnapshotItemTypes.PlayerInfo;
    };
    weapon: number;
    special_mode: number;
}
declare interface iKillMsgTeam {
    team: number;
    first: number;
}
declare interface iMapChange {
    map_name: string;
    crc: number;
    size: number;
}
export interface iMapDetails {
    map_name: string;
    map_sha256: Buffer;
    map_crc: number;
    map_size: number;
    map_url: string;
}
declare interface iOptions {
    identity?: SnapshotItemTypes.ClientInfo;
    password?: string;
    ddnet_version?: {
        version: number;
        release_version: string;
    };
    timeout?: number;
    NET_VERSION?: string;
    lightweight?: boolean;
    timeout_on_connecting?: boolean;
    downloadMap?: boolean;
}
interface ClientEvents {
    connected: () => void;
    map_change: (message: iMapChange) => void;
    disconnect: (reason: string, fromServer: boolean) => void;
    emote: (message: iEmoticon) => void;
    message: (message: iMessage) => void;
    broadcast: (message: string) => void;
    kill: (kill: iKillMsg) => void;
    motd: (message: string) => void;
    teams: (teams: Array<number>) => void;
    teamkill: (teamkill: iKillMsgTeam) => void;
    map_details: (message: iMapDetails) => void;
    capabilities: (message: {
        ChatTimeoutCode: boolean;
        AnyPlayerFlag: boolean;
        PingEx: boolean;
        AllowDummy: boolean;
        SyncWeaponInput: boolean;
    }) => void;
    snapshot: (items: DeltaItem[]) => void;
}
export declare class Client extends EventEmitter {
    on<K extends keyof ClientEvents>(event: K, listener: ClientEvents[K]): this;
    emit<K extends keyof ClientEvents>(event: K, ...args: Parameters<ClientEvents[K]>): boolean;
    rcon: Rcon;
    private host;
    private port;
    private name;
    private _State;
    private ack;
    private lastAcknowledgedSequence;
    private clientAck;
    private lastCheckedChunkAck;
    private receivedSnaps;
    private socket;
    private TKEN;
    private time;
    private SnapUnpacker;
    SnapshotUnpacker: SnapshotWrapper;
    private PredGameTick;
    private AckGameTick;
    private SnapshotParts;
    private currentSnapshotGameTick;
    private snaps;
    private sentChunkQueue;
    private queueChunkEx;
    private lastSendTime;
    private lastRecvTime;
    private lastSentMessages;
    movement: Movement;
    game: Game;
    map: TwMap | undefined;
    private lastMapDetails;
    private VoteList;
    readonly options?: iOptions;
    private requestResend;
    private UUIDManager;
    private predTimer?;
    private connectInterval?;
    private inputInterval?;
    private resendTimeout?;
    private timeoutChecker?;
    constructor(ip: string, port: number, nickname: string, options?: iOptions);
    private OnEnterGame;
    /** Clear all intervals and timers */
    private clearAllIntervals;
    /** Reset client state for a fresh connection */
    private resetState;
    private ResendAfter;
    private Unpack;
    /**  Send a Control Msg to the server. (used for disconnect)*/
    SendControlMsg(msg: number, ExtraMsg?: string): Promise<unknown>;
    /**  Send a Msg (or Msg[]) to the server.*/
    SendMsgEx(Msgs: MsgPacker[] | MsgPacker, flags?: number): void;
    /** Queue a chunk (instantly sent if flush flag is set - otherwise it will be sent in the next packet). */
    QueueChunkEx(Msg: MsgPacker | MsgPacker[]): void;
    /**  Send a Raw Buffer (as chunk) to the server. */
    SendMsgRaw(chunks: Buffer[]): void;
    private MsgToChunk;
    Flush(): void;
    /** Connect the client to the server. Throws an error if client.State is equal to teeworlds.Protocol.States.STATE_ONLINE or STATE_CONNECTING.*/
    connect(): Promise<void>;
    /** Sending the input. (automatically done unless options.lightweight is on) */
    sendInput(input?: import("./components/movement").NetObj_PlayerInput): void;
    /** returns the movement object of the client */
    get input(): import("./components/movement").NetObj_PlayerInput;
    /** Disconnect the client. Throws an error if client.State == teeworlds.Protocol.States.STATE_OFFLINE. */
    private _Disconnect;
    /** Disconnect the client. Throws an error if client.State == teeworlds.Protocol.States.STATE_OFFLINE. */
    Disconnect(): Promise<unknown>;
    /** Get all available vote options (for example for map voting) */
    get VoteOptionList(): string[];
    get rawSnapUnpacker(): Snapshot;
    get State(): States;
}
export {};
