@hocuspocus/provider
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
@@ -90,2 +90,3 @@ import * as Y from 'yjs'; | ||
get isAuthenticationRequired(): boolean; | ||
connect(): Promise<unknown>; | ||
disconnect(): void; | ||
@@ -92,0 +93,0 @@ onOpen(event: Event): Promise<void>; |
@@ -18,3 +18,4 @@ import { Awareness } from 'y-protocols/awareness'; | ||
QueryAwareness = 3, | ||
Stateless = 5 | ||
Stateless = 5, | ||
CLOSE = 7 | ||
} | ||
@@ -21,0 +22,0 @@ export declare enum WebSocketStatus { |
@@ -26,6 +26,10 @@ /// <reference types="node" /> | ||
constructor(connection: WebSocket, request: HTTPIncomingMessage, document: Document, timeout: number, socketId: string, context: any, readOnly: boolean | undefined, logger: Debugger); | ||
boundClose: (event?: CloseEvent | undefined) => void; | ||
boundHandleMessage: (data: Uint8Array) => void; | ||
boundHandlePong: () => void; | ||
handlePong(): void; | ||
/** | ||
* Set a callback that will be triggered when the connection is closed | ||
*/ | ||
onClose(callback: (document: Document) => void): Connection; | ||
onClose(callback: (document: Document, event?: CloseEvent) => void): Connection; | ||
/** | ||
@@ -32,0 +36,0 @@ * Set a callback that will be triggered when an stateless message is received |
@@ -16,3 +16,4 @@ /// <reference types="node" /> | ||
Stateless = 5, | ||
BroadcastStateless = 6 | ||
BroadcastStateless = 6, | ||
CLOSE = 7 | ||
} | ||
@@ -19,0 +20,0 @@ export interface AwarenessUpdate { |
{ | ||
"name": "@hocuspocus/provider", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "hocuspocus provider", | ||
@@ -31,5 +31,6 @@ "homepage": "https://hocuspocus.dev", | ||
"dependencies": { | ||
"@hocuspocus/common": "^2.0.0-alpha.0", | ||
"@hocuspocus/common": "^2.0.0-alpha.1", | ||
"@lifeomic/attempt": "^3.0.2", | ||
"lib0": "^0.2.47" | ||
"lib0": "^0.2.47", | ||
"ws": "^7.5.9" | ||
}, | ||
@@ -36,0 +37,0 @@ "peerDependencies": { |
@@ -31,2 +31,3 @@ import * as Y from 'yjs' | ||
import { StatelessMessage } from './OutgoingMessages/StatelessMessage' | ||
import { CloseMessage } from './OutgoingMessages/CloseMessage' | ||
import { onAwarenessChangeParameters, onAwarenessUpdateParameters } from '.' | ||
@@ -285,2 +286,7 @@ | ||
// not needed, but provides backward compatibility with e.g. lexicla/yjs | ||
async connect() { | ||
return this.configuration.websocketProvider.connect() | ||
} | ||
disconnect() { | ||
@@ -299,3 +305,2 @@ this.disconnectBroadcastChannel() | ||
}) | ||
return | ||
} | ||
@@ -382,2 +387,4 @@ | ||
this.send(CloseMessage, { documentName: this.configuration.name }) | ||
if (typeof window === 'undefined') { | ||
@@ -384,0 +391,0 @@ return |
@@ -20,2 +20,3 @@ import { Awareness } from 'y-protocols/awareness' | ||
Stateless = 5, | ||
CLOSE = 7, | ||
} | ||
@@ -22,0 +23,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
643509
142
7453
6