@hocuspocus/provider 1.0.0-alpha.18 → 1.0.0-alpha.22
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.
- package/dist/demos/backend/src/{create-document.d.ts → load-document.d.ts} +0 -0
- package/dist/hocuspocus-provider.cjs +9 -7
- package/dist/hocuspocus-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js +9 -7
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/extension-logger/src/Logger.d.ts +68 -0
- package/dist/packages/extension-logger/src/index.d.ts +1 -0
- package/dist/packages/{monitor → extension-monitor}/src/Collector.d.ts +2 -2
- package/dist/packages/{monitor → extension-monitor}/src/Dashboard.d.ts +2 -2
- package/dist/packages/{monitor → extension-monitor}/src/Storage.d.ts +0 -0
- package/dist/packages/{monitor → extension-monitor}/src/index.d.ts +2 -2
- package/dist/packages/{redis → extension-redis}/src/Redis.d.ts +2 -2
- package/dist/packages/{redis → extension-redis}/src/RedisCluster.d.ts +0 -0
- package/dist/packages/{redis → extension-redis}/src/index.d.ts +0 -0
- package/dist/packages/{rocksdb → extension-rocksdb}/src/index.d.ts +3 -3
- package/dist/packages/{throttle → extension-throttle}/src/index.d.ts +0 -0
- package/dist/packages/{webhook → extension-webhook}/src/index.d.ts +4 -4
- package/dist/packages/provider/src/HocuspocusProvider.d.ts +4 -4
- package/dist/packages/server/src/Hocuspocus.d.ts +3 -2
- package/dist/packages/server/src/types.d.ts +10 -2
- package/package.json +10 -5
- package/src/HocuspocusProvider.ts +12 -11
- package/dist/packages/logger/src/index.d.ts +0 -13
|
File without changes
|
|
@@ -1920,14 +1920,15 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
1920
1920
|
createWebSocketConnection() {
|
|
1921
1921
|
return new Promise((resolve, reject) => {
|
|
1922
1922
|
// Init the WebSocket connection
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1923
|
+
const ws = new this.options.WebSocketPolyfill(this.url);
|
|
1924
|
+
ws.binaryType = 'arraybuffer';
|
|
1925
|
+
ws.onmessage = this.onMessage.bind(this);
|
|
1926
|
+
ws.onclose = this.onClose.bind(this);
|
|
1927
|
+
ws.onopen = this.onOpen.bind(this);
|
|
1928
|
+
ws.onerror = () => {
|
|
1929
1929
|
reject();
|
|
1930
1930
|
};
|
|
1931
|
+
this.webSocket = ws;
|
|
1931
1932
|
// Reset the status
|
|
1932
1933
|
this.synced = false;
|
|
1933
1934
|
this.status = exports.WebSocketStatus.Connecting;
|
|
@@ -1956,6 +1957,7 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
1956
1957
|
return this.options.awareness;
|
|
1957
1958
|
}
|
|
1958
1959
|
checkConnection() {
|
|
1960
|
+
var _a;
|
|
1959
1961
|
// Don’t check the connection when it’s not even established
|
|
1960
1962
|
if (this.status !== exports.WebSocketStatus.Connected) {
|
|
1961
1963
|
return;
|
|
@@ -1970,7 +1972,7 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
1970
1972
|
}
|
|
1971
1973
|
// No message received in a long time, not even your own
|
|
1972
1974
|
// Awareness updates, which are updated every 15 seconds.
|
|
1973
|
-
this.webSocket.close();
|
|
1975
|
+
(_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.close();
|
|
1974
1976
|
}
|
|
1975
1977
|
forceSync() {
|
|
1976
1978
|
if (!this.webSocket) {
|