@hocuspocus/extension-throttle 1.0.0-alpha.32 → 1.0.0-alpha.36

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.
@@ -2,10 +2,53 @@ import { Extension, onChangePayload, onConfigurePayload, onConnectPayload, onLoa
2
2
  export interface LoggerConfiguration {
3
3
  /**
4
4
  * Prepend all logging message with a string.
5
+ *
6
+ * @deprecated
5
7
  */
6
8
  prefix: null | string;
9
+ /**
10
+ * Whether to log something for the `onLoadDocument` hook.
11
+ */
12
+ onLoadDocument: boolean;
13
+ /**
14
+ * Whether to log something for the `onChange` hook.
15
+ */
16
+ onChange: boolean;
17
+ /**
18
+ * Whether to log something for the `onConnect` hook.
19
+ */
20
+ onConnect: boolean;
21
+ /**
22
+ * Whether to log something for the `onDisconnect` hook.
23
+ */
24
+ onDisconnect: boolean;
25
+ /**
26
+ * Whether to log something for the `onUpgrade` hook.
27
+ */
28
+ onUpgrade: boolean;
29
+ /**
30
+ * Whether to log something for the `onRequest` hook.
31
+ */
32
+ onRequest: boolean;
33
+ /**
34
+ * Whether to log something for the `onListen` hook.
35
+ */
36
+ onListen: boolean;
37
+ /**
38
+ * Whether to log something for the `onDestroy` hook.
39
+ */
40
+ onDestroy: boolean;
41
+ /**
42
+ * Whether to log something for the `onConfigure` hook.
43
+ */
44
+ onConfigure: boolean;
45
+ /**
46
+ * A log function, if none is provided output will go to console
47
+ */
48
+ log: (...args: any[]) => void;
7
49
  }
8
50
  export declare class Logger implements Extension {
51
+ name: string | null;
9
52
  configuration: LoggerConfiguration;
10
53
  /**
11
54
  * Constructor
@@ -20,5 +63,6 @@ export declare class Logger implements Extension {
20
63
  onListen(data: onListenPayload): Promise<void>;
21
64
  onDestroy(data: onDestroyPayload): Promise<void>;
22
65
  onConfigure(data: onConfigurePayload): Promise<void>;
66
+ private logRawText;
23
67
  private log;
24
68
  }
@@ -4,6 +4,7 @@ import { IncomingMessage, Server as HTTPServer } from 'http';
4
4
  import { Configuration } from './types';
5
5
  import { MessageLogger } from './Debugger';
6
6
  export declare const defaultConfiguration: {
7
+ name: null;
7
8
  port: number;
8
9
  timeout: number;
9
10
  };
@@ -45,7 +45,16 @@ export interface Extension {
45
45
  onRequest?(data: onRequestPayload): Promise<any>;
46
46
  onUpgrade?(data: onUpgradePayload): Promise<any>;
47
47
  }
48
+ export declare type Hook = 'onAuthenticate' | 'onChange' | 'onConnect' | 'onConfigure' |
49
+ /**
50
+ * @deprecated onCreateDocument is deprecated, use onLoadDocument instead
51
+ */
52
+ 'onCreateDocument' | 'onLoadDocument' | 'onDestroy' | 'onDisconnect' | 'onListen' | 'onRequest' | 'onUpgrade';
48
53
  export interface Configuration extends Extension {
54
+ /**
55
+ * A name for the instance, used for logging.
56
+ */
57
+ name: string | null;
49
58
  /**
50
59
  * A list of hocuspocus extenions.
51
60
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-throttle",
3
- "version": "1.0.0-alpha.32",
3
+ "version": "1.0.0-alpha.36",
4
4
  "description": "hocuspocus throttle extension",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -14,15 +14,20 @@
14
14
  "module": "dist/hocuspocus-throttle.esm.js",
15
15
  "types": "dist/packages/extension-throttle/src/index.d.ts",
16
16
  "exports": {
17
- "import": "./dist/hocuspocus-throttle.esm.js",
18
- "require": "./dist/hocuspocus-throttle.cjs"
17
+ "development": {
18
+ "import": "./src"
19
+ },
20
+ "default": {
21
+ "import": "./dist/hocuspocus-throttle.esm.js",
22
+ "require": "./dist/hocuspocus-throttle.cjs"
23
+ }
19
24
  },
20
25
  "files": [
21
26
  "src",
22
27
  "dist"
23
28
  ],
24
29
  "dependencies": {
25
- "@hocuspocus/server": "^1.0.0-alpha.76"
30
+ "@hocuspocus/server": "^1.0.0-alpha.80"
26
31
  },
27
- "gitHead": "fa031748b345c53bd71eaeca2bccfcf29cbb36e8"
32
+ "gitHead": "f85955a7cca23b23044b0579e96fc8d17c107a4c"
28
33
  }