import { ApolloClient, NormalizedCacheObject } from "@apollo/client/core";
import { Client as WSClient } from "graphql-ws";
import { Ad4mClient, CapabilityInput } from "@coasys/ad4m";
export type Ad4mConnectOptions = {
    appName: string;
    appDesc: string;
    appDomain: string;
    appUrl?: string;
    appIconPath?: string;
    capabilities: CapabilityInput[];
    dataPath?: string;
    port?: number;
    token?: string;
    url?: string;
    hosting?: boolean;
    mobile?: boolean;
};
export type AuthStates = "authenticated" | "locked" | "unauthenticated";
export type Event = "authstatechange" | "connectionstatechange" | "configstatechange";
export type ConfigStates = "port" | "url" | "token";
export type ConnectionStates = "connecting" | "connected" | "error" | "port_not_found" | "not_connected" | "disconnected" | "checking_local";
export default class Ad4mConnect {
    activeSocket: WebSocket;
    requestedRestart: boolean;
    authState: AuthStates;
    connectionState: ConnectionStates;
    wsClient?: WSClient;
    apolloClient?: ApolloClient<NormalizedCacheObject>;
    ad4mClient?: Ad4mClient;
    requestId?: string;
    url: string;
    token: string;
    port: number;
    capabilities: CapabilityInput[];
    appName: string;
    appDesc: string;
    appDomain: string;
    appIconPath: string;
    appUrl?: string;
    isHosting: boolean;
    listeners: Record<Event, Function[]>;
    constructor({ appName, appDesc, appIconPath, appUrl, appDomain, capabilities, port, token, url, hosting }: Ad4mConnectOptions);
    private notifyConfigChange;
    private notifyConnectionChange;
    private notifyAuthChange;
    setPort(port: number): void;
    setUrl(url: string): void;
    setToken(token: string): void;
    on(event: Event, cb: Function): void;
    connect(url?: string): Promise<Ad4mClient>;
    loginToHosting(email: string, password: string): Promise<void>;
    checkEmail(email: string): Promise<boolean>;
    connectToPort(port?: number): Promise<Ad4mClient>;
    ensureConnection(): Promise<Ad4mClient>;
    findPort(): Promise<number>;
    buildClient(): Ad4mClient;
    checkAuth(): Promise<boolean>;
    requestCapability(invalidateToken?: boolean): Promise<string>;
    verifyCode(code: string): Promise<string>;
    clearState(): void;
}
