Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RichTextEventsRecord<F>

Events record for CRichText.

Type Parameters

  • F extends Record<string, any> = Record<string, any>

Hierarchy

  • CollabEventsRecord
    • RichTextEventsRecord

Index

Properties

Any: CollabEvent

Emitted right after any other event is emitted.

Listen on this if you want to know each time the [[Collab]] emits an event (e.g., so you can refresh a display based on its state) without having to listen on each individual event type.

When using CRuntime, note that this event may be emitted multiple times in the middle of a transaction. You typically want to wait to refresh displays until the next DocEventsRecord.Change event, e.g.:

let isDirty = false;
collab.on("Any", () => { isDirty = true; });
doc.on("Change", () => {
if (isDirty) {
refreshDisplay();
isDirty = false;
}
})

Or, in a React component, use @collabs/react's useCollab.

Delete: TextEvent

Emitted when a range of characters is deleted.

Format: RichTextFormatEvent<F, keyof F & string>

Emitted when a range of characters is formatted.

A range can be formatted either by CRichText.format, or by CRichText.insert if its given format does not match the new character's inherited format.

Emitted when a range of characters is inserted.

Generated using TypeDoc