@veltdev/sdk 4.5.0-beta.56 → 4.5.0-beta.58
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.
|
@@ -0,0 +1,56 @@
|
|
|
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 CrdtOnRegisteredUserChangeQuery {
|
|
30
|
+
id: string;
|
|
31
|
+
callback: (data: any) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface CrdtSetPresenceQuery {
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CrdtOnPresenceChangeQuery {
|
|
37
|
+
id: string;
|
|
38
|
+
callback: (data: any) => void;
|
|
39
|
+
}
|
|
40
|
+
export interface CrdtStoreVersionQuery {
|
|
41
|
+
id: string;
|
|
42
|
+
versionId: string;
|
|
43
|
+
versionName?: string;
|
|
44
|
+
state: Uint8Array | number[];
|
|
45
|
+
}
|
|
46
|
+
export interface CrdtGetVersionQuery {
|
|
47
|
+
id: string;
|
|
48
|
+
versionId: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CrdtGetVersionsQuery {
|
|
51
|
+
id: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CrdtDeleteVersionQuery {
|
|
54
|
+
id: string;
|
|
55
|
+
versionId: string;
|
|
56
|
+
}
|
|
@@ -8,6 +8,19 @@ export interface RecordingDeleteEvent extends RecorderData {
|
|
|
8
8
|
}
|
|
9
9
|
export interface RecordingEditDoneEvent extends RecorderData {
|
|
10
10
|
}
|
|
11
|
+
export interface RecordingActionsEvent {
|
|
12
|
+
type: 'audio' | 'video' | 'screen';
|
|
13
|
+
}
|
|
14
|
+
export interface RecordingStartedEvent extends RecordingActionsEvent {
|
|
15
|
+
}
|
|
16
|
+
export interface RecordingPausedEvent extends RecordingActionsEvent {
|
|
17
|
+
}
|
|
18
|
+
export interface RecordingCancelledEvent extends RecordingActionsEvent {
|
|
19
|
+
}
|
|
20
|
+
export interface RecordingStoppedEvent extends RecordingActionsEvent {
|
|
21
|
+
}
|
|
22
|
+
export interface RecordingResumedEvent extends RecordingActionsEvent {
|
|
23
|
+
}
|
|
11
24
|
export interface RecordingErrorEvent {
|
|
12
25
|
type: string;
|
|
13
26
|
message: string;
|
|
@@ -23,4 +36,9 @@ export type RecorderEventTypesMap = {
|
|
|
23
36
|
[RecorderEventTypes.RECORDING_DONE]: RecordingDoneEvent;
|
|
24
37
|
[RecorderEventTypes.RECORDING_EDIT_DONE]: RecordingEditDoneEvent;
|
|
25
38
|
[RecorderEventTypes.DELETE_RECORDING]: RecordingDeleteEvent;
|
|
39
|
+
[RecorderEventTypes.RECORDING_STARTED]: RecordingStartedEvent;
|
|
40
|
+
[RecorderEventTypes.RECORDING_PAUSED]: RecordingPausedEvent;
|
|
41
|
+
[RecorderEventTypes.RECORDING_CANCELLED]: RecordingCancelledEvent;
|
|
42
|
+
[RecorderEventTypes.RECORDING_STOPPED]: RecordingStoppedEvent;
|
|
43
|
+
[RecorderEventTypes.RECORDING_RESUMED]: RecordingResumedEvent;
|
|
26
44
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, 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: (
|
|
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: (
|
|
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: (
|
|
24
|
+
getData: (getDataQuery: CrdtGetDataQuery) => Promise<any>;
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Subscribe to state changes for a specific CRDT document
|
|
@@ -27,26 +29,31 @@ export declare class CrdtElement {
|
|
|
27
29
|
* @param callback Callback function to handle state changes
|
|
28
30
|
* @returns Unsubscribe function
|
|
29
31
|
*/
|
|
30
|
-
onStateChange: (
|
|
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: (
|
|
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: (
|
|
45
|
+
registerSyncUser: (registerSyncUserQuery: CrdtRegisterSyncUserQuery) => Promise<void>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Subscribe to registered user changes for a specific CRDT document
|
|
49
|
+
*/
|
|
50
|
+
onRegisteredUserChange: (onRegisteredUserChangeQuery: CrdtOnRegisteredUserChangeQuery) => () => void;
|
|
44
51
|
|
|
45
52
|
/**
|
|
46
53
|
* Set presence for a specific CRDT document
|
|
47
54
|
* @param id Document ID
|
|
48
55
|
*/
|
|
49
|
-
setPresence: (
|
|
56
|
+
setPresence: (setPresenceQuery: CrdtSetPresenceQuery) => Promise<void>;
|
|
50
57
|
|
|
51
58
|
/**
|
|
52
59
|
* Subscribe to presence changes for a specific CRDT document
|
|
@@ -54,7 +61,23 @@ export declare class CrdtElement {
|
|
|
54
61
|
* @param callback Callback function to handle presence changes
|
|
55
62
|
* @returns Unsubscribe function
|
|
56
63
|
*/
|
|
57
|
-
onPresenceChange: (
|
|
64
|
+
onPresenceChange: (onPresenceChangeQuery: CrdtOnPresenceChangeQuery) => () => void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Store a version of a specific CRDT document
|
|
68
|
+
* @param id Document ID
|
|
69
|
+
* @param versionId Version ID
|
|
70
|
+
* @param versionName Version name
|
|
71
|
+
* @param state State data as Uint8Array or number array
|
|
72
|
+
*/
|
|
73
|
+
storeVersion: (storeVersionQuery: CrdtStoreVersionQuery) => Promise<any>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get a version of a specific CRDT document
|
|
77
|
+
* @param id Document ID
|
|
78
|
+
* @param versionId Version ID
|
|
79
|
+
*/
|
|
80
|
+
getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
|
|
58
81
|
|
|
59
82
|
constructor();
|
|
60
83
|
|
|
@@ -100,6 +123,11 @@ export declare class CrdtElement {
|
|
|
100
123
|
*/
|
|
101
124
|
private _registerSyncUser;
|
|
102
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Subscribe to registered user changes for a specific CRDT document
|
|
128
|
+
*/
|
|
129
|
+
private _onRegisteredUserChange;
|
|
130
|
+
|
|
103
131
|
/**
|
|
104
132
|
* Set presence for a specific CRDT document
|
|
105
133
|
* @param id Document ID
|
|
@@ -113,4 +141,26 @@ export declare class CrdtElement {
|
|
|
113
141
|
* @returns Unsubscribe function
|
|
114
142
|
*/
|
|
115
143
|
private _onPresenceChange;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Store a version of a specific CRDT document
|
|
147
|
+
* @param id Document ID
|
|
148
|
+
* @param versionId Version ID
|
|
149
|
+
* @param versionName Version name
|
|
150
|
+
* @param state State data as Uint8Array or number array
|
|
151
|
+
*/
|
|
152
|
+
private _storeVersion;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Get a version of a specific CRDT document
|
|
156
|
+
* @param id Document ID
|
|
157
|
+
* @param versionId Version ID
|
|
158
|
+
*/
|
|
159
|
+
private _getVersion;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get all versions of a specific CRDT document
|
|
163
|
+
* @param id Document ID
|
|
164
|
+
*/
|
|
165
|
+
private _getVersions;
|
|
116
166
|
}
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -62,6 +62,11 @@ export declare const RecorderEventTypes: {
|
|
|
62
62
|
readonly DELETE_RECORDING: "deleteRecording";
|
|
63
63
|
readonly ERROR: "error";
|
|
64
64
|
readonly RECORDING_SAVE_INITIATED: "recordingSaveInitiated";
|
|
65
|
+
readonly RECORDING_STARTED: "recordingStarted";
|
|
66
|
+
readonly RECORDING_PAUSED: "recordingPaused";
|
|
67
|
+
readonly RECORDING_RESUMED: "recordingResumed";
|
|
68
|
+
readonly RECORDING_CANCELLED: "recordingCancelled";
|
|
69
|
+
readonly RECORDING_STOPPED: "recordingStopped";
|
|
65
70
|
};
|
|
66
71
|
export declare const CoreEventTypes: {
|
|
67
72
|
readonly VELT_BUTTON_CLICK: "veltButtonClick";
|
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/sdk",
|
|
3
|
-
"version": "4.5.0-beta.
|
|
3
|
+
"version": "4.5.0-beta.58",
|
|
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": [
|