Typedef
Static Public Summary | ||
public |
|
|
public |
Define the elements to which a set of CSS queries apply. |
|
public |
Define the elements to which a set of CSS queries apply. |
|
public |
The Quill Delta format represents changes on a text document with formatting information. |
|
public |
A filter defines which elements and attributes to share. |
|
public |
A relative position that is based on the Yjs model. |
|
public |
A SimpleDiff describes a change on a String. |
|
public |
Attributes that can be assigned to a selection of text. |
|
public |
Anything that can be encoded with |
Static Public
public AbsolutePosition: Object source
Properties:
Name | Type | Attribute | Description |
type | YType | The type on which to apply the absolute position. |
|
offset | Integer | The absolute offset.r |
public CSS_Selector: string source
Define the elements to which a set of CSS queries apply. {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}
Example:
query = '.classSelector'
query = 'nodeSelector'
query = '#idSelector'
public CSS_Selector: string source
Define the elements to which a set of CSS queries apply. {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}
Example:
query = '.classSelector'
query = 'nodeSelector'
query = '#idSelector'
public Delta: Array<Object> source
The Quill Delta format represents changes on a text document with formatting information. For mor information visit {@link https://quilljs.com/docs/delta/|Quill Delta}
Example:
{
ops: [
{ insert: 'Gandalf', attributes: { bold: true } },
{ insert: ' the ' },
{ insert: 'Grey', attributes: { color: '#cccccc' } }
]
}
public FilterFunction: function(nodeName: String, attrs: Map): Map | null source
A filter defines which elements and attributes to share. Return null if the node should be filtered. Otherwise return the Map of accepted attributes.
public RelativePosition: encodable source
A relative position that is based on the Yjs model. In contrast to an absolute position (position by index), the relative position can be recomputed when remote changes are received. For example:
Insert(0, 'x')('a|bc') = 'xa|bc'
Where | is the cursor position.
A relative cursor position can be obtained with the function getRelativePosition and it can be transformed to an absolute position with fromRelativePosition.
Pro tip: Use this to implement shared cursor locations in YText or YXml! The relative position is encodable, so you can send it to other clients.
Example:
// Current cursor position is at position 10
let relativePosition = getRelativePosition(yText, 10)
// modify yText
yText.insert(0, 'abc')
yText.delete(3, 10)
// Compute the cursor position
let absolutePosition = fromRelativePosition(y, relativePosition)
absolutePosition.type // => yText
console.log('cursor location is ' + absolutePosition.offset) // => cursor location is 3
public SimpleDiff: Object source
A SimpleDiff describes a change on a String.
Example:
console.log(a) // the old value
console.log(b) // the updated value
// Apply changes of diff (pseudocode)
a.remove(diff.pos, diff.remove) // Remove `diff.remove` characters
a.insert(diff.pos, diff.insert) // Insert `diff.insert`
a === b // values match