@@ -142,11 +142,11 @@ class WSSharedDoc extends Y.Doc {
142
142
this . awareness . on ( 'update' , awarenessChangeHandler )
143
143
this . on ( 'update' , /** @type {any } */ ( updateHandler ) )
144
144
if ( isCallbackSet ) {
145
- this . on ( 'update' , debounce (
145
+ this . on ( 'update' , /** @type { any } */ ( debounce (
146
146
callbackHandler ,
147
147
CALLBACK_DEBOUNCE_WAIT ,
148
148
{ maxWait : CALLBACK_DEBOUNCE_MAXWAIT }
149
- ) )
149
+ ) ) )
150
150
}
151
151
this . whenInitialized = contentInitializor ( this )
152
152
}
@@ -233,15 +233,15 @@ const closeConn = (doc, conn) => {
233
233
234
234
/**
235
235
* @param {WSSharedDoc } doc
236
- * @param {any } conn
236
+ * @param {import('ws').WebSocket } conn
237
237
* @param {Uint8Array } m
238
238
*/
239
239
const send = ( doc , conn , m ) => {
240
240
if ( conn . readyState !== wsReadyStateConnecting && conn . readyState !== wsReadyStateOpen ) {
241
241
closeConn ( doc , conn )
242
242
}
243
243
try {
244
- conn . send ( m , /** @param { any } err */ err => { err != null && closeConn ( doc , conn ) } )
244
+ conn . send ( m , { } , err => { err != null && closeConn ( doc , conn ) } )
245
245
} catch ( e ) {
246
246
closeConn ( doc , conn )
247
247
}
@@ -250,11 +250,11 @@ const send = (doc, conn, m) => {
250
250
const pingTimeout = 30000
251
251
252
252
/**
253
- * @param {any } conn
254
- * @param {any } req
253
+ * @param {import('ws').WebSocket } conn
254
+ * @param {import('http').IncomingMessage } req
255
255
* @param {any } opts
256
256
*/
257
- exports . setupWSConnection = ( conn , req , { docName = req . url . slice ( 1 ) . split ( '?' ) [ 0 ] , gc = true } = { } ) => {
257
+ exports . setupWSConnection = ( conn , req , { docName = ( req . url || '' ) . slice ( 1 ) . split ( '?' ) [ 0 ] , gc = true } = { } ) => {
258
258
conn . binaryType = 'arraybuffer'
259
259
// get doc, initialize if it does not exist yet
260
260
const doc = getYDoc ( docName , gc )
0 commit comments