@hocuspocus/extension-database
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
export * from './auth'; | ||
export * from './CloseEvents'; |
@@ -1,3 +0,4 @@ | ||
import { HocuspocusProvider, HocuspocusProviderOptions } from './HocuspocusProvider'; | ||
export interface HocuspocusCloudProviderOptions extends HocuspocusProviderOptions { | ||
import { HocuspocusProvider, HocuspocusProviderConfiguration } from './HocuspocusProvider'; | ||
export declare type HocuspocusCloudProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & AdditionalHocuspocusCloudProviderConfiguration; | ||
export interface AdditionalHocuspocusCloudProviderConfiguration { | ||
/** | ||
@@ -9,3 +10,3 @@ * A Hocuspocus Cloud key, get one here: https://hocuspocus.cloud/ | ||
export declare class HocuspocusCloudProvider extends HocuspocusProvider { | ||
constructor(options: HocuspocusCloudProviderOptions); | ||
constructor(configuration: HocuspocusCloudProviderConfiguration); | ||
} |
@@ -13,3 +13,4 @@ import * as Y from 'yjs'; | ||
} | ||
export interface HocuspocusProviderOptions { | ||
export declare type HocuspocusProviderConfiguration = Required<Pick<CompleteHocuspocusProviderConfiguration, 'url' | 'name'>> & Partial<CompleteHocuspocusProviderConfiguration>; | ||
export interface CompleteHocuspocusProviderConfiguration { | ||
/** | ||
@@ -108,5 +109,9 @@ * URL of your @hocuspocus/server instance | ||
onAwarenessChange: (states: any) => void; | ||
/** | ||
* Don’t output any warnings. | ||
*/ | ||
quiet: boolean; | ||
} | ||
export declare class HocuspocusProvider extends EventEmitter { | ||
options: HocuspocusProviderOptions; | ||
configuration: CompleteHocuspocusProviderConfiguration; | ||
subscribedToBroadcastChannel: boolean; | ||
@@ -125,4 +130,4 @@ webSocket: WebSocket | null; | ||
} | null; | ||
constructor(options?: Partial<HocuspocusProviderOptions>); | ||
setOptions(options?: Partial<HocuspocusProviderOptions>): void; | ||
constructor(configuration: HocuspocusProviderConfiguration); | ||
setConfiguration(configuration?: Partial<HocuspocusProviderConfiguration>): void; | ||
connect(): Promise<void>; | ||
@@ -129,0 +134,0 @@ createWebSocketConnection(): Promise<unknown>; |
@@ -5,4 +5,4 @@ /// <reference types="node" /> | ||
import { IncomingMessage as HTTPIncomingMessage } from 'http'; | ||
import { CloseEvent } from '@hocuspocus/common'; | ||
import Document from './Document'; | ||
import { CloseEvent } from './types'; | ||
import { MessageLogger } from './Debugger'; | ||
@@ -9,0 +9,0 @@ declare class Connection { |
@@ -49,3 +49,10 @@ /// <reference types="node" /> | ||
/** | ||
* Handle the incoming WebSocket connection | ||
* The `handleConnection` method receives incoming WebSocket connections, | ||
* runs all hooks: | ||
* | ||
* - onConnect for all connections | ||
* - onAuthenticate only if required | ||
* | ||
* … and if nothings fails it’ll fully establish the connection and | ||
* load the Document then. | ||
*/ | ||
@@ -52,0 +59,0 @@ handleConnection(incoming: WebSocket, request: IncomingMessage, documentName: string, context?: any): void; |
@@ -28,3 +28,3 @@ /// <reference types="node" /> | ||
} | ||
export interface ConnectionConfig { | ||
export interface ConnectionConfiguration { | ||
readOnly: boolean; | ||
@@ -92,3 +92,3 @@ requiresAuthentication: boolean; | ||
token: string; | ||
connection: ConnectionConfig; | ||
connection: ConnectionConfiguration; | ||
} | ||
@@ -102,3 +102,3 @@ export interface onConnectPayload { | ||
socketId: string; | ||
connection: ConnectionConfig; | ||
connection: ConnectionConfiguration; | ||
} | ||
@@ -113,3 +113,3 @@ export interface onLoadDocumentPayload { | ||
socketId: string; | ||
connection: ConnectionConfig; | ||
connection: ConnectionConfiguration; | ||
} | ||
@@ -160,5 +160,1 @@ export interface onChangePayload { | ||
} | ||
export interface CloseEvent { | ||
code: number; | ||
reason: string; | ||
} |
{ | ||
"name": "@hocuspocus/extension-database", | ||
"description": "a generic Hocuspocus persistence driver for the database", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"homepage": "https://hocuspocus.dev", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hocuspocus/server": "^1.0.0-alpha.88", | ||
"@hocuspocus/server": "^1.0.0-alpha.89", | ||
"yjs": "^13.5.22" | ||
@@ -36,3 +36,3 @@ }, | ||
}, | ||
"gitHead": "09919438a0a220ffb7479afc562872c8726cc4b4" | ||
"gitHead": "87b715d1d28c603702879f4413c17d2c4a38c51a" | ||
} |
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
54855
1404