@atlaskit/collab-provider 9.6.4 → 9.7.0

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.
@@ -45,24 +45,48 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
45
45
  * @param data - Event data to emit to subscribers
46
46
  */
47
47
  _defineProperty(_assertThisInitialized(_this), "emitCallback", function (evt, data) {
48
- // When the provider is initialized early, we want the editor state promise to resolve before emitting events
48
+ // When the provider is initialized early, we want to ensure the editor state exists after setup is called before emitting events
49
49
  // to ensure that it is ready to listen to the events fired by NCS
50
50
  if (_this.isPreinitializing) {
51
- _this.getStatePromise.then(function () {
51
+ _this.onSetupPromise.then(function () {
52
52
  return _this.emit(evt, data);
53
53
  });
54
54
  } else {
55
55
  _this.emit(evt, data);
56
56
  }
57
57
  });
58
+ /**
59
+ * Wrapper to update document and metadata.
60
+ * Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
61
+ * Passing the document, metadata, version (either from the initial draft or from collab service)
62
+ */
63
+ _defineProperty(_assertThisInitialized(_this), "updateDocumentAndMetadata", function (_ref) {
64
+ var doc = _ref.doc,
65
+ version = _ref.version,
66
+ metadata = _ref.metadata;
67
+ try {
68
+ _this.documentService.updateDocument({
69
+ doc: doc,
70
+ version: version,
71
+ metadata: metadata
72
+ });
73
+ _this.metadataService.updateMetadata(metadata);
74
+ _this.isProviderInitialized = true;
75
+ } catch (e) {
76
+ var _this$analyticsHelper;
77
+ (_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 ? void 0 : _this$analyticsHelper.sendErrorEvent(e, 'Failed to update with the init document, destroying provider');
78
+ // Stop events and connections to step us trying to talk to the backend with an invalid state.
79
+ _this.destroy();
80
+ }
81
+ });
58
82
  _defineProperty(_assertThisInitialized(_this), "initializeChannel", function () {
59
83
  _this.emit('connecting', {
60
84
  initial: true
61
85
  });
62
86
  var shouldInitialize = Boolean(_this.initialDraft) && !_this.isProviderInitialized;
63
- _this.channel.on('connected', function (_ref) {
64
- var sid = _ref.sid,
65
- initialized = _ref.initialized;
87
+ _this.channel.on('connected', function (_ref2) {
88
+ var sid = _ref2.sid,
89
+ initialized = _ref2.initialized;
66
90
  _this.sessionId = sid;
67
91
  _this.emitCallback('connected', {
68
92
  sid: sid,
@@ -81,22 +105,24 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
81
105
  document = _this$initialDraft.document,
82
106
  version = _this$initialDraft.version,
83
107
  metadata = _this$initialDraft.metadata;
84
- try {
85
- // Initial document, version, metadata from initial draft
86
- _this.documentService.updateDocument({
108
+ if (_this.isPreinitializing) {
109
+ // When the provider is initialized early, we wait until setup is called with a defined getState before the document is updated to ensure that the editor state exists
110
+ // The `isPreinitializing` check is an extra precaution behind a FF - if the state is already resolved, onSetupPromise will resolve immediately
111
+ _this.onSetupPromise.then(function () {
112
+ _this.updateDocumentAndMetadata({
113
+ doc: document,
114
+ version: version,
115
+ metadata: metadata
116
+ });
117
+ });
118
+ } else {
119
+ _this.updateDocumentAndMetadata({
87
120
  doc: document,
88
121
  version: version,
89
122
  metadata: metadata
90
123
  });
91
- } catch (e) {
92
- var _this$analyticsHelper;
93
- (_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 ? void 0 : _this$analyticsHelper.sendErrorEvent(e, 'Failed to update the document on reconnect, destroying provider');
94
- // Stop events and connections to step us trying to talk to the backend with an invalid state.
95
- _this.destroy();
96
124
  }
97
- _this.metadataService.updateMetadata(metadata);
98
125
  }
99
- _this.isProviderInitialized = true;
100
126
  }
101
127
  // If already initialized, `connected` means reconnected
102
128
  if (initialized && _this.disconnectedAt &&
@@ -106,25 +132,16 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
106
132
  }
107
133
  _this.participantsService.startInactiveRemover(_this.sessionId);
108
134
  _this.disconnectedAt = undefined;
109
- }).on('init', function (_ref2) {
110
- var doc = _ref2.doc,
111
- version = _ref2.version,
112
- metadata = _ref2.metadata;
135
+ }).on('init', function (_ref3) {
136
+ var doc = _ref3.doc,
137
+ version = _ref3.version,
138
+ metadata = _ref3.metadata;
113
139
  // Initial document and version
114
- try {
115
- _this.documentService.updateDocument({
116
- doc: doc,
117
- version: version,
118
- metadata: metadata
119
- });
120
- _this.metadataService.updateMetadata(metadata);
121
- _this.isProviderInitialized = true;
122
- } catch (e) {
123
- var _this$analyticsHelper2;
124
- (_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendErrorEvent(e, 'Failed to update with the init document, destroying provider');
125
- // Stop events and connections to step us trying to talk to the backend with an invalid state.
126
- _this.destroy();
127
- }
140
+ _this.updateDocumentAndMetadata({
141
+ doc: doc,
142
+ version: version,
143
+ metadata: metadata
144
+ });
128
145
  }).on('restore', _this.documentService.onRestore).on('steps:added', _this.documentService.onStepsAdded).on('metadata:changed', _this.metadataService.onMetadataChanged).on('participant:telepointer', function (payload) {
129
146
  return _this.participantsService.onParticipantTelepointer(payload, _this.sessionId);
130
147
  }).on('presence:joined', _this.participantsService.onPresenceJoined).on('presence', _this.participantsService.onPresence).on('participant:left', _this.participantsService.onParticipantLeft).on('participant:updated', _this.participantsService.onParticipantUpdated).on('disconnect', _this.onDisconnected.bind(_assertThisInitialized(_this))).on('error', _this.onErrorHandled).on('status', _this.namespaceService.onNamespaceStatusChanged).connect(shouldInitialize);
@@ -150,20 +167,20 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
150
167
  if (((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) === NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED || ((_error$data2 = error.data) === null || _error$data2 === void 0 ? void 0 : _error$data2.code) === NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS) {
151
168
  _this.documentService.onStepRejectedError();
152
169
  } else {
153
- var _this$analyticsHelper3;
154
- (_this$analyticsHelper3 = _this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(error, 'Error handled');
170
+ var _this$analyticsHelper2;
171
+ (_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendErrorEvent(error, 'Error handled');
155
172
  var mappedError = errorCodeMapper(error);
156
173
  // Temporarily only emit errors to Confluence very intentionally because they will disconnect the collab provider
157
174
  if (mappedError) {
158
- var _this$analyticsHelper4;
159
- (_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(mappedError, 'Error emitted');
175
+ var _this$analyticsHelper3;
176
+ (_this$analyticsHelper3 = _this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(mappedError, 'Error emitted');
160
177
  _this.emitCallback('error', mappedError);
161
178
  }
162
179
  }
163
180
  });
164
181
  // Note: this gets triggered on page reload for Firefox (not other browsers) because of closeOnBeforeunload: false
165
- _defineProperty(_assertThisInitialized(_this), "onDisconnected", function (_ref3) {
166
- var reason = _ref3.reason;
182
+ _defineProperty(_assertThisInitialized(_this), "onDisconnected", function (_ref4) {
183
+ var reason = _ref4.reason;
167
184
  _this.disconnectedAt = Date.now();
168
185
  _this.participantsService.disconnect(reason, _this.sessionId);
169
186
  });
@@ -179,7 +196,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
179
196
  * @throws {GetCurrentStateError} Something went wrong while returning the current state
180
197
  */
181
198
  _defineProperty(_assertThisInitialized(_this), "getCurrentState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
182
- var _this$analyticsHelper5;
199
+ var _this$analyticsHelper4;
183
200
  return _regeneratorRuntime.wrap(function _callee$(_context) {
184
201
  while (1) switch (_context.prev = _context.next) {
185
202
  case 0:
@@ -191,7 +208,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
191
208
  case 6:
192
209
  _context.prev = 6;
193
210
  _context.t0 = _context["catch"](0);
194
- (_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
211
+ (_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
195
212
  throw new GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
196
213
  case 10:
197
214
  case "end":
@@ -205,7 +222,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
205
222
  * @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
206
223
  */
207
224
  _defineProperty(_assertThisInitialized(_this), "getFinalAcknowledgedState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
208
- var _this$analyticsHelper6;
225
+ var _this$analyticsHelper5;
209
226
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
210
227
  while (1) switch (_context2.prev = _context2.next) {
211
228
  case 0:
@@ -217,7 +234,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
217
234
  case 6:
218
235
  _context2.prev = 6;
219
236
  _context2.t0 = _context2["catch"](0);
220
- (_this$analyticsHelper6 = _this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(_context2.t0, 'Error while returning ADF version of the final draft document');
237
+ (_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context2.t0, 'Error while returning ADF version of the final draft document');
221
238
  throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _context2.t0);
222
239
  case 10:
223
240
  case "end":
@@ -253,8 +270,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
253
270
  _this.documentService = new DocumentService(_this.participantsService, _this.analyticsHelper, _this.channel.fetchCatchup, _this.emitCallback, _this.channel.broadcast, function () {
254
271
  return _this.userId;
255
272
  }, _this.onErrorHandled, _this.metadataService, _this.config.failedStepLimitBeforeCatchupOnPublish, _this.config.enableErrorOnFailedDocumentApply);
256
- _this.getStatePromise = new Promise(function (resolve) {
257
- _this.getStatePromiseResolve = resolve;
273
+ _this.onSetupPromise = new Promise(function (resolve) {
274
+ _this.resolveOnSetupPromise = resolve;
258
275
  });
259
276
  _this.namespaceService = new NamespaceService();
260
277
  return _this;
@@ -288,21 +305,17 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
288
305
  */
289
306
  }, {
290
307
  key: "setup",
291
- value: function setup(_ref6) {
292
- var getState = _ref6.getState,
293
- onSyncUpError = _ref6.onSyncUpError;
308
+ value: function setup(_ref7) {
309
+ var getState = _ref7.getState,
310
+ onSyncUpError = _ref7.onSyncUpError;
294
311
  this.checkForCookies();
295
312
  try {
296
- // if setup is called with no state and the initial draft is already provided
313
+ // if setup is called with no getState and the initial draft is already provided
297
314
  // set a flag to mark early provider setup
298
315
  if (!getState && this.initialDraft) {
299
316
  this.isPreinitializing = true;
300
317
  }
301
318
  if (getState) {
302
- // if provider has already been initialized earlier, resolve the state once it is available
303
- if (this.isPreinitializing) {
304
- this.getStatePromiseResolve();
305
- }
306
319
  var collabPlugin = getState().plugins.find(function (p) {
307
320
  return p.key === 'collab$';
308
321
  });
@@ -315,14 +328,20 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
315
328
  onSyncUpError: onSyncUpError,
316
329
  clientId: this.clientId
317
330
  });
331
+
332
+ // if provider has already been initialized earlier, resolve the setup promise once setup has been called with
333
+ // a defined getState (ie editor state is ready) AND after documentService sets the editor state
334
+ if (this.isPreinitializing) {
335
+ this.resolveOnSetupPromise();
336
+ }
318
337
  }
319
338
  if (!this.isChannelInitialized) {
320
339
  this.initializeChannel();
321
340
  this.isChannelInitialized = true;
322
341
  }
323
342
  } catch (initError) {
324
- var _this$analyticsHelper7;
325
- (_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendErrorEvent(initError, 'Error while initialising the provider');
343
+ var _this$analyticsHelper6;
344
+ (_this$analyticsHelper6 = this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(initError, 'Error while initialising the provider');
326
345
  // Throw error so consumers are aware the initialisation failed when initialising themselves
327
346
  throw new ProviderInitialisationError('Provider initialisation error', initError);
328
347
  }
@@ -332,9 +351,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
332
351
  key: "checkForCookies",
333
352
  value: function checkForCookies() {
334
353
  if (!global.navigator.cookieEnabled) {
335
- var _this$analyticsHelper8;
354
+ var _this$analyticsHelper7;
336
355
  var initError = new ProviderInitialisationError('Cookies are not enabled. Please enable cookies to use collaborative editing.');
337
- (_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
356
+ (_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
338
357
  throw new ProviderInitialisationError('Provider initialisation error - cookies disabled', initError);
339
358
  }
340
359
  }
@@ -372,8 +391,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
372
391
  }
373
392
  this.documentService.send(_tr, _oldState, newState);
374
393
  } catch (error) {
375
- var _this$analyticsHelper9;
376
- (_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(error, 'Error while sending steps for a transaction');
394
+ var _this$analyticsHelper8;
395
+ (_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendErrorEvent(error, 'Error while sending steps for a transaction');
377
396
  throw new SendTransactionError('Error while sending steps for a transaction', error);
378
397
  }
379
398
  }
@@ -401,9 +420,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
401
420
  this.channel.broadcast('participant:telepointer', payload, callback);
402
421
  }
403
422
  } catch (error) {
404
- var _this$analyticsHelper10;
423
+ var _this$analyticsHelper9;
405
424
  // We don't want to throw errors for Presence features as they tend to self-restore
406
- (_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(error, 'Error while sending message - telepointer');
425
+ (_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(error, 'Error while sending message - telepointer');
407
426
  }
408
427
  }
409
428
  }, {
@@ -442,8 +461,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
442
461
  _get(_getPrototypeOf(Provider.prototype), "unsubscribeAll", this).call(this);
443
462
  this.channel.disconnect();
444
463
  } catch (error) {
445
- var _this$analyticsHelper11;
446
- (_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while shutting down the collab provider');
464
+ var _this$analyticsHelper10;
465
+ (_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(error, 'Error while shutting down the collab provider');
447
466
  throw new DestroyError('Error while shutting down the collab provider', error);
448
467
  }
449
468
  this.clearTimers();
@@ -463,8 +482,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
463
482
  try {
464
483
  this.metadataService.setTitle(title, broadcast);
465
484
  } catch (error) {
466
- var _this$analyticsHelper12;
467
- (_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while setting title');
485
+ var _this$analyticsHelper11;
486
+ (_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while setting title');
468
487
  throw new SetTitleError('Error while setting title', error);
469
488
  }
470
489
  }
@@ -482,8 +501,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
482
501
  try {
483
502
  this.metadataService.setEditorWidth(editorWidth, broadcast);
484
503
  } catch (error) {
485
- var _this$analyticsHelper13;
486
- (_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while setting editor width');
504
+ var _this$analyticsHelper12;
505
+ (_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while setting editor width');
487
506
  throw new SetEditorWidthError('Error while setting editor width', error);
488
507
  }
489
508
  }
@@ -499,8 +518,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
499
518
  try {
500
519
  this.metadataService.setMetadata(metadata);
501
520
  } catch (error) {
502
- var _this$analyticsHelper14;
503
- (_this$analyticsHelper14 = this.analyticsHelper) === null || _this$analyticsHelper14 === void 0 ? void 0 : _this$analyticsHelper14.sendErrorEvent(error, 'Error while setting metadata');
521
+ var _this$analyticsHelper13;
522
+ (_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while setting metadata');
504
523
  throw new SetMetadataError('Error while setting metadata', error);
505
524
  }
506
525
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "9.6.4";
2
+ export var version = "9.7.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.4",
3
+ "version": "9.7.0",
4
4
  "sideEffects": false
5
5
  }
@@ -29,8 +29,14 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
29
29
  * @param data - Event data to emit to subscribers
30
30
  */
31
31
  private readonly emitCallback;
32
- private getStatePromise;
33
- getStatePromiseResolve: (value: void | PromiseLike<void>) => void;
32
+ private onSetupPromise;
33
+ resolveOnSetupPromise: (value: void | PromiseLike<void>) => void;
34
+ /**
35
+ * Wrapper to update document and metadata.
36
+ * Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
37
+ * Passing the document, metadata, version (either from the initial draft or from collab service)
38
+ */
39
+ private readonly updateDocumentAndMetadata;
34
40
  constructor(config: Config);
35
41
  private initializeChannel;
36
42
  private setUserId;
@@ -29,8 +29,14 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
29
29
  * @param data - Event data to emit to subscribers
30
30
  */
31
31
  private readonly emitCallback;
32
- private getStatePromise;
33
- getStatePromiseResolve: (value: void | PromiseLike<void>) => void;
32
+ private onSetupPromise;
33
+ resolveOnSetupPromise: (value: void | PromiseLike<void>) => void;
34
+ /**
35
+ * Wrapper to update document and metadata.
36
+ * Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
37
+ * Passing the document, metadata, version (either from the initial draft or from collab service)
38
+ */
39
+ private readonly updateDocumentAndMetadata;
34
40
  constructor(config: Config);
35
41
  private initializeChannel;
36
42
  private setUserId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.4",
3
+ "version": "9.7.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -487,11 +487,11 @@ export class Provider extends Emitter<CollabEvents> implements BaseEvents {
487
487
  // (undocumented)
488
488
  getParticipants: () => ProviderParticipant[];
489
489
  // (undocumented)
490
- getStatePromiseResolve: (value: PromiseLike<void> | void) => void;
491
- // (undocumented)
492
490
  getUnconfirmedSteps: () => readonly Step[] | undefined;
493
491
  // @deprecated
494
492
  initialize(getState: () => EditorState): this;
493
+ // (undocumented)
494
+ resolveOnSetupPromise: (value: PromiseLike<void> | void) => void;
495
495
  send(
496
496
  _tr: Transaction | null,
497
497
  _oldState: EditorState | null,