Migrate editor-socketio-server.js to TypeScript

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-13 16:21:44 +02:00
parent c7478157e2
commit dc3a3f2994
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
3 changed files with 157 additions and 165 deletions

View file

@ -10,6 +10,7 @@ import async from 'async'
import cookieParser from 'cookie-parser'
import cookie from 'cookie'
import Chance from 'chance'
import { EditorSocketIOServer } from './ot/editor-socketio-server'
const chance = new Chance()
@ -577,7 +578,7 @@ function startConnection (socket) {
const body = note.content
const createtime = note.createdAt
const updatetime = note.lastchangeAt
const server = new ot.EditorSocketIOServer(body, [], noteId, ifMayEdit, operationCallback)
const server = new EditorSocketIOServer(body, [], noteId, ifMayEdit, operationCallback)
const authors = {}
for (let i = 0; i < note.authors.length; i++) {