@veltdev/types-dev 4.6.8-beta.3 → 4.6.9-beta.1

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.
@@ -10,6 +10,7 @@ export interface CrdtVersionWithEncryptedState extends Omit<CrdtVersion, 'state'
10
10
  export interface CrdtUpdateDataQuery {
11
11
  id: string;
12
12
  state: Uint8Array | number[];
13
+ data?: unknown;
13
14
  }
14
15
  export interface CrdtOnDataChangeQuery {
15
16
  id: string;
@@ -1,4 +1,4 @@
1
- import { AreaStatus, ArrowStatus, CommentStatus, HuddleActionTypes, NotificationSettingsItemType, NotificationSource, TagStatus, UserActionTypes } from "../../utils/enums";
1
+ import { AreaStatus, ArrowStatus, CommentStatus, CrdtActionTypes, HuddleActionTypes, NotificationSettingsItemType, NotificationSource, TagStatus, UserActionTypes } from "../../utils/enums";
2
2
  import { DocumentMetadata } from "./document-metadata.model";
3
3
  import { DocumentUser } from "./document-user.data.model";
4
4
  import { Location } from "./location.model";
@@ -23,7 +23,7 @@ export declare class NotificationRawData {
23
23
  /**
24
24
  * Type of notification like 'Added', 'Updated' etc.
25
25
  */
26
- actionType?: AreaStatus | ArrowStatus | CommentStatus | TagStatus | UserActionTypes | HuddleActionTypes;
26
+ actionType?: AreaStatus | ArrowStatus | CommentStatus | TagStatus | UserActionTypes | HuddleActionTypes | CrdtActionTypes;
27
27
  /**
28
28
  * Annotation object
29
29
  */
@@ -97,6 +97,7 @@ export declare class NotificationRawData {
97
97
  notifyUsers?: {
98
98
  [email: string]: boolean;
99
99
  };
100
+ crdtData?: unknown;
100
101
  notificationSourceData?: any;
101
102
  }
102
103
  export declare class Notification {
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
3
+ import { CrdtEventTypesMap } from "../data/crdt-events.data.model";
3
4
 
4
5
  export declare class CrdtElement {
5
6
  /**
@@ -79,6 +80,29 @@ export declare class CrdtElement {
79
80
  */
80
81
  getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
81
82
 
83
+ /**
84
+ * Enable webhook
85
+ */
86
+ enableWebhook: () => void;
87
+
88
+ /**
89
+ * Disable webhook
90
+ */
91
+ disableWebhook: () => void;
92
+
93
+ /**
94
+ * Set webhook debounce time
95
+ * @param time debounce time in milliseconds
96
+ */
97
+ setWebhookDebounceTime: (time: number) => void;
98
+
99
+ /**
100
+ * Subscribe to crdt actions
101
+ * @param action Action to subscribe to
102
+ * @returns Observable of the action
103
+ */
104
+ on: <T extends keyof CrdtEventTypesMap>(action: T) => Observable<CrdtEventTypesMap[T]>;
105
+
82
106
  constructor();
83
107
 
84
108
  /**
@@ -163,4 +187,27 @@ export declare class CrdtElement {
163
187
  * @param id Document ID
164
188
  */
165
189
  private _getVersions;
190
+
191
+ /**
192
+ * Enable webhook
193
+ */
194
+ private _enableWebhook;
195
+
196
+ /**
197
+ * Disable webhook
198
+ */
199
+ private _disableWebhook;
200
+
201
+ /**
202
+ * Set webhook debounce time
203
+ * @param time debounce time in milliseconds
204
+ */
205
+ private _setWebhookDebounceTime;
206
+
207
+ /**
208
+ * Subscribe to crdt actions
209
+ * @param action Action to subscribe to
210
+ * @returns Observable of the action
211
+ */
212
+ private _on;
166
213
  }
@@ -101,12 +101,16 @@ export declare const PresenceEventTypes: {
101
101
  export declare const NotificationEventTypes: {
102
102
  readonly SETTINGS_UPDATED: "settingsUpdated";
103
103
  };
104
+ export declare const CrdtEventTypes: {
105
+ readonly UPDATE_DATA: "updateData";
106
+ };
104
107
  export type CommentEventType = typeof CommentEventTypes[keyof typeof CommentEventTypes];
105
108
  export type RecorderEventType = typeof RecorderEventTypes[keyof typeof RecorderEventTypes];
106
109
  export type CoreEventType = typeof CoreEventTypes[keyof typeof CoreEventTypes];
107
110
  export type LiveStateSyncEventType = typeof LiveStateSyncEventTypes[keyof typeof LiveStateSyncEventTypes];
108
111
  export type PresenceEventType = typeof PresenceEventTypes[keyof typeof PresenceEventTypes];
109
112
  export type NotificationEventType = typeof NotificationEventTypes[keyof typeof NotificationEventTypes];
113
+ export type CrdtEventType = typeof CrdtEventTypes[keyof typeof CrdtEventTypes];
110
114
  export declare enum TagStatus {
111
115
  ADDED = "added",
112
116
  UPDATED = "updated",
@@ -122,6 +126,9 @@ export declare enum HuddleActionTypes {
122
126
  CREATED = "created",
123
127
  JOINED = "joined"
124
128
  }
129
+ export declare enum CrdtActionTypes {
130
+ UPDATE_DATA = "updateData"
131
+ }
125
132
  export declare enum RecorderStatus {
126
133
  ADDED = "added",
127
134
  UPDATED = "updated",
@@ -254,7 +261,7 @@ export type RecorderStatusType = 'started' | 'paused' | 'resumed' | 'stopped' |
254
261
  export type HuddleType = 'audio' | 'video' | 'presentation';
255
262
  export type NotificationTabId = 'for-you' | 'all' | 'document' | 'people';
256
263
  export type NotificationTabType = 'forYou' | 'all' | 'documents' | 'people';
257
- export type NotificationSource = 'area' | 'arrow' | 'comment' | 'tag' | 'huddle' | 'userInvite' | 'user' | 'recorder' | 'huddleInvite' | 'userFeedback' | 'userContactUs' | 'userReportBug' | 'documentViews' | 'custom';
264
+ export type NotificationSource = 'area' | 'arrow' | 'comment' | 'tag' | 'huddle' | 'userInvite' | 'user' | 'recorder' | 'huddleInvite' | 'userFeedback' | 'userContactUs' | 'userReportBug' | 'documentViews' | 'crdt' | 'custom';
258
265
  export type SingleEditorStatus = 'pending' | 'accepted' | 'rejected' | 'cancelled';
259
266
  export type SingleEditorState = 'idle' | 'inProgress' | 'completed';
260
267
  export type AudioWaveformVariant = 'expanded' | 'minified' | 'player' | 'preview' | 'preview-mini' | 'editor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/types-dev",
3
- "version": "4.6.8-beta.3",
3
+ "version": "4.6.9-beta.1",
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": [