kuzzle-sdk
Version:
Official Javascript SDK for Kuzzle
63 lines (62 loc) • 1.75 kB
TypeScript
import { KuzzleEventEmitter } from "../../core/KuzzleEventEmitter";
import { PendingRequest } from "./PendingRequest";
import { JSONObject } from "../../types";
import { RequestPayload } from "../../types/RequestPayload";
export declare abstract class KuzzleAbstractProtocol extends KuzzleEventEmitter {
private _pendingRequests;
private _host;
private _name;
private _port;
private _ssl;
private _cookieSupport;
id: string;
state: string;
get sslConnection(): boolean;
constructor(host: string, options?: JSONObject, name?: string);
/**
* Kuzzle server host or IP.
*/
get host(): string;
/**
* Protocol name.
*/
get name(): string;
/**
* Kuzzle server port.
*/
get port(): number;
/**
* `true` if ssl is active.
*/
get ssl(): boolean;
/**
* `true` if the socket is open.
*/
get connected(): boolean;
/**
* `true` if cookie authentication is enabled
*/
get cookieSupport(): boolean;
get pendingRequests(): Map<string, PendingRequest>;
abstract connect(): Promise<any>;
abstract send(request: RequestPayload, options: JSONObject): void;
/**
* Called when we want to enable http cookie support
*/
enableCookieSupport(): void;
/**
* Called when the client's connection is established
*/
clientConnected(state?: string, wasConnected?: boolean): void;
/**
* Called when the client's connection is closed
*/
close(): void;
query(request: RequestPayload, options: any): Promise<any>;
isReady(): boolean;
/**
* Clear pendings requests.
* Emits an event for each discarded pending request.
*/
clear(): void;
}