;
}
export interface RequestHandler {
(params: P, token: CancellationToken): HandlerResult;
}
export interface RequestHandler1 {
(p1: P1, token: CancellationToken): HandlerResult;
}
export interface RequestHandler2 {
(p1: P1, p2: P2, token: CancellationToken): HandlerResult;
}
export interface RequestHandler3 {
(p1: P1, p2: P2, p3: P3, token: CancellationToken): HandlerResult;
}
export interface RequestHandler4 {
(p1: P1, p2: P2, p3: P3, p4: P4, token: CancellationToken): HandlerResult;
}
export interface RequestHandler5 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token: CancellationToken): HandlerResult;
}
export interface RequestHandler6 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token: CancellationToken): HandlerResult;
}
export interface RequestHandler7 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token: CancellationToken): HandlerResult;
}
export interface RequestHandler8 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token: CancellationToken): HandlerResult;
}
export interface RequestHandler9 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token: CancellationToken): HandlerResult;
}
export interface StarNotificationHandler {
(method: string, ...params: any[]): void;
}
export interface GenericNotificationHandler {
(...params: any[]): void;
}
export interface NotificationHandler0 {
(): void;
}
export interface NotificationHandler {
(params: P): void;
}
export interface NotificationHandler1 {
(p1: P1): void;
}
export interface NotificationHandler2 {
(p1: P1, p2: P2): void;
}
export interface NotificationHandler3 {
(p1: P1, p2: P2, p3: P3): void;
}
export interface NotificationHandler4 {
(p1: P1, p2: P2, p3: P3, p4: P4): void;
}
export interface NotificationHandler5 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void;
}
export interface NotificationHandler6 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void;
}
export interface NotificationHandler7 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void;
}
export interface NotificationHandler8 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void;
}
export interface NotificationHandler9 {
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void;
}
export interface Logger {
error(message: string): void;
warn(message: string): void;
info(message: string): void;
log(message: string): void;
}
export declare const NullLogger: Logger;
export declare enum Trace {
Off = 0,
Messages = 1,
Verbose = 2
}
export declare type TraceValues = 'off' | 'messages' | 'verbose';
export declare namespace Trace {
function fromString(value: string): Trace;
function toString(value: Trace): TraceValues;
}
export declare enum TraceFormat {
Text = "text",
JSON = "json"
}
export declare namespace TraceFormat {
function fromString(value: string): TraceFormat;
}
export interface TraceOptions {
sendNotification?: boolean;
traceFormat?: TraceFormat;
}
export interface SetTraceParams {
value: TraceValues;
}
export declare namespace SetTraceNotification {
const type: NotificationType;
}
export interface LogTraceParams {
message: string;
verbose?: string;
}
export declare namespace LogTraceNotification {
const type: NotificationType;
}
export interface Tracer {
log(dataObject: any): void;
log(message: string, data?: string): void;
}
export declare enum ConnectionErrors {
/**
* The connection is closed.
*/
Closed = 1,
/**
* The connection got disposed.
*/
Disposed = 2,
/**
* The connection is already in listening mode.
*/
AlreadyListening = 3
}
export declare class ConnectionError extends Error {
readonly code: ConnectionErrors;
constructor(code: ConnectionErrors, message: string);
}
export declare type MessageQueue = LinkedMap;
export declare type ConnectionStrategy = {
cancelUndispatched?: (message: Message, next: (message: Message) => ResponseMessage | undefined) => ResponseMessage | undefined;
};
export declare namespace ConnectionStrategy {
function is(value: any): value is ConnectionStrategy;
}
export interface MessageConnection {
sendRequest(type: RequestType0, token?: CancellationToken): Thenable;
sendRequest(type: RequestType
, params: P, token?: CancellationToken): Thenable;
sendRequest(type: RequestType1, p1: P1, token?: CancellationToken): Thenable;
sendRequest(type: RequestType2, p1: P1, p2: P2, token?: CancellationToken): Thenable;
sendRequest(type: RequestType3, p1: P1, p2: P2, p3: P3, token?: CancellationToken): Thenable;
sendRequest(type: RequestType4, p1: P1, p2: P2, p3: P3, p4: P4, token?: CancellationToken): Thenable;
sendRequest(type: RequestType5, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token?: CancellationToken): Thenable;
sendRequest(type: RequestType6, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token?: CancellationToken): Thenable;
sendRequest(type: RequestType7, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token?: CancellationToken): Thenable;
sendRequest(type: RequestType8, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token?: CancellationToken): Thenable;
sendRequest(type: RequestType9, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token?: CancellationToken): Thenable;
sendRequest(method: string, ...params: any[]): Thenable;
onRequest(type: RequestType0, handler: RequestHandler0): void;
onRequest(type: RequestType
, handler: RequestHandler
): void;
onRequest(type: RequestType1, handler: RequestHandler1): void;
onRequest(type: RequestType2, handler: RequestHandler2): void;
onRequest(type: RequestType3, handler: RequestHandler3): void;
onRequest(type: RequestType4, handler: RequestHandler4): void;
onRequest(type: RequestType5, handler: RequestHandler5): void;
onRequest(type: RequestType6, handler: RequestHandler6): void;
onRequest(type: RequestType7, handler: RequestHandler7): void;
onRequest(type: RequestType8, handler: RequestHandler8): void;
onRequest(type: RequestType9, handler: RequestHandler9): void;
onRequest(method: string, handler: GenericRequestHandler): void;
onRequest(handler: StarRequestHandler): void;
sendNotification(type: NotificationType0): void;
sendNotification(type: NotificationType
, params?: P): void;
sendNotification(type: NotificationType1, p1: P1): void;
sendNotification(type: NotificationType2, p1: P1, p2: P2): void;
sendNotification(type: NotificationType3, p1: P1, p2: P2, p3: P3): void;
sendNotification(type: NotificationType4, p1: P1, p2: P2, p3: P3, p4: P4): void;
sendNotification(type: NotificationType5, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void;
sendNotification(type: NotificationType6, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void;
sendNotification(type: NotificationType7, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void;
sendNotification(type: NotificationType8, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void;
sendNotification(type: NotificationType9, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void;
sendNotification(method: string, ...params: any[]): void;
onNotification(type: NotificationType0, handler: NotificationHandler0): void;
onNotification(type: NotificationType
, handler: NotificationHandler
): void;
onNotification(type: NotificationType1, handler: NotificationHandler1): void;
onNotification(type: NotificationType2, handler: NotificationHandler2): void;
onNotification(type: NotificationType3, handler: NotificationHandler3): void;
onNotification(type: NotificationType4, handler: NotificationHandler4): void;
onNotification(type: NotificationType5, handler: NotificationHandler5): void;
onNotification(type: NotificationType6, handler: NotificationHandler6): void;
onNotification(type: NotificationType7, handler: NotificationHandler7): void;
onNotification(type: NotificationType8, handler: NotificationHandler8): void;
onNotification(type: NotificationType9, handler: NotificationHandler9): void;
onNotification(method: string, handler: GenericNotificationHandler): void;
onNotification(handler: StarNotificationHandler): void;
trace(value: Trace, tracer: Tracer, sendNotification?: boolean): void;
trace(value: Trace, tracer: Tracer, traceOptions?: TraceOptions): void;
onError: Event<[Error, Message | undefined, number | undefined]>;
onClose: Event;
onUnhandledNotification: Event;
listen(): void;
onDispose: Event;
dispose(): void;
inspect(): void;
}
export declare function createMessageConnection(reader: MessageReader, writer: MessageWriter, logger?: Logger, strategy?: ConnectionStrategy): MessageConnection;
export declare function createMessageConnection(inputStream: NodeJS.ReadableStream, outputStream: NodeJS.WritableStream, logger?: Logger, strategy?: ConnectionStrategy): MessageConnection;