@@ -36,7 +36,13 @@ export type HocuspocusProviderConfiguration = Required<
3636> &
3737 Partial < CompleteHocuspocusProviderConfiguration > &
3838 (
39- | Required < Pick < CompleteHocuspocusProviderWebsocketConfiguration , "url" > >
39+ | ( Required < Pick < CompleteHocuspocusProviderWebsocketConfiguration , "url" > > &
40+ Partial <
41+ Pick <
42+ CompleteHocuspocusProviderWebsocketConfiguration ,
43+ "preserveTrailingSlash"
44+ >
45+ > )
4046 | Required <
4147 Pick < CompleteHocuspocusProviderConfiguration , "websocketProvider" >
4248 >
@@ -222,12 +228,10 @@ export class HocuspocusProvider extends EventEmitter {
222228 configuration : Partial < HocuspocusProviderConfiguration > = { } ,
223229 ) : void {
224230 if ( ! configuration . websocketProvider ) {
225- const websocketProviderConfig =
226- configuration as CompleteHocuspocusProviderWebsocketConfiguration ;
227231 this . manageSocket = true ;
228- this . configuration . websocketProvider = new HocuspocusProviderWebsocket ( {
229- url : websocketProviderConfig . url ,
230- } ) ;
232+ this . configuration . websocketProvider = new HocuspocusProviderWebsocket (
233+ configuration as CompleteHocuspocusProviderWebsocketConfiguration ,
234+ ) ;
231235 }
232236
233237 this . configuration = { ...this . configuration , ...configuration } ;
@@ -310,7 +314,9 @@ export class HocuspocusProvider extends EventEmitter {
310314 try {
311315 token = await this . getToken ( ) ;
312316 } catch ( error ) {
313- this . permissionDeniedHandler ( `Failed to get token during sendToken(): ${ error } ` ) ;
317+ this . permissionDeniedHandler (
318+ `Failed to get token during sendToken(): ${ error } ` ,
319+ ) ;
314320 return ;
315321 }
316322
0 commit comments