From 5e94bb2b055394bafe1e5739bc5dd6966b4176dd Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Sun, 18 Oct 2020 09:30:26 -0700 Subject: [PATCH] Minor API doc updates to match current code. --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7232ace2..b35e6a09 100644 --- a/README.md +++ b/README.md @@ -389,16 +389,21 @@ YTextEvents compute changes as deltas.

const ytext = new Y.Text()
- insert(index:number, content:string, [formattingAttributes:Object<string,string>]) + insert(index:number, text:string, [attributes:TextAttributes]) +
+ Insert a string at index and assign formatting attributes to it. +
ytext.insert(0, 'bold text', { bold: true })
+
+ insertEmbed(index:number, embed:Object<string,string>, [attributes:TextAttributes])
Insert a string at index and assign formatting attributes to it.
ytext.insert(0, 'bold text', { bold: true })
delete(index:number, length:number)
- format(index:number, length:number, formattingAttributes:Object<string,string>) + format(index:number, length:number, attributes:TextAttributes)
Assign formatting attributes to a range in the text
- applyDelta(delta, opts:Object<string,any>) + applyDelta(delta: any, opts:Object<string,any>)
See Quill Delta Can set options for preventing remove ending newLines, default is true. @@ -410,7 +415,7 @@ YTextEvents compute changes as deltas.
Transforms this type, without formatting options, into a string.
toJSON():string
See toString
- toDelta():Delta + toDelta(snapshot: Snapshot, prevSnapshot: Snapshot, computeYChange:function('removed' | 'added', ID):any):any
Transforms this type to a Quill Delta
@@ -455,7 +460,7 @@ or any of its children.
length:number
- toArray():Array<Y.XmlElement|Y.XmlText> + toArray():Array<Y.XmlElement|Y.XmlText|YXmlHook>
Copies the children to a new Array.
toDOM():DocumentFragment
Transforms this type and all children to new DOM elements.
@@ -463,6 +468,14 @@ or any of its children.
Get the XML serialization of all descendants.
toJSON():string
See toString.
+ createTreeWalker(filter: function(AbstractType<any>):boolean):YXmlTreeWalker +
Create a subtree of childNodes.
+ querySelector(query: CSS_Selector): YXmlElement|YXmlText|YXmlHook|null +
Returns the first YXmlElement that matches the query.
+ querySelectorAll(query: CSS_Selector): Array<YXmlElement|YXmlText|YXmlHook|null> +
Returns all YXmlElements that match the query.
+ +
observe(function(YXmlEvent, Transaction):void)
Adds an event listener to this type that will be called synchronously every time @@ -512,7 +525,7 @@ content and be actually XML compliant.
getAttribute(attributeName:string):string
- getAttributes(attributeName:string):Object<string,string> + getAttributes(snapshot:Snapshot):Object<string,string>
toArray():Array<Y.XmlElement|Y.XmlText>
Copies the children to a new Array.