Event target for listening to node changes. You can subscribe to "view"
events, which are triggered every time the node's view changes.
node.events.on('view', () => {
// do something...
});
Returns a proxy object for this node.
Optional
path: ApiPathReturns the API object of the extension if the node is an extension node.
When the ext
parameter is provided, it checks if the node is an instance
of the given extension and returns the object's TypeScript type. Otherwise,
it returns the API object of the extension, but without any type checking.
API of the extension
Returns the API object of the extension if the node is an extension node.
When the ext
parameter is provided, it checks if the node is an instance
of the given extension and returns the object's TypeScript type. Otherwise,
it returns the API object of the extension, but without any type checking.
API of the extension
Optional
path: ApiPathOptional
path: ApiPathDeletes a range of text at a given position.
Position at which to delete text.
Number of UTF-16 code units to delete.
Reference to itself.
Find a child node at the given path starting from this node.
Optional
path: ApiPathPath to the child node to find.
JSON CRDT node at the given path.
Given a character index in local coordinates, find the ID of the character in the global coordinates.
Index of the character or -1
for before the first character.
ID of the character after which the given position is located.
Given a position in global coordinates, find the position in local coordinates.
ID of the character.
Index of the character in local coordinates. Returns -1 if the the position refers to the beginning of the string.
Inserts text at a given position.
Position at which to insert text.
Text to insert.
Reference to itself.
Get the length of the string without materializing it to a view.
Length of the string.
Optional
path: ApiPathOptional
path: ApiPathOptional
path: ApiPathOptional
path: ApiPathOptional
path: ApiPath
Local changes API for the
str
JSON CRDT node StrNode. This API allows to insert and delete bytes in the UTF-16 string by referencing its local character positions.