CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/sync/editor/string/sync.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { SyncDoc, SyncOpts0, SyncOpts } from "../generic/sync-doc";
7
import { StringDocument } from "./doc";
8
9
export class SyncString extends SyncDoc {
10
constructor(opts: SyncOpts0) {
11
// TS question -- What is the right way to do this?
12
(opts as SyncOpts).from_str = (str) => new StringDocument(str);
13
(opts as SyncOpts).doctype = { type: "string" };
14
super(opts as SyncOpts);
15
}
16
}
17
18