Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Removed JsonAny from message signatures #4

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Removed JsonAny from message signatures #4

merged 1 commit into from
Jun 21, 2022

Conversation

spoenemann
Copy link
Member

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.

@spoenemann spoenemann requested a review from dhuebner June 16, 2022 14:06
Copy link
Member

@dhuebner dhuebner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@dhuebner dhuebner merged commit 7020741 into main Jun 21, 2022
@dhuebner dhuebner deleted the no-json-any branch June 21, 2022 06:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants