@hocuspocus/extension-throttle 2.4.0-rc.0 → 2.4.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.
@@ -25,7 +25,6 @@ export declare class Connection {
25
25
  */
26
26
  constructor(connection: WebSocket, request: HTTPIncomingMessage, document: Document, timeout: number, socketId: string, context: any, readOnly: boolean | undefined, logger: Debugger);
27
27
  boundClose: (event?: CloseEvent) => void;
28
- boundHandleMessage: (data: Uint8Array) => void;
29
28
  boundHandlePong: () => void;
30
29
  handlePong(): void;
31
30
  /**
@@ -64,8 +63,8 @@ export declare class Connection {
64
63
  private sendCurrentAwareness;
65
64
  /**
66
65
  * Handle an incoming message
67
- * @private
66
+ * @public
68
67
  */
69
- private handleMessage;
68
+ handleMessage(data: Uint8Array): void;
70
69
  }
71
70
  export default Connection;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { Server as HTTPServer, IncomingMessage } from 'http';
4
- import WebSocket, { AddressInfo, WebSocketServer } from 'ws';
3
+ import { IncomingMessage } from 'http';
4
+ import WebSocket, { AddressInfo } from 'ws';
5
+ import { Server as HocuspocusServer } from './Server';
5
6
  import { Debugger } from './Debugger.js';
6
7
  import { DirectConnection } from './DirectConnection.js';
7
8
  import Document from './Document.js';
@@ -25,8 +26,7 @@ export declare const defaultConfiguration: {
25
26
  export declare class Hocuspocus {
26
27
  configuration: Configuration;
27
28
  documents: Map<string, Document>;
28
- httpServer?: HTTPServer;
29
- webSocketServer?: WebSocketServer;
29
+ server?: HocuspocusServer;
30
30
  debugger: Debugger;
31
31
  constructor(configuration?: Partial<Configuration>);
32
32
  /**
@@ -66,7 +66,7 @@ export declare class Hocuspocus {
66
66
  * - onConnect for all connections
67
67
  * - onAuthenticate only if required
68
68
  *
69
- * … and if nothings fails it’ll fully establish the connection and
69
+ * … and if nothing fails it’ll fully establish the connection and
70
70
  * load the Document then.
71
71
  */
72
72
  handleConnection(incoming: WebSocket, request: IncomingMessage, defaultContext?: any): void;
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ import { IncomingMessage, Server as HTTPServer, ServerResponse } from 'http';
3
+ import { WebSocketServer } from 'ws';
4
+ import { Hocuspocus } from './Hocuspocus';
5
+ export declare class Server {
6
+ httpServer: HTTPServer;
7
+ webSocketServer: WebSocketServer;
8
+ hocuspocus: Hocuspocus;
9
+ constructor(hocuspocus: Hocuspocus);
10
+ setupWebsocketConnection: () => void;
11
+ setupHttpUpgrade: () => void;
12
+ requestHandler: (request: IncomingMessage, response: ServerResponse) => Promise<void>;
13
+ }
@@ -31,6 +31,7 @@ export interface ConnectionConfiguration {
31
31
  }
32
32
  export interface Extension {
33
33
  priority?: number;
34
+ extensionName?: string;
34
35
  onConfigure?(data: onConfigurePayload): Promise<any>;
35
36
  onListen?(data: onListenPayload): Promise<any>;
36
37
  onUpgrade?(data: onUpgradePayload): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-throttle",
3
- "version": "2.4.0-rc.0",
3
+ "version": "2.4.0",
4
4
  "description": "hocuspocus throttle extension",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@hocuspocus/server": "^2.4.0-rc.0"
31
+ "@hocuspocus/server": "^2.4.0"
32
32
  },
33
33
  "gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
34
34
  }