@veltdev/types-dev 4.5.0-beta.156 → 4.5.0-beta.158

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.
@@ -9,6 +9,7 @@ export declare class Comment {
9
9
  * Auto generated.
10
10
  */
11
11
  commentId: number;
12
+ context?: any;
12
13
  /**
13
14
  * This determines the comment content type.
14
15
  *
@@ -0,0 +1,52 @@
1
+ export interface CrdtVersion {
2
+ versionId: string;
3
+ versionName?: string;
4
+ state: Uint8Array | number[];
5
+ timestamp: number;
6
+ }
7
+ export interface CrdtUpdateDataQuery {
8
+ id: string;
9
+ state: Uint8Array | number[];
10
+ }
11
+ export interface CrdtOnDataChangeQuery {
12
+ id: string;
13
+ callback: (data: any) => void;
14
+ }
15
+ export interface CrdtGetDataQuery {
16
+ id: string;
17
+ }
18
+ export interface CrdtOnStateChangeQuery {
19
+ id: string;
20
+ callback: (data: any) => void;
21
+ }
22
+ export interface CrdtUpdateStateQuery {
23
+ id: string;
24
+ state: Uint8Array | number[];
25
+ }
26
+ export interface CrdtRegisterSyncUserQuery {
27
+ id: string;
28
+ }
29
+ export interface CrdtSetPresenceQuery {
30
+ id: string;
31
+ }
32
+ export interface CrdtOnPresenceChangeQuery {
33
+ id: string;
34
+ callback: (data: any) => void;
35
+ }
36
+ export interface CrdtStoreVersionQuery {
37
+ id: string;
38
+ versionId: string;
39
+ versionName?: string;
40
+ state: Uint8Array | number[];
41
+ }
42
+ export interface CrdtGetVersionQuery {
43
+ id: string;
44
+ versionId: string;
45
+ }
46
+ export interface CrdtGetVersionsQuery {
47
+ id: string;
48
+ }
49
+ export interface CrdtDeleteVersionQuery {
50
+ id: string;
51
+ versionId: string;
52
+ }
@@ -1,11 +1,13 @@
1
1
  // @ts-nocheck
2
+ import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtStoreVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
3
+
2
4
  export declare class CrdtElement {
3
5
  /**
4
6
  * Update data for a specific CRDT document
5
7
  * @param id Document ID
6
8
  * @param state State data as Uint8Array or number array
7
9
  */
8
- updateData: ({ id, state }: { id: string, state: Uint8Array | number[] }) => Promise<any>;
10
+ updateData: (updateDataQuery: CrdtUpdateDataQuery) => Promise<any>;
9
11
 
10
12
  /**
11
13
  * Subscribe to data changes for a specific CRDT document
@@ -13,13 +15,13 @@ export declare class CrdtElement {
13
15
  * @param callback Callback function to handle data changes
14
16
  * @returns Unsubscribe function
15
17
  */
16
- onDataChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
18
+ onDataChange: (onDataChangeQuery: CrdtOnDataChangeQuery) => () => void;
17
19
 
18
20
  /**
19
21
  * Get data for a specific CRDT document
20
22
  * @param id Document ID
21
23
  */
22
- getData: ({ id }: { id: string }) => Promise<any>;
24
+ getData: (getDataQuery: CrdtGetDataQuery) => Promise<any>;
23
25
 
24
26
  /**
25
27
  * Subscribe to state changes for a specific CRDT document
@@ -27,26 +29,26 @@ export declare class CrdtElement {
27
29
  * @param callback Callback function to handle state changes
28
30
  * @returns Unsubscribe function
29
31
  */
30
- onStateChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
32
+ onStateChange: (onStateChangeQuery: CrdtOnStateChangeQuery) => () => void;
31
33
 
32
34
  /**
33
35
  * Update state for a specific CRDT document
34
36
  * @param id Document ID
35
37
  * @param state State data as Uint8Array or number array
36
38
  */
37
- updateState: ({ id, state }: { id: string, state: Uint8Array | number[] }) => Promise<any>;
39
+ updateState: (updateStateQuery: CrdtUpdateStateQuery) => Promise<any>;
38
40
 
39
41
  /**
40
42
  * Register a user for synchronization on a specific CRDT document
41
43
  * @param id Document ID
42
44
  */
43
- registerSyncUser: ({ id }: { id: string }) => Promise<void>;
45
+ registerSyncUser: (registerSyncUserQuery: CrdtRegisterSyncUserQuery) => Promise<void>;
44
46
 
45
47
  /**
46
48
  * Set presence for a specific CRDT document
47
49
  * @param id Document ID
48
50
  */
49
- setPresence: ({ id }: { id: string }) => Promise<void>;
51
+ setPresence: (setPresenceQuery: CrdtSetPresenceQuery) => Promise<void>;
50
52
 
51
53
  /**
52
54
  * Subscribe to presence changes for a specific CRDT document
@@ -54,7 +56,23 @@ export declare class CrdtElement {
54
56
  * @param callback Callback function to handle presence changes
55
57
  * @returns Unsubscribe function
56
58
  */
57
- onPresenceChange: ({ id, callback }: { id: string, callback: (data: any) => void }) => () => void;
59
+ onPresenceChange: (onPresenceChangeQuery: CrdtOnPresenceChangeQuery) => () => void;
60
+
61
+ /**
62
+ * Store a version of a specific CRDT document
63
+ * @param id Document ID
64
+ * @param versionId Version ID
65
+ * @param versionName Version name
66
+ * @param state State data as Uint8Array or number array
67
+ */
68
+ storeVersion: (storeVersionQuery: CrdtStoreVersionQuery) => Promise<any>;
69
+
70
+ /**
71
+ * Get a version of a specific CRDT document
72
+ * @param id Document ID
73
+ * @param versionId Version ID
74
+ */
75
+ getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
58
76
 
59
77
  constructor();
60
78
 
@@ -113,4 +131,26 @@ export declare class CrdtElement {
113
131
  * @returns Unsubscribe function
114
132
  */
115
133
  private _onPresenceChange;
134
+
135
+ /**
136
+ * Store a version of a specific CRDT document
137
+ * @param id Document ID
138
+ * @param versionId Version ID
139
+ * @param versionName Version name
140
+ * @param state State data as Uint8Array or number array
141
+ */
142
+ private _storeVersion;
143
+
144
+ /**
145
+ * Get a version of a specific CRDT document
146
+ * @param id Document ID
147
+ * @param versionId Version ID
148
+ */
149
+ private _getVersion;
150
+
151
+ /**
152
+ * Get all versions of a specific CRDT document
153
+ * @param id Document ID
154
+ */
155
+ private _getVersions;
116
156
  }
package/models.d.ts CHANGED
@@ -77,3 +77,4 @@ export * from './app/models/data/event-metadata.data.model';
77
77
  export * from './app/models/data/user-resolver.data.model';
78
78
  export * from './app/models/data/provider.data.model';
79
79
  export * from './app/models/data/resolver.data.model';
80
+ export * from './app/models/data/crdt.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/types-dev",
3
- "version": "4.5.0-beta.156",
3
+ "version": "4.5.0-beta.158",
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": [