You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cudr_slate-collaborative/packages/client/src/withIOCollaboration.ts

21 lines
580 B

import { Editor } from 'slate'
import { AutomergeEditor } from './automerge-editor'
import withAutomerge, { AutomergeOptions } from './withAutomerge'
import withSocketIO, {
WithSocketIOEditor,
SocketIOPluginOptions
} from './withSocketIO'
/**
* The `withIOCollaboration` plugin contains collaboration with SocketIO.
*/
const withIOCollaboration = <T extends Editor>(
editor: T,
options: AutomergeOptions & SocketIOPluginOptions
): T & WithSocketIOEditor & AutomergeEditor =>
withSocketIO(withAutomerge(editor, options), options)
export default withIOCollaboration