@veltdev/sdk-staging 4.5.0-beta.51 → 4.5.0-beta.52
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.
|
@@ -24,6 +24,7 @@ import { FeatureType } from "../utils/enums";
|
|
|
24
24
|
import { UserContact } from "../models/data/user-contact.data.model";
|
|
25
25
|
import { DocumentMetadata } from "../models/data/document-metadata.model";
|
|
26
26
|
import { ReactionElement } from "../models/element/reaction-element.model";
|
|
27
|
+
import { CrdtElement } from "../models/element/crdt-element.model";
|
|
27
28
|
import { VeltEventMetadata } from "../models/data/event-metadata.data.model";
|
|
28
29
|
import { CoreEventTypesMap } from "../models/data/core-events.data.model";
|
|
29
30
|
import { Document, SetDocumentsRequestOptions, FetchDocumentsRequest, FetchFoldersRequest, UpdateDocumentsRequest, UpdateLocationsRequest } from "../models/data/document.data.model";
|
|
@@ -225,6 +226,10 @@ export declare class Snippyly {
|
|
|
225
226
|
* Get the Area Object.
|
|
226
227
|
*/
|
|
227
228
|
getReactionElement: () => ReactionElement;
|
|
229
|
+
/**
|
|
230
|
+
* Get the CRDT Element Object.
|
|
231
|
+
*/
|
|
232
|
+
getCrdtElement: () => CrdtElement;
|
|
228
233
|
/**
|
|
229
234
|
* Get the metadata of the current resource.
|
|
230
235
|
*/
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export declare class CrdtElement {
|
|
3
|
+
/**
|
|
4
|
+
* Update data for a specific CRDT document
|
|
5
|
+
* @param id Document ID
|
|
6
|
+
* @param state State data as Uint8Array or number array
|
|
7
|
+
*/
|
|
8
|
+
updateData: ({ id, state }: { id: string, state: Uint8Array | number[] }) => Promise<any>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to data changes for a specific CRDT document
|
|
12
|
+
* @param id Document ID
|
|
13
|
+
* @param callback Callback function to handle data changes
|
|
14
|
+
* @returns Unsubscribe function
|
|
15
|
+
*/
|
|
16
|
+
onDataChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get data for a specific CRDT document
|
|
20
|
+
* @param id Document ID
|
|
21
|
+
*/
|
|
22
|
+
getData: ({ id }: { id: string }) => Promise<any>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to state changes for a specific CRDT document
|
|
26
|
+
* @param id Document ID
|
|
27
|
+
* @param callback Callback function to handle state changes
|
|
28
|
+
* @returns Unsubscribe function
|
|
29
|
+
*/
|
|
30
|
+
onStateChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Update state for a specific CRDT document
|
|
34
|
+
* @param id Document ID
|
|
35
|
+
* @param state State data as Uint8Array or number array
|
|
36
|
+
*/
|
|
37
|
+
updateState: ({ id, state }: { id: string, state: Uint8Array | number[] }) => Promise<any>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Register a user for synchronization on a specific CRDT document
|
|
41
|
+
* @param id Document ID
|
|
42
|
+
*/
|
|
43
|
+
registerSyncUser: ({ id }: { id: string }) => Promise<void>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set presence for a specific CRDT document
|
|
47
|
+
* @param id Document ID
|
|
48
|
+
*/
|
|
49
|
+
setPresence: ({ id }: { id: string }) => Promise<void>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Subscribe to presence changes for a specific CRDT document
|
|
53
|
+
* @param id Document ID
|
|
54
|
+
* @param callback Callback function to handle presence changes
|
|
55
|
+
* @returns Unsubscribe function
|
|
56
|
+
*/
|
|
57
|
+
onPresenceChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
|
|
58
|
+
|
|
59
|
+
constructor();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Update data for a specific CRDT document
|
|
63
|
+
* @param id Document ID
|
|
64
|
+
* @param state State data as Uint8Array or number array
|
|
65
|
+
*/
|
|
66
|
+
private _updateData;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Subscribe to data changes for a specific CRDT document
|
|
70
|
+
* @param id Document ID
|
|
71
|
+
* @param callback Callback function to handle data changes
|
|
72
|
+
* @returns Unsubscribe function
|
|
73
|
+
*/
|
|
74
|
+
private _onDataChange;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get data for a specific CRDT document
|
|
78
|
+
* @param id Document ID
|
|
79
|
+
*/
|
|
80
|
+
private _getData;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Subscribe to state changes for a specific CRDT document
|
|
84
|
+
* @param id Document ID
|
|
85
|
+
* @param callback Callback function to handle state changes
|
|
86
|
+
* @returns Unsubscribe function
|
|
87
|
+
*/
|
|
88
|
+
private _onStateChange;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Update state for a specific CRDT document
|
|
92
|
+
* @param id Document ID
|
|
93
|
+
* @param state State data as Uint8Array or number array
|
|
94
|
+
*/
|
|
95
|
+
private _updateState;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Register a user for synchronization on a specific CRDT document
|
|
99
|
+
* @param id Document ID
|
|
100
|
+
*/
|
|
101
|
+
private _registerSyncUser;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Set presence for a specific CRDT document
|
|
105
|
+
* @param id Document ID
|
|
106
|
+
*/
|
|
107
|
+
private _setPresence;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Subscribe to presence changes for a specific CRDT document
|
|
111
|
+
* @param id Document ID
|
|
112
|
+
* @param callback Callback function to handle presence changes
|
|
113
|
+
* @returns Unsubscribe function
|
|
114
|
+
*/
|
|
115
|
+
private _onPresenceChange;
|
|
116
|
+
}
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export declare class Constants {
|
|
|
45
45
|
static FIREBASE_PARTIAL_PATH_LIVE_STATE: string;
|
|
46
46
|
static FIREBASE_PARTIAL_PATH_IAM: string;
|
|
47
47
|
static FIREBASE_PARTIAL_PATH_REACTION: string;
|
|
48
|
+
static FIREBASE_PARTIAL_PATH_CRDT: string;
|
|
48
49
|
static FIREBASE_PARTIAL_PATH_VIEWS: string;
|
|
49
50
|
static FIREBASE_PARTIAL_PATH_COMMENT_VIEWS: string;
|
|
50
51
|
static FIREBASE_PARTIAL_PATH_NOTIFICATION_VIEWS: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk-staging",
|
|
3
|
-
"version": "4.5.0-beta.
|
|
3
|
+
"version": "4.5.0-beta.52",
|
|
4
4
|
"description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
|
|
5
5
|
"homepage": "https://velt.dev",
|
|
6
6
|
"keywords": [
|
package/types.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export * from './app/models/element/views-element.model';
|
|
|
16
16
|
export * from './app/models/element/notification-element.model';
|
|
17
17
|
export * from './app/models/element/autocomplete-element.model';
|
|
18
18
|
export * from './app/models/element/reaction-element.model';
|
|
19
|
+
export * from './app/models/element/crdt-element.model';
|
|
19
20
|
export * from './models';
|