(core) Converting server-side Comm.js to typescript

Summary:
- Add app/common/CommTypes.ts to define types shared by client and server.
- Include @types/ws npm package

Test Plan: Intended to have no changes in behavior

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3467
This commit is contained in:
Dmitry S
2022-06-04 00:12:30 -04:00
parent 519f1be93a
commit 4f1cb53b29
23 changed files with 655 additions and 716 deletions

View File

@@ -15,6 +15,7 @@ import {createAppUI} from 'app/client/ui/AppUI';
import {addViewportTag} from 'app/client/ui/viewport';
import {attachCssRootVars} from 'app/client/ui2018/cssVars';
import {BaseAPI} from 'app/common/BaseAPI';
import {CommDocError} from 'app/common/CommTypes';
import {DisposableWithEvents} from 'app/common/DisposableWithEvents';
import {fetchFromHome} from 'app/common/urlUtils';
import {ISupportedFeatures} from 'app/common/UserConfig';
@@ -158,7 +159,7 @@ export class App extends DisposableWithEvents {
setTimeout(() => this.reloadPane(), 0);
});
this.listenTo(this.comm, 'docError', (msg) => {
this.listenTo(this.comm, 'docError', (msg: CommDocError) => {
this._checkError(new Error(msg.data.message));
});