@base44-preview/sdk 0.8.18-pr.70.4e2bede → 0.8.18-pr.70.cc6a283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Event types for realtime entity updates.
|
|
3
|
-
* @internal
|
|
4
3
|
*/
|
|
5
4
|
export type RealtimeEventType = "create" | "update" | "delete";
|
|
6
5
|
/**
|
|
7
6
|
* Payload received when a realtime event occurs.
|
|
8
|
-
* @internal
|
|
9
7
|
*/
|
|
10
8
|
export interface RealtimeEvent {
|
|
11
9
|
/** The type of change that occurred */
|
|
@@ -19,9 +17,12 @@ export interface RealtimeEvent {
|
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
19
|
* Callback function invoked when a realtime event occurs.
|
|
22
|
-
* @internal
|
|
23
20
|
*/
|
|
24
21
|
export type RealtimeCallback = (event: RealtimeEvent) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Function returned from subscribe, call it to unsubscribe.
|
|
24
|
+
*/
|
|
25
|
+
export type Subscription = () => void;
|
|
25
26
|
/**
|
|
26
27
|
* Entity handler providing CRUD operations for a specific entity type.
|
|
27
28
|
*
|
|
@@ -290,7 +291,6 @@ export interface EntityHandler {
|
|
|
290
291
|
* // Later, clean up the subscription
|
|
291
292
|
* unsubscribe();
|
|
292
293
|
* ```
|
|
293
|
-
* @internal
|
|
294
294
|
*/
|
|
295
295
|
subscribe(callback: RealtimeCallback): () => void;
|
|
296
296
|
}
|