TypeFox / vscode-messenger

RPC messaging library for the VS Code extension platform
MIT License
33 stars 3 forks source link

Removed JsonAny from message signatures #4

Closed spoenemann closed 2 years ago

spoenemann commented 2 years ago

With the published version 0.2.0, I get an error with the following code:

export interface SprottyDiagramIdentifier {
    clientId: string,
    diagramType: string,
    uri: string
}

export const DiagramIdentifierNotification: NotificationType<SprottyDiagramIdentifier> = { method: 'SprottyDiagramIdentifier' };

Error:

Type 'SprottyDiagramIdentifier' does not satisfy the constraint 'JsonAny'.
  Type 'SprottyDiagramIdentifier' is not assignable to type 'JsonMap'.
    Index signature for type 'string' is missing in type 'SprottyDiagramIdentifier'. ts(2344)

This change should fix that. The motivation behind JsonAny was to enforce the objects to be JSON-serializeable, but obviously this not easily possible.