UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

23 lines (22 loc) 890 B
import { s } from '../../json-crdt-patch'; import { ExtensionId, ExtensionName } from '../constants'; export var Chars; (function (Chars) { Chars["BlockSplitSentinel"] = "\n"; })(Chars || (Chars = {})); export var Position; (function (Position) { /** * Specifies the absolute start of the text, i.e. the position before the * first character. In model space it is defined as string ID and "after" * anchor. */ Position[Position["AbsStart"] = -1] = "AbsStart"; /** * Specifies the absolute end of the text, i.e. the position after the last * character. In model space it is defined as string ID and "before" anchor. */ Position[Position["AbsEnd"] = 9007199254740991] = "AbsEnd"; })(Position || (Position = {})); export const MNEMONIC = ExtensionName[ExtensionId.peritext]; export const SCHEMA = (text) => s.vec(s.str(text), s.arr([]));