import { type Ref } from "vue";
import type { ICore1WebsocketMessage } from '../types/websocket';
declare enum SocketStates {
    closed = "closed",
    opened = "opened",
    error = "error"
}
export interface Core1WebsocketStatus {
    status: SocketStates;
    data?: string;
}
export declare const status: Ref<Core1WebsocketStatus>;
/**
 * subscribe a new function as callback for incoming websocket messages
 *
 * @param fn function to be called for every websocket message
 *
 * @see unsubscribe
 */
export declare function subscribe(fn: (message: ICore1WebsocketMessage) => void): void;
/**
 * unsubscribes the given function that was previously subscribed as listener
 *
 * @param fn function to remove as callback
 *
 * @see subscribe
 */
export declare function unsubscribe(fn: (message: ICore1WebsocketMessage) => void): void;
/**
 * tries to establish a websocket connection to the given url (unless already established).
 * Pass null to disconnect from the websocket.
 *
 * @param url the websocket url to connect to
 */
export declare function connect(url?: string): void;
export {};
