/// <reference types="node" />
import { EventEmitter } from 'events';
import { io, Socket } from "socket.io-client";
export interface ISplitItem {
    id: number;
    name: string;
    pb_hits: number | null;
    pb_time: number | null;
    hits_way: number;
    hits_boss: number;
    active: boolean;
}
export interface SplitDuration {
    milliseconds: number;
    activeAt: number;
}
export interface AttemptDuration {
    attempt: number;
    attemptActiveAt: number;
    splits: {
        [key: number]: SplitDuration;
    };
}
export interface IRoute {
    id: number;
    name: string;
    pb_time?: number;
    pb_hits?: number;
}
export declare type IViewerSettingsJson = {
    [key: string]: string | number | null;
};
export interface IPageSettings {
    width: string;
    height: string;
    css: string;
    viewerSettings: {
        [appName: string]: IViewerSettingsJson;
    };
}
export interface BaseViewerSetting {
    label: string;
    helperText?: string;
}
export interface TextViewerSetting extends BaseViewerSetting {
    type: "text";
}
export interface NumberViewerSetting extends BaseViewerSetting {
    type: "number";
    max?: number;
    min?: number;
}
export interface TextareaViewerSetting extends BaseViewerSetting {
    type: "textarea";
}
export interface FileViewerSetting extends BaseViewerSetting {
    type: "file";
    extensions?: string[];
}
export interface IViewerSettingsConfiguration {
    [key: string]: TextViewerSetting | NumberViewerSetting | TextareaViewerSetting | FileViewerSetting;
}
export interface INotifyConfigurationAvailable {
    name: string;
    configuration: IViewerSettingsConfiguration;
}
export interface ISplitsData {
    api_version: string;
    routes: IRoute[];
    activeRoute: IRoute;
    activeSplits: ISplitItem[];
    attemptDuration: AttemptDuration;
    bestSegments: ISplitItem[];
    pageSettings: IPageSettings;
}
export interface ConnectOptions {
    app_name: string;
    host: string;
    port: string;
    protocol?: string;
}
export declare type WebsocketServerEventType = 'splits-updated' | 'next-split' | 'prev-split' | 'decrement-count' | 'increment-count' | 'page-settings-update';
export declare type ClientEventType = 'splits-updated' | 'websocket-connect_error';
export declare enum ClientState {
    CLIENT_DISCONNECT = "CLIENT_DISCONNECT",
    CLIENT_CONNECTING = "CLIENT_CONNECTING",
    CLIENT_OK = "CLIENT_OK"
}
declare global {
    interface Location {
        reload(forceGet?: boolean): void;
    }
}
export declare class Client extends EventEmitter {
    appName: string;
    socket: Socket;
    private data?;
    _state: ClientState;
    debug: boolean;
    static ioclient: typeof io;
    private lastApiVersion?;
    configuration?: IViewerSettingsConfiguration;
    get lastApiVersionConnected(): string | undefined;
    set state(val: ClientState);
    get state(): ClientState;
    constructor(appName: string, socket: Socket);
    private onSplitsUpdated;
    private onNextSplit;
    private onPrevSplit;
    private onDecrementCount;
    private onIncrementCount;
    private onDisconnect;
    private onServerRestartNow;
    private onServerShutdownNow;
    private onConnectError;
    private onConnect;
    private onPageSettingsUpdate;
    private routePublishEvents;
    private routeEvents;
    on(eventType: ClientEventType, callback: (data: ISplitsData, reason?: WebsocketServerEventType) => void): this;
    private setNextActiveSplit;
    onReconnect(): void;
    disconnect(): void;
    static connect(opts?: ConnectOptions): Promise<Client>;
}
export declare const connect: (opts?: ConnectOptions | undefined) => Promise<Client>;
