From e4a5f2caec6f8346004af2171d4d07e32ee0bb3c Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Sun, 25 Nov 2018 05:43:18 +0100 Subject: [PATCH] jsdoc fixes --- package.json | 3 ++- types/YArray.js | 9 +++++---- types/YMap.js | 9 +++++---- types/YText.js | 5 +++-- types/YXmlText.js | 2 -- utils/StateStore.js | 3 +++ utils/Y.js | 7 ++++--- 7 files changed, 22 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 734c9bcd..0cb031ad 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,14 @@ "watch": "rollup -wc", "debug": "concurrently 'rollup -wc' 'cutest-serve build/y.test.js -o'", "lint": "standard **/*.js", - "docs": "ls -al && rm -rf docs; ! jsdoc --configure ./.jsdoc.json --verbose --readme ./README.md --package ./package.json", + "docs": "rm -rf docs; ! jsdoc --configure ./.jsdoc.json --verbose --readme ./README.md --package ./package.json", "serve-docs": "npm run docs && serve ./docs/", "postversion": "npm run build" }, "files": [ "src/*", ".esdoc.json", + ".jsdoc.json", "docs/*", "build/*", "lib/*", diff --git a/types/YArray.js b/types/YArray.js index 13e1c62a..0a760981 100644 --- a/types/YArray.js +++ b/types/YArray.js @@ -12,12 +12,13 @@ import { Item } from '../structs/Item.js' // eslint-disable-line /** * Event that describes the changes on a YArray - * - * @param {YArray} yarray The changed type - * @param {Boolean} remote Whether the changed was caused by a remote peer - * @param {Transaction} transaction The transaction object */ export class YArrayEvent extends YEvent { + /** + * @param {YArray} yarray The changed type + * @param {Boolean} remote Whether the changed was caused by a remote peer + * @param {Transaction} transaction The transaction object + */ constructor (yarray, remote, transaction) { super(yarray) this.remote = remote diff --git a/types/YMap.js b/types/YMap.js index cd5d2e0d..74a22568 100644 --- a/types/YMap.js +++ b/types/YMap.js @@ -10,12 +10,13 @@ import { YEvent } from '../utils/YEvent.js' /** * Event that describes the changes on a YMap. - * - * @param {YMap} ymap The YArray that changed. - * @param {Set} subs The keys that changed. - * @param {boolean} remote Whether the change was created by a remote peer. */ export class YMapEvent extends YEvent { + /** + * @param {YMap} ymap The YArray that changed. + * @param {Set} subs The keys that changed. + * @param {boolean} remote Whether the change was created by a remote peer. + */ constructor (ymap, subs, remote) { super(ymap) this.keysChanged = subs diff --git a/types/YText.js b/types/YText.js index 646c5e76..9dbacd3c 100644 --- a/types/YText.js +++ b/types/YText.js @@ -461,10 +461,11 @@ class YTextEvent extends YArrayEvent { * This type replaces y-richtext as this implementation is able to handle * block formats (format information on a paragraph), embeds (complex elements * like pictures and videos), and text formats (**bold**, *italic*). - * - * @param {String} string The initial value of the YText. */ export class YText extends YArray { + /** + * @param {String} string The initial value of the YText. + */ constructor (string) { super() if (typeof string === 'string') { diff --git a/types/YXmlText.js b/types/YXmlText.js index 673c7509..a4b5780e 100644 --- a/types/YXmlText.js +++ b/types/YXmlText.js @@ -10,8 +10,6 @@ import { DomBinding } from '../bindings/dom/DomBinding.js' // eslint-disable-lin /** * Represents text in a Dom Element. In the future this type will also handle * simple formatting information like bold and italic. - * - * @param {String} arg1 Initial value. */ export class YXmlText extends YText { /** diff --git a/utils/StateStore.js b/utils/StateStore.js index fad983df..f739b5f5 100644 --- a/utils/StateStore.js +++ b/utils/StateStore.js @@ -8,6 +8,9 @@ import * as ID from '../utils/ID.js' * @typedef {Map} StateSet */ +/** + * @private + */ export class StateStore { constructor (y) { this.y = y diff --git a/utils/Y.js b/utils/Y.js index 732a24a9..0208a0c8 100644 --- a/utils/Y.js +++ b/utils/Y.js @@ -25,11 +25,12 @@ import { Decoder } from '../lib/decoding.js' // eslint-disable-line /** * A Yjs instance handles the state of shared data. - * - * @param {string} room Users in the same room share the same content - * @param {Object} conf configuration */ export class Y extends NamedEventHandler { + /** + * @param {string} room Users in the same room share the same content + * @param {Object} conf configuration + */ constructor (room, conf = {}) { super() this.gcEnabled = conf.gc || false