0.4.0 • Published 2 years ago

crdt-richtext-wasm v0.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

crdt-richtext-wasm

Usage

const text = new RichText(BigInt(2));
text.insert(0, "123");
text.annotate(0, 1, "bold", AnnotateType.BoldLike);
text.insert(1, "k");
{
  const spans = text.getAnnSpans();
  expect(spans[0].text).toBe("1k");
  expect(spans[0].annotations).toStrictEqual(new Set(["bold"]));
}

text.eraseAnn(0, 2, "bold", AnnotateType.BoldLike);
{
  const spans = text.getAnnSpans();
  expect(spans[0].text).toBe("1k23");
  expect(spans[0].annotations.size).toBe(0);
}
0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago