add type definition for YText.length

This commit is contained in:
Kevin Jahns 2020-02-03 12:22:35 +01:00
parent e9f9e08450
commit 78fa98c000
3 changed files with 16 additions and 11 deletions

18
package-lock.json generated
View File

@ -1332,9 +1332,9 @@
"dev": true
},
"isomorphic.js": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.1.1.tgz",
"integrity": "sha512-Q85LNm6e50saL4EPWa0mWEYNUuV51n623gzPVNC1QiLGLmjONEtfFT3pa04OoUIYB7rzGJBpzO2iNPhV1Ib4hg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.1.3.tgz",
"integrity": "sha512-pabBRLDwYefSsNS+qCazJ97o7P5xDTrNoxSYFTM09JlZTxPrOEPGKekwqUy3/Np4C4PHnVUXHYsZPOix0jELsA=="
},
"js-tokens": {
"version": "4.0.0",
@ -1439,9 +1439,9 @@
}
},
"lib0": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.7.tgz",
"integrity": "sha512-25ojhgEondpayWt2mgVTKels6R8viO27AetFgvdOk+WWGVah+q2pXouQ6dGj/gtxNwCDD2ih2B0LbDovNEtCrg==",
"version": "0.2.12",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.12.tgz",
"integrity": "sha512-ileLyIMsWqcpyFLP6WMIgD6C7rkwrdYjH6CCFvAnqOhnGcyAl8LmLkiryVNmKW0sLRw/gLcB47LGXJDw0tDlkg==",
"requires": {
"isomorphic.js": "^0.1.1"
}
@ -2291,9 +2291,9 @@
}
},
"rollup": {
"version": "1.29.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.1.tgz",
"integrity": "sha512-dGQ+b9d1FOX/gluiggTAVnTvzQZUEkCi/TwZcax7ujugVRHs0nkYJlV9U4hsifGEMojnO+jvEML2CJQ6qXgbHA==",
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.30.0.tgz",
"integrity": "sha512-ANcmfaSQwpcJtZUTA0ZMNBtFcQ1B4A5FldlNqEK0WdWm9sHSKu93ffa2KV1ux8HA/yKIV/ZARV28m7rNdXJgEw==",
"dev": true,
"requires": {
"@types/estree": "*",

View File

@ -56,7 +56,7 @@
},
"homepage": "https://yjs.dev",
"dependencies": {
"lib0": "^0.2.7"
"lib0": "^0.2.12"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.1",
@ -65,7 +65,7 @@
"http-server": "^0.12.1",
"jsdoc": "^3.6.3",
"markdownlint-cli": "^0.19.0",
"rollup": "^1.29.1",
"rollup": "^1.30.0",
"rollup-cli": "^1.0.9",
"standard": "^14.0.0",
"tui-jsdoc-template": "^1.2.2",

View File

@ -617,6 +617,11 @@ export class YText extends AbstractType {
this._pending = string !== undefined ? [() => this.insert(0, string)] : []
}
/**
* Number of characters of this text type.
*
* @type {number}
*/
get length () {
return this._length
}