Skip to content

Commit

Permalink
Merge pull request #739 from ScreamZ/improve-typings
Browse files Browse the repository at this point in the history
Update Notification interface to match correct API
  • Loading branch information
rolljee authored Oct 16, 2024
2 parents 99ec86a + fbb6d69 commit 5272635
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/types/Notification.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JSONObject } from "./JSONObject";
import { KDocument, KDocumentContentGeneric } from ".";
import { KDocumentContentGeneric } from ".";

/**
* Enum for notification types
Expand Down Expand Up @@ -62,7 +62,21 @@ export interface DocumentNotification<
/**
* Updated document that triggered the notification
*/
result: KDocument<TDocContent>;
result: {
/**
* The message or full document content.
*/
_source: TDocContent;
/**
* Document unique ID.
* `null` if the notification is from a real-time message.
*/
_id: string | null;
/**
* List of fields that have been updated (only available on document partial updates).
*/
_updatedFields?: string[];
};
/**
* State of the document regarding the scope (`in` or `out`)
*/
Expand Down Expand Up @@ -95,7 +109,7 @@ export interface UserNotification extends BaseNotification {

export interface ServerNotification extends BaseNotification {
/**
* Server message explaining why this notifications has been triggered
* Server message explaining why this notifications has been triggered.
*/
message: string;

Expand Down

0 comments on commit 5272635

Please sign in to comment.