export declare type RequestType = "post" | "get" | "jsonp"; export declare type ResponseType = "json" | "text"; export declare type IOptionsSend = (options: IOptions, action: string, request: any, responseType: ResponseType, defaultSend: SendFunc, header?: any) => Promise; export interface IOptions { baseUrl: string; type?: RequestType; userID?: string; password?: string; rejectUnauthorized?: boolean; timeoutSecs?: number; hookSend?: IOptionsSend; encodeRequest?: boolean; } export declare function instanceOfIOptions(object: any): object is IOptions; export interface IConnection { opts(_: Partial): this; opts(): IOptions; baseUrl: string; send(action: string, request: any, responseType?: ResponseType): Promise; clone(): IConnection; } export declare function instanceOfIConnection(object: any): object is IConnection; export declare function serializeRequest(obj: any, encodeRequest?: boolean, prefix?: string): string; export declare function deserializeResponse(body: string): any; export declare function jsonp(opts: IOptions, action: string, request?: any, responseType?: ResponseType, header?: any): Promise; export declare function post(opts: IOptions, action: string, request: any, responseType?: ResponseType, header?: any): Promise; export declare function get(opts: IOptions, action: string, request: any, responseType?: ResponseType, header?: any): Promise; export declare type SendFunc = (opts: IOptions, action: string, request: any, responseType: ResponseType, header?: any) => Promise; export declare function send(opts: IOptions, action: string, request: any, responseType?: ResponseType, header?: any): Promise; export declare function hookSend(newSend?: SendFunc): SendFunc; export declare class Connection implements IConnection { protected _opts: IOptions; readonly baseUrl: string; constructor(opts: IOptions); opts(_: Partial): this; opts(): IOptions; send(action: string, request: any, responseType?: ResponseType, header?: any): Promise; clone(): Connection; } export declare type IConnectionFactory = (opts: IOptions) => IConnection; export declare let createConnection: IConnectionFactory; export declare function setTransportFactory(newFunc: IConnectionFactory): IConnectionFactory; //# sourceMappingURL=connection.d.ts.map