vscode-jsonrpc
- Version 8.2.1
- Published
- 208 kB
- No dependencies
- MIT license
Install
npm i vscode-jsonrpc
yarn add vscode-jsonrpc
pnpm add vscode-jsonrpc
Overview
A json rpc implementation over streams
Index
Variables
Functions
Classes
Interfaces
Enums
Type Aliases
Namespaces
Variables
variable NullLogger
const NullLogger: Logger;
Functions
function createMessageConnection
createMessageConnection: ( messageReader: MessageReader, messageWriter: MessageWriter, _logger?: Logger, options?: ConnectionOptions) => MessageConnection;
function RAL
RAL: typeof RAL;
Classes
class AbstractMessageBuffer
abstract class AbstractMessageBuffer implements RAL.MessageBuffer {}
constructor
constructor(encoding?: _MessageBufferEncoding);
property encoding
readonly encoding: _MessageBufferEncoding;
property numberOfBytes
readonly numberOfBytes: number;
method allocNative
protected abstract allocNative: (length: number) => Uint8Array;
method append
append: (chunk: Uint8Array | string) => void;
method asNative
protected abstract asNative: (buffer: Uint8Array, length?: number) => Uint8Array;
method emptyBuffer
protected abstract emptyBuffer: () => Uint8Array;
method fromString
protected abstract fromString: ( value: string, encoding: RAL.MessageBufferEncoding) => Uint8Array;
method toString
protected abstract toString: ( value: Uint8Array, encoding: RAL.MessageBufferEncoding) => string;
method tryReadBody
tryReadBody: (length: number) => Uint8Array | undefined;
method tryReadHeaders
tryReadHeaders: (lowerCaseKeys?: boolean) => Map<string, string> | undefined;
class AbstractMessageReader
abstract class AbstractMessageReader implements MessageReader {}
constructor
constructor();
property onClose
readonly onClose: Event<void>;
property onError
readonly onError: Event<Error>;
property onPartialMessage
readonly onPartialMessage: Event<PartialMessageInfo>;
method dispose
dispose: () => void;
method fireClose
protected fireClose: () => void;
method fireError
protected fireError: (error: any) => void;
method firePartialMessage
protected firePartialMessage: (info: PartialMessageInfo) => void;
method listen
abstract listen: (callback: DataCallback) => Disposable;
class AbstractMessageWriter
abstract class AbstractMessageWriter {}
constructor
constructor();
property onClose
readonly onClose: Event<void>;
property onError
readonly onError: Event<[Error, Message, number]>;
method dispose
dispose: () => void;
method fireClose
protected fireClose: () => void;
method fireError
protected fireError: (error: any, message?: Message, count?: number) => void;
class CancellationTokenSource
class CancellationTokenSource implements AbstractCancellationTokenSource {}
class ConnectionError
class ConnectionError extends Error {}
constructor
constructor(code: ConnectionErrors, message: string);
property code
readonly code: ConnectionErrors;
class Emitter
class Emitter<T> {}
constructor
constructor(_options?: EmitterOptions);
property event
readonly event: Event<T>;
For the public to allow to subscribe to events from this Emitter
method dispose
dispose: () => void;
method fire
fire: (event: T) => any;
To be kept private to fire an event to subscribers
class LinkedMap
class LinkedMap<K, V> implements Map<K, V> {}
constructor
constructor();
property [Symbol.toStringTag]
readonly [Symbol.toStringTag]: string;
property first
readonly first: {};
property last
readonly last: {};
property size
readonly size: number;
method [Symbol.iterator]
[Symbol.iterator]: () => IterableIterator<[K, V]>;
method clear
clear: () => void;
method delete
delete: (key: K) => boolean;
method entries
entries: () => IterableIterator<[K, V]>;
method forEach
forEach: ( callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any) => void;
method fromJSON
fromJSON: (data: [K, V][]) => void;
method get
get: (key: K, touch?: Touch) => V | undefined;
method has
has: (key: K) => boolean;
method isEmpty
isEmpty: () => boolean;
method keys
keys: () => IterableIterator<K>;
method remove
remove: (key: K) => V | undefined;
method set
set: (key: K, value: V, touch?: Touch) => this;
method shift
shift: () => V | undefined;
method toJSON
toJSON: () => [K, V][];
method trimOld
protected trimOld: (newSize: number) => void;
method values
values: () => IterableIterator<V>;
class LRUCache
class LRUCache<K, V> extends LinkedMap<K, V> {}
class NotificationType
class NotificationType<P> extends AbstractMessageSignature {}
constructor
constructor(method: string, _parameterStructures?: ParameterStructures);
property parameterStructures
readonly parameterStructures: ParameterStructures;
class NotificationType0
class NotificationType0 extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType1
class NotificationType1<P1> extends AbstractMessageSignature {}
constructor
constructor(method: string, _parameterStructures?: ParameterStructures);
property parameterStructures
readonly parameterStructures: ParameterStructures;
class NotificationType2
class NotificationType2<P1, P2> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType3
class NotificationType3<P1, P2, P3> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType4
class NotificationType4<P1, P2, P3, P4> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType5
class NotificationType5<P1, P2, P3, P4, P5> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType6
class NotificationType6<P1, P2, P3, P4, P5, P6> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType7
class NotificationType7< P1, P2, P3, P4, P5, P6, P7> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType8
class NotificationType8< P1, P2, P3, P4, P5, P6, P7, P8> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class NotificationType9
class NotificationType9< P1, P2, P3, P4, P5, P6, P7, P8, P9> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class ParameterStructures
class ParameterStructures {}
property auto
static readonly auto: ParameterStructures;
The parameter structure is automatically inferred on the number of parameters and the parameter type in case of a single param.
property byName
static readonly byName: ParameterStructures;
Forces
byName
parameter structure. This is only useful when having a single parameter. The library will report errors if used with a different number of parameters.
property byPosition
static readonly byPosition: ParameterStructures;
Forces
byPosition
parameter structure. This is useful if you have a single parameter which has a literal type.
method is
static is: (value: any) => value is ParameterStructures;
method toString
toString: () => string;
class ProgressType
class ProgressType<PR> {}
constructor
constructor();
class ReadableStreamMessageReader
class ReadableStreamMessageReader extends AbstractMessageReader {}
constructor
constructor( readable: _ReadableStream, options?: _MessageBufferEncoding | MessageReaderOptions);
property partialMessageTimeout
partialMessageTimeout: number;
method listen
listen: (callback: DataCallback) => Disposable;
class RequestType
class RequestType<P, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string, _parameterStructures?: ParameterStructures);
property parameterStructures
readonly parameterStructures: ParameterStructures;
class RequestType0
class RequestType0<R, E> extends AbstractMessageSignature {}
Classes to type request response pairs
constructor
constructor(method: string);
class RequestType1
class RequestType1<P1, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string, _parameterStructures?: ParameterStructures);
property parameterStructures
readonly parameterStructures: ParameterStructures;
class RequestType2
class RequestType2<P1, P2, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType3
class RequestType3<P1, P2, P3, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType4
class RequestType4<P1, P2, P3, P4, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType5
class RequestType5<P1, P2, P3, P4, P5, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType6
class RequestType6<P1, P2, P3, P4, P5, P6, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType7
class RequestType7< P1, P2, P3, P4, P5, P6, P7, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType8
class RequestType8< P1, P2, P3, P4, P5, P6, P7, P8, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class RequestType9
class RequestType9< P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E> extends AbstractMessageSignature {}
constructor
constructor(method: string);
class ResponseError
class ResponseError<D = void> extends Error {}
An error object return in a response in case a request has failed.
constructor
constructor(code: number, message: string, data?: {});
property code
readonly code: number;
property data
readonly data: {};
method toJson
toJson: () => ResponseErrorLiteral<D>;
class SharedArrayReceiverStrategy
class SharedArrayReceiverStrategy implements RequestCancellationReceiverStrategy {}
property kind
readonly kind: string;
method createCancellationTokenSource
createCancellationTokenSource: ( request: RequestMessage) => AbstractCancellationTokenSource;
class SharedArraySenderStrategy
class SharedArraySenderStrategy implements CancellationSenderStrategy {}
constructor
constructor();
method cleanup
cleanup: (id: CancellationId) => void;
method dispose
dispose: () => void;
method enableCancellation
enableCancellation: (request: RequestMessage) => void;
method sendCancellation
sendCancellation: ( _conn: MessageConnection, id: CancellationId) => Promise<void>;
class WriteableStreamMessageWriter
class WriteableStreamMessageWriter extends AbstractMessageWriter implements MessageWriter {}
constructor
constructor( writable: _WritableStream, options?: _MessageBufferEncoding | MessageWriterOptions);
method end
end: () => void;
method write
write: (msg: Message) => Promise<void>;
Interfaces
interface AbstractCancellationTokenSource
interface AbstractCancellationTokenSource extends Disposable {}
interface CancellationSenderStrategy
interface CancellationSenderStrategy {}
method cleanup
cleanup: (id: CancellationId) => void;
Cleanup any cancellation state for the given cancellation id. After this method has been call no cancellation will be sent anymore for the given id.
Parameter id
The cancellation id.
method dispose
dispose: () => void;
An optional method to dispose the strategy.
method enableCancellation
enableCancellation: (request: RequestMessage) => void;
Hook to enable cancellation for the given request.
Parameter request
The request to enable cancellation for.
method sendCancellation
sendCancellation: (conn: MessageConnection, id: CancellationId) => Promise<void>;
Send cancellation for the given cancellation id
Parameter conn
The connection used.
Parameter id
The cancellation id.
interface CancellationStrategy
interface CancellationStrategy {}
interface CancellationToken
interface CancellationToken {}
Defines a CancellationToken. This interface is not intended to be implemented. A CancellationToken must be created via a CancellationTokenSource.
property isCancellationRequested
readonly isCancellationRequested: boolean;
Is
true
when the token has been cancelled,false
otherwise.
property onCancellationRequested
readonly onCancellationRequested: Event<any>;
An which fires upon cancellation.
interface ConnectionOptions
interface ConnectionOptions {}
property cancellationStrategy
cancellationStrategy?: CancellationStrategy;
property connectionStrategy
connectionStrategy?: ConnectionStrategy;
property messageStrategy
messageStrategy?: MessageStrategy;
interface ContentTypeDecoderOptions
interface ContentTypeDecoderOptions {}
property charset
charset: RAL.MessageBufferEncoding;
interface ContentTypeEncoderOptions
interface ContentTypeEncoderOptions {}
property charset
charset: RAL.MessageBufferEncoding;
interface DataCallback
interface DataCallback {}
A callback that receives each incoming JSON-RPC message.
call signature
(data: Message): void;
interface Disposable
interface Disposable {}
method dispose
dispose: () => void;
Dispose this object.
interface Event
interface Event<T> {}
Represents a typed event.
call signature
( listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
Parameter listener
The listener function will be called when the event happens.
Parameter thisArgs
The 'this' which will be used when calling the event listener.
Parameter disposables
An array to which a {{IDisposable}} will be added.
interface GenericNotificationHandler
interface GenericNotificationHandler {}
call signature
(...params: any[]): void;
interface GenericRequestHandler
interface GenericRequestHandler<R, E> {}
call signature
(...params: any[]): HandlerResult<R, E>;
interface Logger
interface Logger {}
interface LogTraceParams
interface LogTraceParams {}
interface MessageConnection
interface MessageConnection {}
property onClose
onClose: Event<void>;
property onDispose
onDispose: Event<void>;
property onError
onError: Event<[Error, Message | undefined, number | undefined]>;
property onUnhandledNotification
onUnhandledNotification: Event<NotificationMessage>;
property onUnhandledProgress
onUnhandledProgress: Event<ProgressParams<any>>;
method dispose
dispose: () => void;
method end
end: () => void;
method hasPendingResponse
hasPendingResponse: () => boolean;
method inspect
inspect: () => void;
method listen
listen: () => void;
method onNotification
onNotification: { (type: NotificationType0, handler: NotificationHandler0): Disposable; <P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable; <P1>( type: NotificationType1<P1>, handler: NotificationHandler1<P1> ): Disposable; <P1, P2>( type: NotificationType2<P1, P2>, handler: NotificationHandler2<P1, P2> ): Disposable; <P1, P2, P3>( type: NotificationType3<P1, P2, P3>, handler: NotificationHandler3<P1, P2, P3> ): Disposable; <P1, P2, P3, P4>( type: NotificationType4<P1, P2, P3, P4>, handler: NotificationHandler4<P1, P2, P3, P4> ): Disposable; <P1, P2, P3, P4, P5>( type: NotificationType5<P1, P2, P3, P4, P5>, handler: NotificationHandler5<P1, P2, P3, P4, P5> ): Disposable; <P1, P2, P3, P4, P5, P6>( type: NotificationType6<P1, P2, P3, P4, P5, P6>, handler: NotificationHandler6<P1, P2, P3, P4, P5, P6> ): Disposable; <P1, P2, P3, P4, P5, P6, P7>( type: NotificationType7<P1, P2, P3, P4, P5, P6, P7>, handler: NotificationHandler7<P1, P2, P3, P4, P5, P6, P7> ): Disposable; <P1, P2, P3, P4, P5, P6, P7, P8>( type: NotificationType8<P1, P2, P3, P4, P5, P6, P7, P8>, handler: NotificationHandler8<P1, P2, P3, P4, P5, P6, P7, P8> ): Disposable; <P1, P2, P3, P4, P5, P6, P7, P8, P9>( type: NotificationType9<P1, P2, P3, P4, P5, P6, P7, P8, P9>, handler: NotificationHandler9<P1, P2, P3, P4, P5, P6, P7, P8, P9> ): Disposable; (method: string, handler: GenericNotificationHandler): Disposable; (handler: StarNotificationHandler): Disposable;};
method onProgress
onProgress: <P>( type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>) => Disposable;
method onRequest
onRequest: { <R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable; <P, R, E>( type: RequestType<P, R, E>, handler: RequestHandler<P, R, E> ): Disposable; <P1, R, E>( type: RequestType1<P1, R, E>, handler: RequestHandler1<P1, R, E> ): Disposable; <P1, P2, R, E>( type: RequestType2<P1, P2, R, E>, handler: RequestHandler2<P1, P2, R, E> ): Disposable; <P1, P2, P3, R, E>( type: RequestType3<P1, P2, P3, R, E>, handler: RequestHandler3<P1, P2, P3, R, E> ): Disposable; <P1, P2, P3, P4, R, E>( type: RequestType4<P1, P2, P3, P4, R, E>, handler: RequestHandler4<P1, P2, P3, P4, R, E> ): Disposable; <P1, P2, P3, P4, P5, R, E>( type: RequestType5<P1, P2, P3, P4, P5, R, E>, handler: RequestHandler5<P1, P2, P3, P4, P5, R, E> ): Disposable; <P1, P2, P3, P4, P5, P6, R, E>( type: RequestType6<P1, P2, P3, P4, P5, P6, R, E>, handler: RequestHandler6<P1, P2, P3, P4, P5, P6, R, E> ): Disposable; <P1, P2, P3, P4, P5, P6, P7, R, E>( type: RequestType7<P1, P2, P3, P4, P5, P6, P7, R, E>, handler: RequestHandler7<P1, P2, P3, P4, P5, P6, P7, R, E> ): Disposable; <P1, P2, P3, P4, P5, P6, P7, P8, R, E>( type: RequestType8<P1, P2, P3, P4, P5, P6, P7, P8, R, E>, handler: RequestHandler8<P1, P2, P3, P4, P5, P6, P7, P8, R, E> ): Disposable; <P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E>( type: RequestType9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E>, handler: RequestHandler9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E> ): Disposable; <R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable; (handler: StarRequestHandler): Disposable;};
method sendNotification
sendNotification: { (type: NotificationType0): Promise<void>; <P>(type: NotificationType<P>, params?: P): Promise<void>; <P1>(type: NotificationType1<P1>, p1: P1): Promise<void>; <P1, P2>(type: NotificationType2<P1, P2>, p1: P1, p2: P2): Promise<void>; <P1, P2, P3>( type: NotificationType3<P1, P2, P3>, p1: P1, p2: P2, p3: P3 ): Promise<void>; <P1, P2, P3, P4>( type: NotificationType4<P1, P2, P3, P4>, p1: P1, p2: P2, p3: P3, p4: P4 ): Promise<void>; <P1, P2, P3, P4, P5>( type: NotificationType5<P1, P2, P3, P4, P5>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 ): Promise<void>; <P1, P2, P3, P4, P5, P6>( type: NotificationType6<P1, P2, P3, P4, P5, P6>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6 ): Promise<void>; <P1, P2, P3, P4, P5, P6, P7>( type: NotificationType7<P1, P2, P3, P4, P5, P6, P7>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7 ): Promise<void>; <P1, P2, P3, P4, P5, P6, P7, P8>( type: NotificationType8<P1, P2, P3, P4, P5, P6, P7, P8>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8 ): Promise<void>; <P1, P2, P3, P4, P5, P6, P7, P8, P9>( type: NotificationType9<P1, P2, P3, P4, P5, P6, P7, P8, P9>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9 ): Promise<void>; (method: string, r0?: any, ...rest: any[]): Promise<void>;};
method sendProgress
sendProgress: <P>( type: ProgressType<P>, token: string | number, value: P) => Promise<void>;
method sendRequest
sendRequest: { <R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>; <P, R, E>( type: RequestType<P, R, E>, params: P, token?: CancellationToken ): Promise<R>; <P1, R, E>( type: RequestType1<P1, R, E>, p1: P1, token?: CancellationToken ): Promise<R>; <P1, P2, R, E>( type: RequestType2<P1, P2, R, E>, p1: P1, p2: P2, token?: CancellationToken ): Promise<R>; <P1, P2, P3, R, E>( type: RequestType3<P1, P2, P3, R, E>, p1: P1, p2: P2, p3: P3, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, R, E>( type: RequestType4<P1, P2, P3, P4, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, P5, R, E>( type: RequestType5<P1, P2, P3, P4, P5, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, P5, P6, R, E>( type: RequestType6<P1, P2, P3, P4, P5, P6, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, P5, P6, P7, R, E>( type: RequestType7<P1, P2, P3, P4, P5, P6, P7, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, P5, P6, P7, P8, R, E>( type: RequestType8<P1, P2, P3, P4, P5, P6, P7, P8, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token?: CancellationToken ): Promise<R>; <P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E>( type: RequestType9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token?: CancellationToken ): Promise<R>; <R>(method: string, r0?: any, ...rest: any[]): Promise<R>;};
method trace
trace: { (value: Trace, tracer: Tracer, sendNotification?: boolean): Promise<void>; (value: Trace, tracer: Tracer, traceOptions?: TraceOptions): Promise<void>;};
interface MessageReader
interface MessageReader {}
Reads JSON-RPC messages from some underlying transport.
property onClose
readonly onClose: Event<void>;
An event raised when the end of the underlying transport has been reached.
property onError
readonly onError: Event<Error>;
Raised whenever an error occurs while reading a message.
property onPartialMessage
readonly onPartialMessage: Event<PartialMessageInfo>;
An event that *may* be raised to inform the owner that only part of a message has been received. A MessageReader implementation may choose to raise this event after a timeout elapses while waiting for more of a partially received message to be received.
method dispose
dispose: () => void;
Releases resources incurred from reading or raising events. Does NOT close the underlying transport, if any.
method listen
listen: (callback: DataCallback) => Disposable;
Begins listening for incoming messages. To be called at most once.
Parameter callback
A callback for receiving decoded messages.
interface MessageReaderOptions
interface MessageReaderOptions {}
property charset
charset?: RAL.MessageBufferEncoding;
property contentDecoder
contentDecoder?: ContentDecoder;
property contentDecoders
contentDecoders?: ContentDecoder[];
property contentTypeDecoder
contentTypeDecoder?: ContentTypeDecoder;
property contentTypeDecoders
contentTypeDecoders?: ContentTypeDecoder[];
interface MessageSignature
interface MessageSignature {}
An interface to type messages.
property method
readonly method: string;
property numberOfParams
readonly numberOfParams: number;
property parameterStructures
readonly parameterStructures: ParameterStructures;
interface MessageStrategy
interface MessageStrategy {}
method handleMessage
handleMessage: (message: Message, next: (message: Message) => void) => void;
interface MessageWriter
interface MessageWriter {}
Writes JSON-RPC messages to an underlying transport.
property onClose
readonly onClose: Event<void>;
An event raised when the underlying transport has closed and writing is no longer possible.
property onError
readonly onError: Event<[Error, Message | undefined, number | undefined]>;
Raised whenever an error occurs while writing a message.
method dispose
dispose: () => void;
Releases resources incurred from writing or raising events. Does NOT close the underlying transport, if any.
method end
end: () => void;
Call when the connection using this message writer ends (e.g. MessageConnection.end() is called)
method write
write: (msg: Message) => Promise<void>;
Sends a JSON-RPC message.
Parameter msg
The JSON-RPC message to be sent. Implementations should guarantee messages are transmitted in the same order that they are received by this method.
interface MessageWriterOptions
interface MessageWriterOptions {}
property charset
charset?: RAL.MessageBufferEncoding;
property contentEncoder
contentEncoder?: ContentEncoder;
property contentTypeEncoder
contentTypeEncoder?: ContentTypeEncoder;
interface NotificationHandler
interface NotificationHandler<P> {}
call signature
(params: P): void;
interface NotificationHandler0
interface NotificationHandler0 {}
call signature
(): void;
interface NotificationHandler1
interface NotificationHandler1<P1> {}
call signature
(p1: P1): void;
interface NotificationHandler2
interface NotificationHandler2<P1, P2> {}
call signature
(p1: P1, p2: P2): void;
interface NotificationHandler3
interface NotificationHandler3<P1, P2, P3> {}
call signature
(p1: P1, p2: P2, p3: P3): void;
interface NotificationHandler4
interface NotificationHandler4<P1, P2, P3, P4> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4): void;
interface NotificationHandler5
interface NotificationHandler5<P1, P2, P3, P4, P5> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void;
interface NotificationHandler6
interface NotificationHandler6<P1, P2, P3, P4, P5, P6> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void;
interface NotificationHandler7
interface NotificationHandler7<P1, P2, P3, P4, P5, P6, P7> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void;
interface NotificationHandler8
interface NotificationHandler8<P1, P2, P3, P4, P5, P6, P7, P8> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void;
interface NotificationHandler9
interface NotificationHandler9<P1, P2, P3, P4, P5, P6, P7, P8, P9> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void;
interface NotificationMessage
interface NotificationMessage extends Message {}
Notification Message
interface PartialMessageInfo
interface PartialMessageInfo {}
property messageToken
readonly messageToken: number;
property waitingTime
readonly waitingTime: number;
interface RAL
interface RAL {}
property applicationJson
readonly applicationJson: { readonly encoder: ContentTypeEncoder; readonly decoder: ContentTypeDecoder;};
property console
readonly console: { info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void;};
property messageBuffer
readonly messageBuffer: { create(encoding: RAL.MessageBufferEncoding): RAL.MessageBuffer;};
property timer
readonly timer: { setTimeout( callback: (...args: any[]) => void, ms: number, ...args: any[] ): Disposable; setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable; setInterval( callback: (...args: any[]) => void, ms: number, ...args: any[] ): Disposable;};
interface RequestHandler
interface RequestHandler<P, R, E> {}
call signature
(params: P, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler0
interface RequestHandler0<R, E> {}
call signature
(token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler1
interface RequestHandler1<P1, R, E> {}
call signature
(p1: P1, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler2
interface RequestHandler2<P1, P2, R, E> {}
call signature
(p1: P1, p2: P2, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler3
interface RequestHandler3<P1, P2, P3, R, E> {}
call signature
(p1: P1, p2: P2, p3: P3, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler4
interface RequestHandler4<P1, P2, P3, P4, R, E> {}
call signature
(p1: P1, p2: P2, p3: P3, p4: P4, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler5
interface RequestHandler5<P1, P2, P3, P4, P5, R, E> {}
call signature
( p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler6
interface RequestHandler6<P1, P2, P3, P4, P5, P6, R, E> {}
call signature
( p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler7
interface RequestHandler7<P1, P2, P3, P4, P5, P6, P7, R, E> {}
call signature
( p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler8
interface RequestHandler8<P1, P2, P3, P4, P5, P6, P7, P8, R, E> {}
call signature
( p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token: CancellationToken): HandlerResult<R, E>;
interface RequestHandler9
interface RequestHandler9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R, E> {}
call signature
( p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token: CancellationToken): HandlerResult<R, E>;
interface RequestMessage
interface RequestMessage extends Message {}
Request message
interface ResponseMessage
interface ResponseMessage extends Message {}
A response message.
property error
error?: ResponseErrorLiteral<any>;
The error object in case a request fails.
property id
id: number | string | null;
The request id.
property result
result?: string | number | boolean | object | any[] | null;
The result of a request. This member is REQUIRED on success. This member MUST NOT exist if there was an error invoking the method.
interface SetTraceParams
interface SetTraceParams {}
property value
value: TraceValues;
interface StarNotificationHandler
interface StarNotificationHandler {}
call signature
(method: string, params: any[] | object | undefined): void;
interface StarRequestHandler
interface StarRequestHandler {}
call signature
( method: string, params: any[] | object | undefined, token: CancellationToken): HandlerResult<any, any>;
interface TraceOptions
interface TraceOptions {}
property sendNotification
sendNotification?: boolean;
property traceFormat
traceFormat?: TraceFormat;
Enums
enum ConnectionErrors
enum ConnectionErrors { Closed = 1, Disposed = 2, AlreadyListening = 3,}
member AlreadyListening
AlreadyListening = 3
The connection is already in listening mode.
member Closed
Closed = 1
The connection is closed.
member Disposed
Disposed = 2
The connection got disposed.
enum Trace
enum Trace { Off = 0, Messages = 1, Compact = 2, Verbose = 3,}
enum TraceFormat
enum TraceFormat { Text = 'text', JSON = 'json',}
Type Aliases
type CancellationId
type CancellationId = number | string;
type CancellationReceiverStrategy
type CancellationReceiverStrategy = IdCancellationReceiverStrategy;
This will break with the next major version and will become export type CancellationReceiverStrategy = IdCancellationReceiverStrategy | RequestCancellationReceiverStrategy;
type ConnectionStrategy
type ConnectionStrategy = { cancelUndispatched?: ( message: Message, next: (message: Message) => ResponseMessage | undefined ) => ResponseMessage | undefined;};
type ContentDecoder
type ContentDecoder = | FunctionContentDecoder | (FunctionContentDecoder & StreamContentDecoder);
type ContentEncoder
type ContentEncoder = | FunctionContentEncoder | (FunctionContentEncoder & StreamContentEncoder);
type ContentTypeDecoder
type ContentTypeDecoder = | FunctionContentTypeDecoder | (FunctionContentTypeDecoder & StreamContentTypeDecoder);
type ContentTypeEncoder
type ContentTypeEncoder = | FunctionContentTypeEncoder | (FunctionContentTypeEncoder & StreamContentTypeEncoder);
type ErrorCodes
type ErrorCodes = integer;
type HandlerResult
type HandlerResult<R, E> = | R | ResponseError<E> | Thenable<R> | Thenable<ResponseError<E>> | Thenable<R | ResponseError<E>>;
type ProgressToken
type ProgressToken = number | string;
type Touch
type Touch = 0 | 1 | 2;
type TraceValues
type TraceValues = 'off' | 'messages' | 'compact' | 'verbose';
Namespaces
namespace CancellationReceiverStrategy
namespace CancellationReceiverStrategy {}
namespace CancellationSenderStrategy
namespace CancellationSenderStrategy {}
namespace CancellationStrategy
namespace CancellationStrategy {}
namespace CancellationToken
namespace CancellationToken {}
namespace ConnectionOptions
namespace ConnectionOptions {}
function is
is: (value: any) => value is ConnectionOptions;
namespace ConnectionStrategy
namespace ConnectionStrategy {}
function is
is: (value: any) => value is ConnectionStrategy;
namespace Disposable
namespace Disposable {}
function create
create: (func: () => void) => Disposable;
namespace ErrorCodes
namespace ErrorCodes {}
Predefined error codes.
variable ConnectionInactive
const ConnectionInactive: number;
The connection is inactive and a use of it failed.
variable InternalError
const InternalError: number;
variable InvalidParams
const InvalidParams: number;
variable InvalidRequest
const InvalidRequest: number;
variable jsonrpcReservedErrorRangeEnd
const jsonrpcReservedErrorRangeEnd: number;
This is the end range of JSON RPC reserved error codes. It doesn't denote a real error code.
3.16.0
variable jsonrpcReservedErrorRangeStart
const jsonrpcReservedErrorRangeStart: number;
This is the start range of JSON RPC reserved error codes. It doesn't denote a real error code. No application error codes should be defined between the start and end range. For backwards compatibility the
ServerNotInitialized
and theUnknownErrorCode
are left in the range.3.16.0
variable MessageReadError
const MessageReadError: number;
An error occurred when reading a message from the transport layer.
variable MessageWriteError
const MessageWriteError: number;
An error occurred when write a message to the transport layer.
variable MethodNotFound
const MethodNotFound: number;
variable ParseError
const ParseError: number;
variable PendingResponseRejected
const PendingResponseRejected: number;
The connection got disposed or lost and all pending responses got rejected.
variable serverErrorEnd
const serverErrorEnd: number;
Deprecated
use jsonrpcReservedErrorRangeEnd
variable serverErrorStart
const serverErrorStart: number;
Deprecated
use jsonrpcReservedErrorRangeStart
variable ServerNotInitialized
const ServerNotInitialized: number;
Error code indicating that a server received a notification or request before the server has received the
initialize
request.
variable UnknownErrorCode
const UnknownErrorCode: number;
namespace LogTraceNotification
namespace LogTraceNotification {}
variable type
const type: NotificationType<LogTraceParams>;
namespace Message
namespace Message {}
function isNotification
isNotification: (message: Message | undefined) => message is NotificationMessage;
Tests if the given message is a notification message
function isRequest
isRequest: (message: Message | undefined) => message is RequestMessage;
Tests if the given message is a request message
function isResponse
isResponse: (message: Message | undefined) => message is ResponseMessage;
Tests if the given message is a response message
namespace MessageReader
namespace MessageReader {}
function is
is: (value: any) => value is MessageReader;
namespace MessageStrategy
namespace MessageStrategy {}
function is
is: (value: any) => value is MessageStrategy;
namespace MessageWriter
namespace MessageWriter {}
function is
is: (value: any) => value is MessageWriter;
namespace ProgressToken
namespace ProgressToken {}
function is
is: (value: any) => value is string | number;
namespace RAL
namespace RAL {}
function install
install: (ral: RAL) => void;
type DuplexStream
type DuplexStream = _DuplexStream;
type MessageBuffer
type MessageBuffer = _MessageBuffer;
type MessageBufferEncoding
type MessageBufferEncoding = _MessageBufferEncoding;
type ReadableStream
type ReadableStream = _ReadableStream;
type WritableStream
type WritableStream = _WritableStream;
namespace SetTraceNotification
namespace SetTraceNotification {}
variable type
const type: NotificationType<SetTraceParams>;
namespace Touch
namespace Touch {}
namespace Trace
namespace Trace {}
function fromString
fromString: (value: string) => Trace;
function toString
toString: (value: Trace) => TraceValues;
namespace TraceFormat
namespace TraceFormat {}
function fromString
fromString: (value: string) => TraceFormat;
namespace TraceValues
namespace TraceValues {}
Package Files (13)
- lib/common/api.d.ts
- lib/common/cancellation.d.ts
- lib/common/connection.d.ts
- lib/common/disposable.d.ts
- lib/common/encoding.d.ts
- lib/common/events.d.ts
- lib/common/linkedMap.d.ts
- lib/common/messageBuffer.d.ts
- lib/common/messageReader.d.ts
- lib/common/messageWriter.d.ts
- lib/common/messages.d.ts
- lib/common/ral.d.ts
- lib/common/sharedArrayCancellation.d.ts
Dependencies (0)
No dependencies.
Dev Dependencies (2)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/vscode-jsonrpc
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/vscode-jsonrpc)
- HTML<a href="https://www.jsdocs.io/package/vscode-jsonrpc"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6822 ms. - Missing or incorrect documentation? Open an issue for this package.