import { SuccessResponse, ErrorResponse, SubscriptionResponse } from "./Response";
import { Socket } from "./interfaces/Socket";
export declare type Visibility = "127.0.0.1" | "0.0.0.0";
export declare type Name = string;
export declare type SocketConf = {
    connectionHandler: (socket: Socket) => void;
    errorHandler: (socket: Socket) => (error: any) => void;
    closeHandler: (socket: Socket) => () => void;
    visibility: Visibility;
};
export declare type rpcType = 'Hook' | 'Unhook' | 'Call';
export declare type BaseRPC = {
    type: rpcType;
    name: string;
};
export declare type HookRPC = BaseRPC & {
    type: 'Hook';
    func: CallbackFunction;
    unhook: UnhookFunction;
};
export declare type UnhookRPC = BaseRPC & {
    type: 'Unhook';
    func: UnhookFunction;
};
export declare type CallRPC = BaseRPC & {
    type: 'Call';
    func: (...args: any[]) => Promise<any>;
};
export declare type SocketioRPC = CallRPC | UnhookRPC | HookRPC;
export declare type BaseInfo = {
    owner: string;
    argNames: string[];
};
export declare type HookInfo = BaseRPC & BaseInfo & {
    type: 'Hook';
    generator: (socket: any) => CallbackFunction;
    unhook: UnhookFunction;
};
export declare type UnhookInfo = BaseRPC & BaseInfo & {
    type: 'Unhook';
    func: UnhookFunction;
};
export declare type CallInfo = BaseRPC & BaseInfo & {
    type: 'Call';
    func: AsyncFunction;
};
export declare type RpcInfo = HookInfo | UnhookInfo | CallInfo;
export declare type ExtendedRpcInfo = RpcInfo & {
    uniqueName: string;
};
export declare type OnFunction = (type: 'error' | 'close', f: (e?: any) => void) => Socket;
export declare type UnhookFunction = (uid: string) => Promise<SuccessResponse | ErrorResponse>;
export declare type CallbackFunction = (...args: any[]) => Promise<SubscriptionResponse | ErrorResponse>;
export declare type AsyncFunction = (...args: any[]) => Promise<any>;
