@veltdev/sdk 1.0.157 → 1.0.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.
@@ -62,3 +62,6 @@ export declare class EditorAccessTimer {
62
62
  */
63
63
  durationLeft?: number;
64
64
  }
65
+ export declare class LiveStateDataConfig {
66
+ listenToNewChangesOnly?: boolean;
67
+ }
@@ -1,6 +1,7 @@
1
1
  // @ts-nocheck
2
- import { SingleEditorConfig, UserEditorAccess, EditorAccessTimer } from '../data/live-state-data.data.model';
2
+ import { SingleEditorConfig, UserEditorAccess, EditorAccessTimer, LiveStateDataConfig, LiveStateDataConfig } from '../data/live-state-data.data.model';
3
3
  import { User } from '../data/user.data.model';
4
+ import { ServerConnectionState } from '../../utils/enums';
4
5
 
5
6
  /**
6
7
  * Represents the synchronization element for live state.
@@ -10,13 +11,13 @@ export declare class LiveStateSyncElement {
10
11
  /**
11
12
  * Gets live state data based on the provided ID.
12
13
  */
13
- getLiveStateData: (liveStateDataId?: string, listenToNewChangesOnly?: boolean) => Observable<any>;
14
+ getLiveStateData: (liveStateDataId?: string, liveStateDataConfig?: LiveStateDataConfig) => Observable<any>;
14
15
 
15
16
  /**
16
17
  * Gets live state data as an observable based on the provided ID.
17
18
  * @deprecated Use `getLiveStateData` instead
18
19
  */
19
- getLiveStateData$: (liveStateDataId?: string, listenToNewChangesOnly?: boolean) => Observable<any>;
20
+ getLiveStateData$: (liveStateDataId?: string, liveStateDataConfig?: LiveStateDataConfig) => Observable<any>;
20
21
 
21
22
  /**
22
23
  * Sets live state data for the provided ID and data.
@@ -134,6 +135,12 @@ export declare class LiveStateSyncElement {
134
135
  */
135
136
  getEditorAccessTimer: () => Observable<EditorAccessTimer>;
136
137
 
138
+ /**
139
+ * To get server connection state
140
+ * @returns Observable<ServerConnectionState>
141
+ */
142
+ onServerConnectionStateChange: () => Observable<ServerConnectionState>;
143
+
137
144
  /**
138
145
  * Constructor for LiveStateSyncElement.
139
146
  */
@@ -266,4 +273,9 @@ export declare class LiveStateSyncElement {
266
273
  * To get editor access timer
267
274
  */
268
275
  private _getEditorAccessTimer;
276
+
277
+ /**
278
+ * To get server connection state
279
+ */
280
+ private _onServerConnectionStateChange;
269
281
  }
@@ -215,6 +215,7 @@ export declare class Constants {
215
215
  VELT_SHADOW_DOM_INTERNAL: string;
216
216
  };
217
217
  static ATTRIBUTES: {
218
+ DATA_ID: string;
218
219
  VELT_ID: string;
219
220
  VELT_ELEMENT: string;
220
221
  VELT_ANNOTATION_ID: string;
@@ -102,3 +102,9 @@ export declare enum UnreadIndicatorMode {
102
102
  MINIMAL = "minimal",
103
103
  VERBOSE = "verbose"
104
104
  }
105
+ export declare enum ServerConnectionState {
106
+ ONLINE = "online",
107
+ OFFLINE = "offline",
108
+ PENDING_INIT = "pendingInit",
109
+ PENDING_DATA = "pendingData"
110
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk",
3
- "version": "1.0.157",
3
+ "version": "1.0.158",
4
4
  "description": "",
5
5
  "main": "velt.js",
6
6
  "scripts": {