diff --git a/development/issues/open/251.html b/development/issues/open/251.html new file mode 100644 index 0000000000000000000000000000000000000000..3ea6869b70277126cec3c1cf1ca6bc60b3b6d754 --- /dev/null +++ b/development/issues/open/251.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>investigate the reloading of select #251</title> + <script src="./251.mjs" type="module"></script> +</head> +<body> + <h1>investigate the reloading of select #251</h1> + <p>there are problems with filtering remote url options</p> + <ul> + <li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/251">Issue #251</a></li> + <li><a href="/">Back to overview</a></li> + </ul> + <main> + + <script type="application/json" data-monster-role="translations"> + { + "51": "xyz", + "52": "abc", + "53": "def" + } + </script> + + + <monster-select + data-monster-option-features-lazyload="true" + data-monster-option-mapping-labeltemplate="${name} (${value})" + data-monster-option-mapping-valuetemplate="${id}" + data-monster-option-url="/issue-223.json" > + </monster-select> + + </main> +</body> +</html> diff --git a/development/issues/open/251.mjs b/development/issues/open/251.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0a8dd96c98323714e9a840b97ef4ef8337f030be --- /dev/null +++ b/development/issues/open/251.mjs @@ -0,0 +1,15 @@ +/** +* @file development/issues/open/251.mjs +* @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/251 +* @description investigate the reloading of select +* @issue 251 +*/ + +import "../../../source/components/style/property.pcss"; +import "../../../source/components/style/link.pcss"; +import "../../../source/components/style/color.pcss"; +import "../../../source/components/style/theme.pcss"; +import "../../../source/components/style/normalize.pcss"; +import "../../../source/components/style/typography.pcss"; +import "../../../source/components/form/select.mjs"; + diff --git a/example/components/form/select.mjs b/example/components/form/select.mjs deleted file mode 100644 index 04bae4dc95c976bb9c10fb07cb40fedc1fe556db..0000000000000000000000000000000000000000 --- a/example/components/form/select.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import '@schukai/component-form/source/select.js'; - -const select = document.createElement('monster-select'); -select.setOption('mapping.labelTemplate', '${name} (${alpha-2})') -select.setOption('mapping.valueTemplate', '${country-code}') -select.importOptions([ - { - "name": "United Kingdom", - "alpha-2": "GB", - "country-code": "826", - }, - { - "name": "Sweden", - "alpha-2": "SE", - "country-code": "752", - - }, - { - "name": "Germany", - "alpha-2": "DE", - "country-code": "276", - } -]); - -document.body.appendChild(select); \ No newline at end of file diff --git a/example/data/pathfinder-1.mjs b/example/data/pathfinder-1.mjs deleted file mode 100644 index f6cfe5e159c7377bb256c5c2d4ced1a962a49688..0000000000000000000000000000000000000000 --- a/example/data/pathfinder-1.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs'; - -let value = new Pathfinder({ - a: { - b: { - f: [ - { - g: false, - } - ], - } - } -}).getVia("a.b.f.0.g"); - -console.log(value); -// ↦ false - -try { - new Pathfinder({}).getVia("a.b.f.0.g"); -} catch (e) { - console.log(e.toString()); - // ↦ Error: the journey is not at its end (b.f.0.g) -} \ No newline at end of file diff --git a/example/data/pathfinder-2.mjs b/example/data/pathfinder-2.mjs deleted file mode 100644 index b90b3ac18a9efba7f53a832c7a1366cd1087b4b1..0000000000000000000000000000000000000000 --- a/example/data/pathfinder-2.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs'; - -let p = new Pathfinder({ - a: { - x: [ - {c: 1}, {c: 2} - ], - y: true - }, - b: { - x: [ - {c: 1, d: false}, {c: 2} - ], - y: true - }, -}); - -let r = p.getVia("*.x.*.c"); -console.log(r); diff --git a/example/data/pipe.mjs b/example/data/pipe.mjs deleted file mode 100644 index 6628a7cb024a641f6f84f597bfd904d4eef3fedb..0000000000000000000000000000000000000000 --- a/example/data/pipe.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import {Pipe} from '@schukai/monster/source/data/pipe.mjs'; - -let obj = { - a: { - b: { - c: { - d: "world" - } - } - } -} - -console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\ ').run(obj)); -// ↦ Hello WORLD diff --git a/example/data/transformer.mjs b/example/data/transformer.mjs deleted file mode 100644 index 74b3c9fdbf62554323e42e762cc65e55acd69170..0000000000000000000000000000000000000000 --- a/example/data/transformer.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import {Transformer} from '@schukai/monster/source/data/transformer.mjs'; - -const transformer = new Transformer("tolower") - -console.log(transformer.run("HELLO")) -// ↦ hello - -console.log(transformer.run("WORLD")) -// ↦ world \ No newline at end of file diff --git a/source/components/content/copy.mjs b/source/components/content/copy.mjs index 104ab94a91f4e55e11a7a11ac479871248af5e97..71114f1d156b5395f8d46cabb3e53aa8b310e214 100644 --- a/source/components/content/copy.mjs +++ b/source/components/content/copy.mjs @@ -85,7 +85,7 @@ const resizeObserverSymbol = Symbol("resizeObserver"); class Copy extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/content/copy@@instance"); diff --git a/source/components/datatable/change-button.mjs b/source/components/datatable/change-button.mjs index 6a6b1ec6c8e5171bcd9fb6431842e1eeae204a68..ea890434fc878fb2da42407acb16dec7d07af45f 100644 --- a/source/components/datatable/change-button.mjs +++ b/source/components/datatable/change-button.mjs @@ -88,7 +88,7 @@ const overlayLinkedElementSymbol = Symbol("overlayLinkedElement"); class ChangeButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/datatable/columnbar.mjs b/source/components/datatable/columnbar.mjs index b2d76e46743bbbae9f06158c1a4b576db39091ad..34753cd388b28751c6550e65f31056d107cb38be 100644 --- a/source/components/datatable/columnbar.mjs +++ b/source/components/datatable/columnbar.mjs @@ -96,7 +96,7 @@ const popperInstanceSymbol = Symbol("popperInstance"); class ColumnBar extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/column-bar"); diff --git a/source/components/datatable/dataset.mjs b/source/components/datatable/dataset.mjs index 24e920e71d4157ca2857786f7a59bb75e4a41447..b6a4cb1f457cdd0cf0a143a6103c5deea47b5131 100644 --- a/source/components/datatable/dataset.mjs +++ b/source/components/datatable/dataset.mjs @@ -81,7 +81,7 @@ export { DataSet }; class DataSet extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/dataset@@instance"); @@ -163,7 +163,7 @@ class DataSet extends CustomElement { /** * This method is called when the component is created. * @since 3.70.0 - * @returns {DataSet} + * @return {DataSet} */ refresh() { // makes sure that handleDataSourceChanges is called @@ -173,7 +173,7 @@ class DataSet extends CustomElement { /** * - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ write() { return new Promise((resolve, reject) => { diff --git a/source/components/datatable/datasource.mjs b/source/components/datatable/datasource.mjs index fa5caf1462b1c37dd035d682346540d902836587..728cbbde7d25e55ee92d9dc8a823860a02784289 100644 --- a/source/components/datatable/datasource.mjs +++ b/source/components/datatable/datasource.mjs @@ -58,7 +58,7 @@ class Datasource extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource@@instance"); @@ -87,7 +87,7 @@ class Datasource extends CustomElement { /** * Get the data, without proxy - * @returns {Object} + * @return {Object} */ get data() { return this[dataSourceSymbol].get(); @@ -103,7 +103,7 @@ class Datasource extends CustomElement { /** * Get the datasource - * @returns {Monster.Data.Datasource} + * @return {Monster.Data.Datasource} */ get datasource() { return this[dataSourceSymbol]; diff --git a/source/components/datatable/datasource/dom.mjs b/source/components/datatable/datasource/dom.mjs index 415ea97380ad64778226e04768af88d36c95c00b..08301e3c153e58d8080ea380db73f3730b9d66ca 100644 --- a/source/components/datatable/datasource/dom.mjs +++ b/source/components/datatable/datasource/dom.mjs @@ -52,7 +52,7 @@ const dataChangeEventHandlerSymbol = Symbol("dataChangeEventHandler"); class Dom extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource/dom@@instance"); @@ -107,7 +107,7 @@ class Dom extends Datasource { /** * Reloads the data - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ reload() {} diff --git a/source/components/datatable/datasource/rest.mjs b/source/components/datatable/datasource/rest.mjs index 0fd509a90102e724a61006e6fd283042ebdeb9c7..3dbfc58a573e78d3e2d1ee1901c4b023586195fa 100644 --- a/source/components/datatable/datasource/rest.mjs +++ b/source/components/datatable/datasource/rest.mjs @@ -93,7 +93,7 @@ class Rest extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource/rest@@instance"); @@ -176,7 +176,7 @@ class Rest extends Datasource { * @param {string} page * @param {string} query * @param {string} orderBy - * @returns {Monster.Components.Datatable.Datasource.Rest} + * @return {Monster.Components.Datatable.Datasource.Rest} */ setParameters({ page, query, orderBy }) { const parameters = this.getOption("read.parameters"); @@ -204,7 +204,7 @@ class Rest extends Datasource { /** * @deprecated 2023-06-25 - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ reload() { return this.fetch(); @@ -212,7 +212,7 @@ class Rest extends Datasource { /** * Fetches the data from the rest api - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ fetch() { const opt = clone(this.getOption("read")); @@ -276,7 +276,7 @@ class Rest extends Datasource { * This method activates the intersection observer manually. * For this purpose, the option `autoInit.intersectionObserver` must be set to `false`. * - * @returns {Monster.Components.Datatable.Datasource.Rest} + * @return {Monster.Components.Datatable.Datasource.Rest} */ initIntersectionObserver() { initIntersectionObserver.call(this); @@ -305,7 +305,7 @@ class Rest extends Datasource { } /** - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ read() { return this.fetch(); @@ -313,7 +313,7 @@ class Rest extends Datasource { /** * Fetches the data from the rest api - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ write() { const opt = clone(this.getOption("write")); diff --git a/source/components/datatable/datatable.mjs b/source/components/datatable/datatable.mjs index 6a1b1fc3efe1b460031de0cd121aea7c047c5272..38d412f0994ea04e3e485e8b7fb804d88c620696 100644 --- a/source/components/datatable/datatable.mjs +++ b/source/components/datatable/datatable.mjs @@ -146,7 +146,7 @@ const columnBarElementSymbol = Symbol("columnBarElement"); class DataTable extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datatable@@instance"); @@ -233,7 +233,7 @@ class DataTable extends CustomElement { /** * * @param {string} selector - * @returns {NodeListOf<*>} + * @return {NodeListOf<*>} */ getGridElements(selector) { return this[gridElementSymbol].querySelectorAll(selector); @@ -358,7 +358,7 @@ class DataTable extends CustomElement { * Copy a row from the datatable * @param {number} fromIndex * @param {number} toIndex - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-copied */ copyRow(fromIndex, toIndex) { @@ -412,7 +412,7 @@ class DataTable extends CustomElement { /** * Remove a row from the datatable * @param index - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-removed */ removeRow(index) { @@ -458,7 +458,7 @@ class DataTable extends CustomElement { /** * Add a row to the datatable * @param {Object} data - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-added **/ addRow(data) { @@ -496,7 +496,7 @@ class DataTable extends CustomElement { /** * @private - * @returns {string} + * @return {string} */ function getColumnVisibilityConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "columns-visibility"); @@ -504,7 +504,7 @@ function getColumnVisibilityConfigKey() { /** * @private - * @returns {string} + * @return {string} */ function getFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "filter"); @@ -512,7 +512,7 @@ function getFilterConfigKey() { /** * @private - * @returns {Promise} + * @return {Promise} */ function getHostConfig(callback) { const host = findElementWithSelectorUpwards(this, "monster-host"); @@ -804,7 +804,7 @@ function initGridAndStructs(hostConfig, headerOrderMap) { /** * @private - * @returns {string} + * @return {string} */ export function getStoredOrderConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "stored-order"); diff --git a/source/components/datatable/datatable/header.mjs b/source/components/datatable/datatable/header.mjs index 2848e98941c26eb78afe2f7be02f7a6ef6db09f4..e66839454fd22278c9c1b7d33209a2b45f37bbf2 100644 --- a/source/components/datatable/datatable/header.mjs +++ b/source/components/datatable/datatable/header.mjs @@ -82,7 +82,7 @@ class Header extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datatable/header@@instance"); @@ -90,7 +90,7 @@ class Header extends Base { /** * - * @returns {object} + * @return {object} */ get internalDefaults() { return { @@ -174,14 +174,14 @@ class Header extends Base { } /** - * @returns {string} + * @return {string} */ get labelKey() { return this.getInternal("labelKey"); } /** - * @returns {string} + * @return {string} */ get html() { return this.getInternal("html"); @@ -192,42 +192,42 @@ class Header extends Base { } /** - * @returns {string} + * @return {string} */ get field() { return this.getInternal("field"); } /** - * @returns {string} + * @return {string} */ get index() { return this.getInternal("index"); } /** - * @returns {string} + * @return {string} */ get classes() { return this.getInternal("classes"); } /** - * @returns {string} + * @return {string} */ get label() { return this.getInternal("label"); } /** - * @returns {string} + * @return {string} */ get direction() { return this.getInternal("direction"); } /** - * @returns {string} + * @return {string} */ get mode() { return this.getInternal("mode"); @@ -237,7 +237,7 @@ class Header extends Base { /** * @private * @param {Array<Header>} headers - * @returns {string} + * @return {string} */ function createOrderStatement(headers) { validateIterable(headers); diff --git a/source/components/datatable/embedded-pagination.mjs b/source/components/datatable/embedded-pagination.mjs index 8c2f28b3729f0baef82af818c5729e4bf4d6e4ef..039ee0fd507ee919049780ef1ee0c4e19c59097f 100644 --- a/source/components/datatable/embedded-pagination.mjs +++ b/source/components/datatable/embedded-pagination.mjs @@ -62,7 +62,7 @@ export { EmbeddedPagination }; class EmbeddedPagination extends Pagination { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/embedded-pagination"); @@ -93,7 +93,7 @@ class EmbeddedPagination extends Pagination { /** * @private - * @returns {CSSStyleSheet} + * @return {CSSStyleSheet} */ static getControlCSSStyleSheet() { return EmbeddedPaginationStyleSheet; diff --git a/source/components/datatable/filter-button.mjs b/source/components/datatable/filter-button.mjs index b11111276a2fbda454c52c11700207cf25865946..f86991123d0a4ee589d39cbe20a5bd5f3f951b7a 100644 --- a/source/components/datatable/filter-button.mjs +++ b/source/components/datatable/filter-button.mjs @@ -63,7 +63,7 @@ export { FilterButton }; class FilterButton extends ToggleButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter-button@@instance"); diff --git a/source/components/datatable/filter.mjs b/source/components/datatable/filter.mjs index 737035d0f13f7abc75c2ba9c787db5429991c864..7cf4d893fee8209d8c6586c7c221637c6d464a47 100644 --- a/source/components/datatable/filter.mjs +++ b/source/components/datatable/filter.mjs @@ -162,7 +162,7 @@ class Filter extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter@@instance"); @@ -171,7 +171,7 @@ class Filter extends CustomElement { /** * * @param {string} message - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ showFailureMessage(message) { this[searchButtonElementSymbol].setState( @@ -186,7 +186,7 @@ class Filter extends CustomElement { /** * - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ resetFailureMessage() { this[searchButtonElementSymbol].hideMessage(); @@ -196,7 +196,7 @@ class Filter extends CustomElement { /** * - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ showSuccess() { this[searchButtonElementSymbol].setState( @@ -458,7 +458,7 @@ function initFilter() { /** * * @param {string} input - * @returns {*} + * @return {*} */ function escapeAttributeValue(input) { if (input === undefined || input === null) { @@ -476,7 +476,7 @@ function escapeAttributeValue(input) { /** * * @param {HTMLElement} element - * @returns {boolean} + * @return {boolean} */ function getVisibilityFromSlotAttribute(element) { return !( @@ -832,7 +832,7 @@ function updateFilterTabs() { /** * @private * @param showEffect - * @returns {Promise<*>} + * @return {Promise<*>} */ function doSearch({ showEffect } = { showEffect: true }) { this.resetFailureMessage(); @@ -909,7 +909,7 @@ function doSearch({ showEffect } = { showEffect: true }) { /** * @private * @param queries - * @returns {*|string} + * @return {*|string} */ function buildSearchQuery(queries) { if (!isArray(queries) || queries.length === 0) { @@ -931,7 +931,7 @@ function buildSearchQuery(queries) { /** * @private - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function collectSearchQueries() { const currentHash = parseBracketedKeyValueHash(getGlobal().location.hash); @@ -1041,7 +1041,7 @@ function collectSearchQueries() { /** * @private * @param label - * @returns {null|Array|undefined|string} + * @return {null|Array|undefined|string} */ function getControlValuesFromLabel(label) { const foundControl = label.firstElementChild; @@ -1080,7 +1080,7 @@ function getControlValuesFromLabel(label) { /** * @private - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function initFromConfig() { const host = findElementWithSelectorUpwards(this, "monster-host"); diff --git a/source/components/datatable/filter/date-range.mjs b/source/components/datatable/filter/date-range.mjs index f142c44adc1ea4aeaf576563852ed82d431d48e7..ec293bf44b1e6cb29eff70f9958398a02ab9c2c1 100644 --- a/source/components/datatable/filter/date-range.mjs +++ b/source/components/datatable/filter/date-range.mjs @@ -149,7 +149,7 @@ class DateRange extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -178,7 +178,7 @@ class DateRange extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; @@ -190,7 +190,7 @@ class DateRange extends AbstractBase { * * The individual configuration values can be found in the table. * - * @returns {Object} + * @return {Object} * * @property {Object} templates * @property {string} templates.main @@ -627,7 +627,7 @@ function clearAndDisableFormGroups() { /** * @private - * @returns {string} + * @return {string} */ function guessRangeTypeFromCurrentValue() { const value = this[inputElementSymbol].value.trim(); @@ -686,7 +686,7 @@ function getRangeTypeFromForm() { * * @param {string} date * @param {string} unit (day, month, year, week) - * @returns {number} range + * @return {number} range */ function calculateDateRangeFromToday(date, unit) { // calculate the date of today -1 diff --git a/source/components/datatable/filter/input.mjs b/source/components/datatable/filter/input.mjs index 32aaaf6dcebcf9871f9f39554a87d2e5a16e4e4b..a4314d4bbc3d740a7f52e2422dfac43c876f6f09 100644 --- a/source/components/datatable/filter/input.mjs +++ b/source/components/datatable/filter/input.mjs @@ -75,7 +75,7 @@ const inputElementSymbol = Symbol("inputElement"); class Input extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter/input@@instance"); @@ -139,7 +139,7 @@ class Input extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; diff --git a/source/components/datatable/filter/range.mjs b/source/components/datatable/filter/range.mjs index c08daa92a96fd1fbdbb2ed9d2ff994e576a9fe7f..0882bef6d6dc971b35d42af59dfd8d0474569882 100644 --- a/source/components/datatable/filter/range.mjs +++ b/source/components/datatable/filter/range.mjs @@ -121,7 +121,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class Range extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter/range@@instance"); @@ -148,7 +148,7 @@ class Range extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; @@ -160,7 +160,7 @@ class Range extends AbstractBase { * * The individual configuration values can be found in the table. * - * @returns {Object} + * @return {Object} * * @property {Object} templates * @property {string} templates.main diff --git a/source/components/datatable/filter/settings.mjs b/source/components/datatable/filter/settings.mjs index 270154189dab94c8a174c4528f63db8269c0034d..333a71b4a7a6063924944a2cc0537ecb2d905229 100644 --- a/source/components/datatable/filter/settings.mjs +++ b/source/components/datatable/filter/settings.mjs @@ -43,7 +43,7 @@ class Settings extends Base { /** * * @param value - * @returns {*} + * @return {*} */ get(value) { return this.getInternal("option." + value); @@ -55,7 +55,7 @@ class Settings extends Base { * @param value * @param label * @param visible - * @returns {Settings} + * @return {Settings} */ set({ value, label, visible = true }) { let d = this.getInternal("option." + value); @@ -81,7 +81,7 @@ class Settings extends Base { /** * - * @returns {Array} + * @return {Array} */ getOptions() { const option = this.getInternal("option"); @@ -101,7 +101,7 @@ class Settings extends Base { /** * * @param options - * @returns {Settings} + * @return {Settings} */ setOptions(options) { for (const key in options) { @@ -112,7 +112,7 @@ class Settings extends Base { /** * - * @returns {Array} + * @return {Array} */ getSelected() { const option = this.getInternal("option"); diff --git a/source/components/datatable/filter/util.mjs b/source/components/datatable/filter/util.mjs index 8ba260fe4b8a0b50fd3956b68fcdc9bd687d15e2..27628d0d61152c6cf915398585f208a7ade0d1ff 100644 --- a/source/components/datatable/filter/util.mjs +++ b/source/components/datatable/filter/util.mjs @@ -16,7 +16,7 @@ import { generateUniqueConfigKey } from "../../host/util.mjs"; /** * @private - * @returns {string} + * @return {string} */ export function getFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "filter"); @@ -24,7 +24,7 @@ export function getFilterConfigKey() { /** * @private - * @returns {string} + * @return {string} */ export function getStoredFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "stored-filter"); @@ -34,7 +34,7 @@ export function getStoredFilterConfigKey() { * @private * @param {String} str * @param {String} field - * @returns {String} + * @return {String} * @throws {Error} if no field is defined */ export function parseDateInput(str, field) { diff --git a/source/components/datatable/pagination.mjs b/source/components/datatable/pagination.mjs index 93e5ec67c15bdd6422ce4b154ce69c93a1f6b7dc..a74199b879119f577017cc4c225c50ee36d6d0f9 100644 --- a/source/components/datatable/pagination.mjs +++ b/source/components/datatable/pagination.mjs @@ -93,7 +93,7 @@ class Pagination extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/pagination"); @@ -207,7 +207,7 @@ class Pagination extends CustomElement { /** * @private - * @returns {CSSStyleSheet} + * @return {CSSStyleSheet} */ static getControlCSSStyleSheet() { return PaginationStyleSheet; @@ -356,7 +356,7 @@ function handleDataSourceChanges() { * * @param current * @param max - * @returns {object} + * @return {object} */ function buildPagination(current, max) { let prev = current === 1 ? null : current - 1; diff --git a/source/components/datatable/save-button.mjs b/source/components/datatable/save-button.mjs index d8ea18701701b0ba211178f3dbb7439d88b00067..6220fadf301111fb6f8f2bc4b1162a6b78ec4187 100644 --- a/source/components/datatable/save-button.mjs +++ b/source/components/datatable/save-button.mjs @@ -61,7 +61,7 @@ const badgeElementSymbol = Symbol("badgeElement"); class SaveButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/datatable/status.mjs b/source/components/datatable/status.mjs index 8fe2b4e4e692ec241ba118e1a13569ec7d11951d..b14852b9c09db99d4c91a23a96bee1e42a86c860 100644 --- a/source/components/datatable/status.mjs +++ b/source/components/datatable/status.mjs @@ -86,7 +86,7 @@ class DatasourceStatus extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/action-button.mjs b/source/components/form/action-button.mjs index d40efe53a4191946d3a19c7a4f27c7c654b0bd74..1834be3eb33679e789c7d8e68be8b9d754e51a8e 100644 --- a/source/components/form/action-button.mjs +++ b/source/components/form/action-button.mjs @@ -88,7 +88,7 @@ const containerElementSymbol = Symbol("containerElement"); class ActionButton extends PopperButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/api-button.mjs b/source/components/form/api-button.mjs index 47b25c7bd55f15b45b065ed08ecb71f42c02363c..fd43c8df1ccde8da1f98c022f32f79c17ac7e895 100644 --- a/source/components/form/api-button.mjs +++ b/source/components/form/api-button.mjs @@ -101,7 +101,7 @@ const containerElementSymbol = Symbol("containerElement"); class ApiButton extends ActionButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/api-button@@instance"); diff --git a/source/components/form/button-bar.mjs b/source/components/form/button-bar.mjs index a60675d0765c1125e84faf0b4253df75874c1583..ed795280df267806364d62a7d723c2906a90be88 100644 --- a/source/components/form/button-bar.mjs +++ b/source/components/form/button-bar.mjs @@ -173,7 +173,7 @@ const ATTRIBUTE_POPPER_POSITION = "data-monster-popper-position"; class ButtonBar extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/button-bar@@instance"); @@ -324,7 +324,7 @@ class ButtonBar extends CustomElement { /** * @private * @param obj - * @returns {*} + * @return {*} */ function initDefaultsFromAttributes(obj) { if (this.hasAttribute(ATTRIBUTE_POPPER_POSITION)) { diff --git a/source/components/form/confirm-button.mjs b/source/components/form/confirm-button.mjs index 6d78c82757141ae6fa4b821d4178153b94147e1c..fbbcacd4b7d950bb7945775e5f1ff4482aff972b 100644 --- a/source/components/form/confirm-button.mjs +++ b/source/components/form/confirm-button.mjs @@ -104,7 +104,7 @@ const cancelButtonElementSymbol = Symbol("cancelButtonElement"); class ConfirmButton extends PopperButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -192,7 +192,7 @@ class ConfirmButton extends PopperButton { /** * - * @returns {Monster.Components.Form.PopperButton} + * @return {Monster.Components.Form.PopperButton} */ showDialog() { const confirmButtonClass = this.getOption("classes.confirmButton"); @@ -219,7 +219,7 @@ class ConfirmButton extends PopperButton { * * @param {string} state * @param {number} timeout - * @returns {Monster.Components.Form.ConfirmButton} + * @return {Monster.Components.Form.ConfirmButton} */ setConfirmButtonState(state, timeout) { this[confirmButtonElementSymbol].setState(state, timeout); @@ -231,7 +231,7 @@ class ConfirmButton extends PopperButton { * * @param {string} message * @param {number} timeout - * @returns {Monster.Components.Form.ConfirmButton} + * @return {Monster.Components.Form.ConfirmButton} */ showConfirmButtonMessage(message, timeout) { this[confirmButtonElementSymbol].setMessage(message); diff --git a/source/components/form/context-error.mjs b/source/components/form/context-error.mjs index 7eff7ae613db3bacbede9788b5ea78054bbceac5..debd37855afb034bfe74cbb4069eb19713d9793d 100644 --- a/source/components/form/context-error.mjs +++ b/source/components/form/context-error.mjs @@ -80,7 +80,7 @@ class ContextError extends Popper { /** * This method is called by the `instanceof` operator. * - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -157,7 +157,7 @@ class ContextError extends Popper { * * @param message * @param show {boolean|number|string} - If true the dialog is shown immediately. If false the dialog is hidden by default. If a number is specified the dialog is shown for the specified time in milliseconds. - * @returns {ContextError} + * @return {ContextError} */ setErrorMessage(message, show = false) { message = message.trim(); @@ -191,7 +191,7 @@ class ContextError extends Popper { /** * Reset the error message. - * @returns {ContextError} + * @return {ContextError} */ resetErrorMessage() { this.hideDialog(); @@ -202,7 +202,7 @@ class ContextError extends Popper { /** * Returns true if an error message is set. - * @returns {boolean} + * @return {boolean} */ hasErrorMessage() { const c = this.getOption("content"); diff --git a/source/components/form/context-help.mjs b/source/components/form/context-help.mjs index 7d0ea2842f525295a4bd2f9c20d81bb41106d0be..9aea72cb56340bd237b66cfa61d0f66cec730a7c 100644 --- a/source/components/form/context-help.mjs +++ b/source/components/form/context-help.mjs @@ -34,7 +34,7 @@ export { ContextHelp }; class ContextHelp extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/field-set.mjs b/source/components/form/field-set.mjs index 265c5ee57b2af372ad6f02302d9d0e820e504aad..dc74e534409757b509f5b7ef437fc6a83e2af614 100644 --- a/source/components/form/field-set.mjs +++ b/source/components/form/field-set.mjs @@ -81,7 +81,7 @@ const extendedSwitchElementSymbol = Symbol("extendedSwitchElement"); class FieldSet extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/fieldset@@instance"); diff --git a/source/components/form/form.mjs b/source/components/form/form.mjs index 4eff2928ea5253e59748f9bbf825c90bfa223384..06e80fa53204b30cb7b63e9560b8a5b24e0384c5 100644 --- a/source/components/form/form.mjs +++ b/source/components/form/form.mjs @@ -130,7 +130,7 @@ class Form extends DataSet { /** * This method is called when the component is created. * @since 3.70.0 - * @returns {DataSet} + * @return {DataSet} */ refresh() { this.write(); @@ -142,7 +142,7 @@ class Form extends DataSet { * Run reportValidation on all child html form controls. * * @since 2.10.0 - * @returns {boolean} + * @return {boolean} */ reportValidity() { let valid = true; @@ -166,7 +166,7 @@ function initDataSourceHandler() {} /** * @private - * @returns {initEventHandler} + * @return {initEventHandler} */ function initEventHandler() { this[debounceBindSymbol] = {}; diff --git a/source/components/form/message-state-button.mjs b/source/components/form/message-state-button.mjs index 4e7dc0903e59ce73a9bb9cb861bc3acbadc22c76..4594877896530be792f3a33027856ab40c2755c9 100644 --- a/source/components/form/message-state-button.mjs +++ b/source/components/form/message-state-button.mjs @@ -87,7 +87,7 @@ const buttonElementSymbol = Symbol("buttonElement"); class MessageStateButton extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -193,7 +193,7 @@ class MessageStateButton extends Popper { * @param {string|HTMLElement}message * @param {string} title * @param {string} icon - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ setMessage(message, title, icon) { if (isString(message)) { @@ -243,7 +243,7 @@ class MessageStateButton extends Popper { /** * @param {number} timeout - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ showMessage(timeout) { super.showDialog(); @@ -259,7 +259,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ hideMessage() { super.hideDialog(); @@ -268,7 +268,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ toggleMessage() { super.toggleDialog(); @@ -277,7 +277,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Object} + * @return {Object} */ getMessage() { return this.getOption("message"); diff --git a/source/components/form/popper-button.mjs b/source/components/form/popper-button.mjs index a9295cc2ef0d42ef390bc7bf070929a1ef1e522d..bde743f2f579160a389125b9f50f8b54b544719e 100644 --- a/source/components/form/popper-button.mjs +++ b/source/components/form/popper-button.mjs @@ -144,7 +144,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class PopperButton extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/reload.mjs b/source/components/form/reload.mjs index 8df27679fe52e968f8bddd20734931f440439878..d4acf9792f18f3607f2358dad1633aa6e9979e0f 100644 --- a/source/components/form/reload.mjs +++ b/source/components/form/reload.mjs @@ -103,7 +103,7 @@ const intersectionObserverWasInitialized = Symbol("wasInitialized"); class Reload extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/select.mjs b/source/components/form/select.mjs index dbed3026eafb97da03ad6429004a6e2b5e9d8bcf..19c8bc82d70c5fabebcefac9f89d61309777a503 100644 --- a/source/components/form/select.mjs +++ b/source/components/form/select.mjs @@ -274,13 +274,12 @@ const FILTER_POSITION_INLINE = "inline"; * * @fragments /fragments/components/form/select/ * - * @example /examples/components/form/select-simple - * @example /examples/components/form/select-with-options + * @example /examples/components/form/select-with-options Select with options + * @example /examples/components/form/select-multiple Multiple selection + * @example /examples/components/form/select-lazy Lazy load * * @copyright schukai GmbH * @summary A beautiful select control that can make your life easier and also looks good. - * @fires monster-options-set - * @fires monster-selected * @fires monster-change * @fires monster-changed */ @@ -295,7 +294,7 @@ class Select extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {Symbol} + * @return {Symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/select@@instance"); @@ -311,7 +310,7 @@ class Select extends CustomControl { * // ↦ ['1','2'] * ``` * - * @returns {string} + * @return {string} */ get value() { return convertSelectionToValue.call(this, this.getOption("selection")); @@ -335,6 +334,7 @@ class Select extends CustomControl { * * @property {string|array} value * @throws {Error} unsupported type + * @fires monster-selected this event is fired when the selection is set */ set value(value) { const result = convertValueToSelection.call(this, value); @@ -555,7 +555,7 @@ class Select extends CustomControl { /** * - * @returns {*} + * @return {*} * @throws {Error} storeFetchedData is not enabled * @since 3.66.0 */ @@ -745,6 +745,7 @@ class Select extends CustomControl { * @return {Select} * @throws {Error} map is not iterable * @throws {Error} missing label configuration + * @fires monster-options-set this event is fired when the options are set */ importOptions(data) { const mappingOptions = this.getOption("mapping", {}); @@ -1168,7 +1169,7 @@ function getDefaultTranslation() { /** * @private - * @returns {string|*} + * @return {string|*} */ function setSummaryAndControlText() { const translations = getDefaultTranslation.call(this); @@ -1493,7 +1494,7 @@ function handleFilterKeyboardEvents(event) { * @name handleFilterKeyEvents * * @private - * @returns {void} This method does not return anything. + * @return {void} This method does not return anything. */ function handleFilterKeyEvents() { if (this[keyFilterEventSymbol] instanceof DeadMansSwitch) { @@ -1629,7 +1630,7 @@ function handleOptionKeyboardEvents(event) { /** * @private - * @returns {string} + * @return {string} */ function getFilterMode() { switch (this.getOption("filter.mode")) { diff --git a/source/components/form/shadow-reload.mjs b/source/components/form/shadow-reload.mjs index ea105cd175f1b7a7a2119c4d7475d83b11cce03d..42d4f80f6273999e147a6bd6192ca7851458b5cc 100644 --- a/source/components/form/shadow-reload.mjs +++ b/source/components/form/shadow-reload.mjs @@ -33,7 +33,7 @@ export { ShadowReload }; class ShadowReload extends Reload { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/shadow-reload"); diff --git a/source/components/form/state-button.mjs b/source/components/form/state-button.mjs index 60d42f74fbd70acd899c81ad3fedf39b12f1e846..7a8b0d813dae4e696096165d38e7ee01a8e0cada 100644 --- a/source/components/form/state-button.mjs +++ b/source/components/form/state-button.mjs @@ -36,7 +36,7 @@ export { StateButton }; class StateButton extends Button { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/template.mjs b/source/components/form/template.mjs index 7724ab5b6675c816f4c0f9c781f471ec70445ff7..d5d02790d063ee8793678435555628b3db1df327 100644 --- a/source/components/form/template.mjs +++ b/source/components/form/template.mjs @@ -52,7 +52,7 @@ const intersectionObserverWasInitialized = Symbol("wasInitialized"); class Template extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/toggle-switch.mjs b/source/components/form/toggle-switch.mjs index 1e3521e0702b39ff0a04d3edaf883cb4d56a9c0a..c00374d9b901e1ba839cbb3120075e6641347e6d 100644 --- a/source/components/form/toggle-switch.mjs +++ b/source/components/form/toggle-switch.mjs @@ -295,7 +295,7 @@ class ToggleSwitch extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/tree-select.mjs b/source/components/form/tree-select.mjs index 7cfe3dfb214749ada3fc9a15147bd8e55507b837..1dd223cd7de70337734e54e359c7e500537e4bbd 100644 --- a/source/components/form/tree-select.mjs +++ b/source/components/form/tree-select.mjs @@ -70,7 +70,7 @@ const keyEventHandler = Symbol("keyEventHandler"); class TreeSelect extends Select { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/util/floating-ui.mjs b/source/components/form/util/floating-ui.mjs index 0986d11788d84d8468c2c71aa627300f7732eafa..446a24d206f11a5c405fb80800ad38a8ea57401e 100644 --- a/source/components/form/util/floating-ui.mjs +++ b/source/components/form/util/floating-ui.mjs @@ -34,7 +34,7 @@ export { positionPopper }; * @param controlElement * @param popperElement * @param options - * @returns {Promise|*} + * @return {Promise|*} */ function positionPopper(controlElement, popperElement, options) { const body = getDocument().body; diff --git a/source/components/host/call-button.mjs b/source/components/host/call-button.mjs index 746ee0fda8f2f23e0925ca2df1bbee35571a81c6..541b971675f1104bc8e04661b7482b5f66b03eb4 100644 --- a/source/components/host/call-button.mjs +++ b/source/components/host/call-button.mjs @@ -88,7 +88,7 @@ const ATTRIBUTE_CALL = `${ATTRIBUTE_PREFIX}call`; class CallButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/call-button@@instance"); diff --git a/source/components/host/config-manager.mjs b/source/components/host/config-manager.mjs index cdc6aa44df21c0ba47990917b300de514db35650..aab8bebf6483f82f2efdb6b8a9f617c1c65211d2 100644 --- a/source/components/host/config-manager.mjs +++ b/source/components/host/config-manager.mjs @@ -90,7 +90,7 @@ const MODE_READ_WRITE = "readwrite"; class ConfigManager extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/config-manager@@instance"); @@ -109,7 +109,7 @@ class ConfigManager extends CustomElement { } /** - * @returns {Promise} + * @return {Promise} */ ready() { return Promise.all(this[initializedPromiseSymbol]); @@ -142,7 +142,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ getConfig(key) { return this.ready().then(() => { @@ -152,7 +152,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key - * @returns {Promise<boolean>} + * @return {Promise<boolean>} */ hasConfig(key) { return this.ready() @@ -170,7 +170,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key * @param {*} value - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ setConfig(key, value) { return this.ready().then(() => { @@ -266,7 +266,7 @@ function getObjectStore(mode) { } /** - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function clearObjectStore() { const store = getObjectStore.call(this, "readwrite"); diff --git a/source/components/host/host.mjs b/source/components/host/host.mjs index 59b9537094a4927c0267f909e2af370705d79d41..9987dd61fa8892d596f034b7b8f08410b69e8d80 100644 --- a/source/components/host/host.mjs +++ b/source/components/host/host.mjs @@ -113,7 +113,7 @@ const resourceManagerSymbol = Symbol("resourceManager"); class Host extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/Host@@instance"); @@ -139,7 +139,7 @@ class Host extends CustomElement { /** * @param key - * @returns {Promise} + * @return {Promise} */ getConfig(key) { if (this[configManagerElementSymbol] instanceof HTMLElement === false) { @@ -166,7 +166,7 @@ class Host extends CustomElement { * * @param {string} key * @param {*} value - * @returns {Promise} + * @return {Promise} */ setConfig(key, value) { if (this[configManagerElementSymbol] instanceof HTMLElement === false) { @@ -287,7 +287,7 @@ class Host extends CustomElement { /** * @see {@link https://monsterjs.org/en/doc/monster/Monster.DOM.FocusManager.html|Monster.DOM.FocusManager} - * @returns {*} + * @return {*} */ get focusManager() { return this[focusManagerSymbol]; @@ -295,7 +295,7 @@ class Host extends CustomElement { /** * @see {@link https://monsterjs.org/en/doc/monster/Monster.DOM.ResourceManager.html|Monster.DOM.ResourceManager} - * @returns {*} + * @return {*} */ get resourceManager() { return this[resourceManagerSymbol]; @@ -303,7 +303,7 @@ class Host extends CustomElement { /** * - * @returns {Monster.Components.Host.Host} + * @return {Monster.Components.Host.Host} * @throws {Error} There is no overlay element defined. */ toggleOverlay() { @@ -358,7 +358,7 @@ class Host extends CustomElement { /** * - * @returns {Monster.I18n.Locale} + * @return {Monster.I18n.Locale} */ get locale() { return getLocaleOfDocument(); @@ -366,7 +366,7 @@ class Host extends CustomElement { /** * - * @returns {Translations} + * @return {Translations} */ get translations() { return getDocumentTranslations(); diff --git a/source/components/host/overlay.mjs b/source/components/host/overlay.mjs index c2f0ee1b0e760e5c5743d39684482899fb36212c..803740731bcfc75bb177589ddd30f2d12487a25d 100644 --- a/source/components/host/overlay.mjs +++ b/source/components/host/overlay.mjs @@ -112,7 +112,7 @@ const ATTRIBUTE_VALUE_OVERLAY_OPEN = "overlay-open"; class Overlay extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/host/overlay@@instance"); @@ -182,7 +182,7 @@ class Overlay extends CustomElement { /** * - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -193,7 +193,7 @@ class Overlay extends CustomElement { /** * - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ toggle() { if (this[overlayElementSymbol].classList.contains("open")) { @@ -205,7 +205,7 @@ class Overlay extends CustomElement { } /** - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} * @fires monster-overlay-before-open * @fires monster-overlay-open * @fires monster-overlay-before-close @@ -227,7 +227,7 @@ class Overlay extends CustomElement { } /** - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ close() { fireCustomEvent(this, "monster-overlay-before-close", {}); diff --git a/source/components/host/toggle-button.mjs b/source/components/host/toggle-button.mjs index b370e0f4cfeab5bf38e80bb7f30c818b554a3dec..81915dd17ac6a1cae9f7768c115786930c54a33b 100644 --- a/source/components/host/toggle-button.mjs +++ b/source/components/host/toggle-button.mjs @@ -62,7 +62,7 @@ export { ToggleButton }; class ToggleButton extends CallButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/toggle-button@instance"); diff --git a/source/components/host/util.mjs b/source/components/host/util.mjs index bf56fad58e553c93a4348bbb15f74b355eb5a0c2..0529e060993fadc759a02a1270389f4d67fddae5 100644 --- a/source/components/host/util.mjs +++ b/source/components/host/util.mjs @@ -25,7 +25,7 @@ export { generateUniqueConfigKey }; * @param {string} componentName - The name of the component. * @param {string} id - A unique identifier for the component. * @param {string} prefix - A prefix to use in the unique key. - * @returns {string} The generated unique configuration key. + * @return {string} The generated unique configuration key. */ function generateUniqueConfigKey(componentName, id, prefix) { // Get the browser location without parameters diff --git a/source/components/host/viewer.mjs b/source/components/host/viewer.mjs index 0b6724dbad4b377c8bb7d2613757b0113f7bba62..9389edb6cc2ba0b82be96a2a62da9f1266454bd6 100644 --- a/source/components/host/viewer.mjs +++ b/source/components/host/viewer.mjs @@ -67,7 +67,7 @@ const viewerElementSymbol = Symbol("viewerElement"); class Viewer extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/host/viewer@@instance"); @@ -209,7 +209,7 @@ class Viewer extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -237,7 +237,7 @@ class Viewer extends CustomElement { /** * @private * @param variable - * @returns {boolean} + * @return {boolean} */ function isURL(variable) { try { @@ -251,7 +251,7 @@ function isURL(variable) { /** * @private * @param variable - * @returns {boolean} + * @return {boolean} */ function isBlob(variable) { return variable instanceof Blob; @@ -260,7 +260,7 @@ function isBlob(variable) { /** * @private * @param blob - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function blobToText(blob) { return new Promise((resolve, reject) => { diff --git a/source/components/layout/collapse.mjs b/source/components/layout/collapse.mjs index b951175822ea5817469c22e2bbc2a51e85e75fee..c0bfdcb3f77d23170afe1ed7dacc448aa3df913a 100644 --- a/source/components/layout/collapse.mjs +++ b/source/components/layout/collapse.mjs @@ -93,7 +93,7 @@ const nameSymbol = Symbol("name"); class Collapse extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/collapse@@instance"); @@ -143,7 +143,7 @@ class Collapse extends CustomElement { /** * - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -158,7 +158,7 @@ class Collapse extends CustomElement { } /** - * @returns {void} + * @return {void} */ connectedCallback() { super.connectedCallback(); @@ -166,14 +166,14 @@ class Collapse extends CustomElement { } /** - * @returns {void} + * @return {void} */ disconnectedCallback() { super.disconnectedCallback(); } /** - * @returns {Collapse} + * @return {Collapse} */ toggle() { if (this[detailsElementSymbol].classList.contains("active")) { @@ -185,14 +185,14 @@ class Collapse extends CustomElement { } /** - * @returns {boolean} + * @return {boolean} */ isClosed() { return !this[detailsElementSymbol].classList.contains("active"); } /** - * @returns {boolean} + * @return {boolean} */ isOpen() { return !this.isClosed(); @@ -200,7 +200,7 @@ class Collapse extends CustomElement { /** * Open the collapse - * @returns {Collapse} + * @return {Collapse} * @fires monster-collapse-before-open This event is fired before the collapse is opened. * @fires monster-collapse-open This event is fired after the collapse is opened. */ @@ -244,7 +244,7 @@ class Collapse extends CustomElement { /** * Close the collapse - * @returns {Collapse} + * @return {Collapse} * @fires monster-collapse-before-close This event is fired before the collapse is closed. * @fires monster-collapse-closed This event is fired after the collapse is closed. */ @@ -294,7 +294,7 @@ class Collapse extends CustomElement { /** * @private - * @returns {void} + * @return {void} */ function adjustHeight() { let height = 0; @@ -400,7 +400,7 @@ function initControlReferences() { /** * @private - * @returns {string} + * @return {string} */ function getConfigKey() { return generateUniqueConfigKey(this[nameSymbol], this.id, "state"); @@ -435,7 +435,7 @@ function updateStateConfig() { /** * @private - * @returns {Promise} + * @return {Promise} */ function initStateFromHostConfig() { if (!this.getOption("features.persistState")) { diff --git a/source/components/layout/details.mjs b/source/components/layout/details.mjs index d1af73b60e2f9e4d01449f86676de0ca4a81ee60..ae2e8e8c7f8303cda1b3539f779165311be4b330 100644 --- a/source/components/layout/details.mjs +++ b/source/components/layout/details.mjs @@ -55,7 +55,7 @@ const buttonEventHandlerSymbol = Symbol("buttonEventHandler"); class Details extends Collapse { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/details@@instance"); @@ -93,7 +93,7 @@ class Details extends Collapse { } /** - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -104,7 +104,7 @@ class Details extends Collapse { } /** - * @returns {void} + * @return {void} */ connectedCallback() { super.connectedCallback(); @@ -127,7 +127,7 @@ class Details extends Collapse { } /** - * @returns {Array<CSSStyleSheet>} + * @return {Array<CSSStyleSheet>} */ static getCSSStyleSheet() { const css = super.getCSSStyleSheet(); @@ -210,7 +210,7 @@ function initButtonLabel() { /** * @private - * @returns {string} + * @return {string} */ function getConfigKey() { return generateUniqueConfigKey("details", this.id, "state"); diff --git a/source/components/layout/iframe.mjs b/source/components/layout/iframe.mjs index 13ad44997c560dcaa17e5f4af68bb409da05cb8f..30179966dcd3a485868b14059cd0ecffee39f2d2 100644 --- a/source/components/layout/iframe.mjs +++ b/source/components/layout/iframe.mjs @@ -69,7 +69,7 @@ const timerCallbackSymbol = Symbol("timerCallback"); class Iframe extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/iframe@@instance"); @@ -191,7 +191,7 @@ function calcHeight() { /** * Calculate the maximum height of an element based on the window's inner height * @param element - * @returns {*} + * @return {*} */ function calculateMaximumHeight(element) { let totalBottomBorder = 0; diff --git a/source/components/layout/panel.mjs b/source/components/layout/panel.mjs index bb460eb95d6b896b7e8dec13a62bdd29ff808221..a20340a9d953ca27148793558199b80961ad3bc5 100644 --- a/source/components/layout/panel.mjs +++ b/source/components/layout/panel.mjs @@ -57,7 +57,7 @@ const timerCallbackSymbol = Symbol("timerCallback"); class Panel extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/panel"); @@ -84,7 +84,7 @@ class Panel extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -152,7 +152,7 @@ function calcHeight() { /** * Calculate the maximum height of an element based on the window's inner height * @param element - * @returns {*} + * @return {*} */ function calculateMaximumHeight(element) { let totalBottomBorder = 0; diff --git a/source/components/layout/popper.mjs b/source/components/layout/popper.mjs index cc3ba14f2944db46f54d1762f9efb31215cbd693..657c77adf3bd56900e7c7071d8e24c93d6fe4652 100644 --- a/source/components/layout/popper.mjs +++ b/source/components/layout/popper.mjs @@ -98,7 +98,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class Popper extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/popper@@instance"); diff --git a/source/components/layout/slider.mjs b/source/components/layout/slider.mjs index 941de3326d0b335c05b296725c1f37baba6576a9..75841609220a6bcaa2569cee2a1c253d6ff20b5d 100644 --- a/source/components/layout/slider.mjs +++ b/source/components/layout/slider.mjs @@ -74,7 +74,7 @@ const ATTRIBUTE_CLONE_FROM = ATTRIBUTE_PREFIX + "clone-from"; class Slider extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/slider@@instance"); @@ -170,7 +170,7 @@ class Slider extends CustomElement { * moves the slider to the given index * * @param index - * @returns {void} + * @return {void} */ moveTo(index) { return moveTo.call(this, index); @@ -366,7 +366,7 @@ function initCarousel() { /** * @private - * @returns {{slides: unknown[], totalSlides: number}} + * @return {{slides: unknown[], totalSlides: number}} */ function getSlidesAndTotal() { const slides = Array.from(getSlottedElements.call(this, ":scope", null)); @@ -376,7 +376,7 @@ function getSlidesAndTotal() { /** * @private - * @returns {number} + * @return {number} */ function next() { const { slides, totalSlides } = getSlidesAndTotal.call(this); @@ -399,7 +399,7 @@ function next() { /** * @private - * @returns {number} + * @return {number} */ function prev() { const prevIndex = this[configSymbol].currentIndex - 1; @@ -584,7 +584,7 @@ function startDragging(e, type) { * @private * @param e * @param type - * @returns {*|number|number} + * @return {*|number|number} */ function getPositionX(e, type) { return type === "mouse" ? e.pageX : e.touches[0].clientX; diff --git a/source/components/layout/split-panel.mjs b/source/components/layout/split-panel.mjs index bcf687e75ae54c055fd09f30c08dec59b8ef4518..e624fd18e858ce2dac901fcc844a8b5aac9ca895 100644 --- a/source/components/layout/split-panel.mjs +++ b/source/components/layout/split-panel.mjs @@ -80,7 +80,7 @@ const TYPE_HORIZONTAL = "horizontal"; class SplitPanel extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/split-panel"); @@ -151,7 +151,7 @@ class SplitPanel extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); diff --git a/source/components/layout/tabs.mjs b/source/components/layout/tabs.mjs index 160e0e47eff5a9d7336ef4b1e0abe9d608ac0c9a..99b441a576f8dda8b7870340e3ae85e6e2ec2804 100644 --- a/source/components/layout/tabs.mjs +++ b/source/components/layout/tabs.mjs @@ -154,8 +154,7 @@ const resizeObserverSymbol = Symbol("resizeObserver"); class Tabs extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} - * @since 1.10.0 + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/tabs"); @@ -316,7 +315,7 @@ class Tabs extends CustomElement { * * The tabs have to be named with the `data-monster-name` attribute. * - * @returns {string|null} + * @return {string|null} */ getActiveTab() { const nodes = getSlottedElements.call(this); diff --git a/source/components/layout/width-toggle.mjs b/source/components/layout/width-toggle.mjs index 24ed6c8c0b2c767a0686f4b5f059e7dcd7fc61ed..5dd08a0bf3011187ab290ced52dd22d814dce60f 100644 --- a/source/components/layout/width-toggle.mjs +++ b/source/components/layout/width-toggle.mjs @@ -70,7 +70,7 @@ const MODE_WIDE = "wide"; class WidthToggle extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -106,7 +106,7 @@ class WidthToggle extends CustomElement { } /** - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -126,7 +126,7 @@ class WidthToggle extends CustomElement { /** * @param {string} mode - * @returns {WidthToggle} + * @return {WidthToggle} * @throws {Error} no shadow-root is defined */ setWidth(mode) { @@ -143,7 +143,7 @@ class WidthToggle extends CustomElement { } /** - * @returns {CSSStyleSheet[]} + * @return {CSSStyleSheet[]} */ static getCSSStyleSheet() { return [WidthToggleStyleSheet]; diff --git a/source/components/navigation/table-of-content.mjs b/source/components/navigation/table-of-content.mjs index 39d6dc961217a1a405112bb55a1233ed329fc8d7..6f44fa43fbfd3f51a293a08c44c29399c67ca199 100644 --- a/source/components/navigation/table-of-content.mjs +++ b/source/components/navigation/table-of-content.mjs @@ -83,7 +83,7 @@ const scrollableEventHandlerSymbol = Symbol("scrollableEventHandler"); class TableOfContent extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -354,7 +354,7 @@ function initNavigation() { * Recursively creates a nested list (UL) from a list of heading elements. * @param {HTMLElement[]} nodeList - The list of heading elements. * @param {number} currentLevel - The current heading level we are processing. - * @returns {{sublist: HTMLUListElement, lastIndex: number}} An object containing the sublist and the index of the last processed element. + * @return {{sublist: HTMLUListElement, lastIndex: number}} An object containing the sublist and the index of the last processed element. */ function createListFromHeadings(nodeList, currentLevel = 1) { const self = this; @@ -409,7 +409,7 @@ function createListFromHeadings(nodeList, currentLevel = 1) { /** * @private - * @returns {*[]} + * @return {*[]} */ function getHeadings() { const allHeadings = []; diff --git a/source/components/state/log.mjs b/source/components/state/log.mjs index 23e819551db995d0fc1ef6e54227727739993b59..cae22b4ca2038e4f2ac430700a194ddffaea2fb0 100644 --- a/source/components/state/log.mjs +++ b/source/components/state/log.mjs @@ -96,7 +96,7 @@ class Log extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/state/log@@instance"); @@ -153,7 +153,7 @@ class Log extends CustomElement { /** * Add an entry to the log * @param entry - * @returns {Log} + * @return {Log} */ addEntry(entry) { validateInstance(entry, Entry); @@ -171,7 +171,7 @@ class Log extends CustomElement { * Add a log message * @param message * @param date - * @returns {Log} + * @return {Log} */ addMessage(message, date) { if (!date) { diff --git a/source/components/state/log/entry.mjs b/source/components/state/log/entry.mjs index fb70caddb400a4703d9c6637d8ee35a9e55c426e..925edee9efdf33ff2a55569ee1fac63315b05660 100644 --- a/source/components/state/log/entry.mjs +++ b/source/components/state/log/entry.mjs @@ -55,7 +55,7 @@ class Entry extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-state/log/entry"); @@ -63,7 +63,7 @@ class Entry extends Base { /** * - * @returns {object} + * @return {object} */ get internalDefaults() { return { @@ -75,7 +75,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get title() { return this.getInternal("title"); @@ -89,7 +89,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get message() { return this.getInternal("message"); @@ -103,7 +103,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get user() { return this.getInternal("user"); @@ -117,7 +117,7 @@ class Entry extends Base { } /** - * @returns {Date} + * @return {Date} */ get date() { return this.getInternal("date"); diff --git a/source/components/state/state.mjs b/source/components/state/state.mjs index 3a6c43d1d64082ff1592ab1e50cccee443a97e97..18639e9dddc95f1da72aab1824e3d9dd32b50ffd 100644 --- a/source/components/state/state.mjs +++ b/source/components/state/state.mjs @@ -50,7 +50,7 @@ class State extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/state/state@@instance"); diff --git a/source/components/tree-menu/tree-menu.mjs b/source/components/tree-menu/tree-menu.mjs index dabf74c3a6b0214c9751a9ad4882df85488f3c29..2024058c34d80be38f731a9102280207dc1a0fcb 100644 --- a/source/components/tree-menu/tree-menu.mjs +++ b/source/components/tree-menu/tree-menu.mjs @@ -80,7 +80,7 @@ const openEntryEventHandlerSymbol = Symbol("openEntryEventHandler"); class TreeMenu extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/tree-menu@@instance"); diff --git a/source/constraints/abstract.mjs b/source/constraints/abstract.mjs index fd093c362f3494e63d7986d3bda3e67d784f7eb2..8d23b69eba7aa6d7cabf96fde11bea2800580026 100644 --- a/source/constraints/abstract.mjs +++ b/source/constraints/abstract.mjs @@ -37,7 +37,7 @@ class AbstractConstraint extends Base { * this method must return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.reject(value); @@ -45,7 +45,7 @@ class AbstractConstraint extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/abstractoperator.mjs b/source/constraints/abstractoperator.mjs index a2b62af6c49f1fb754e23672800ee9db2e9424ef..0aeba69b0f9931b085a97c06d5d1c271addf026f 100644 --- a/source/constraints/abstractoperator.mjs +++ b/source/constraints/abstractoperator.mjs @@ -55,7 +55,7 @@ class AbstractOperator extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/andoperator.mjs b/source/constraints/andoperator.mjs index d62f211d39e8b5de909af86deafd3798cab9bbdd..5c6d584b2d476730efda0ac8ad544eac96ef6b0d 100644 --- a/source/constraints/andoperator.mjs +++ b/source/constraints/andoperator.mjs @@ -35,7 +35,7 @@ class AndOperator extends AbstractOperator { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.all([ @@ -46,7 +46,7 @@ class AndOperator extends AbstractOperator { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/invalid.mjs b/source/constraints/invalid.mjs index 24dbfd11e3071c641cbbdea5f23ae9d9e29a06da..d48adecefc990f99a23edab2109850ce507e262d 100644 --- a/source/constraints/invalid.mjs +++ b/source/constraints/invalid.mjs @@ -35,7 +35,7 @@ class Invalid extends AbstractConstraint { * this method return a rejected promise * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.reject(value); @@ -43,7 +43,7 @@ class Invalid extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/isarray.mjs b/source/constraints/isarray.mjs index 7a60ad94c571d75ea68538f07f411deb76e315bd..6230a55cb3e6b8728e9f9ba2ff181c7554c824e9 100644 --- a/source/constraints/isarray.mjs +++ b/source/constraints/isarray.mjs @@ -34,7 +34,7 @@ class IsArray extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { if (isArray(value)) { @@ -46,7 +46,7 @@ class IsArray extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/isobject.mjs b/source/constraints/isobject.mjs index 7ed4e0f1d9e227512f9144b4fac948384be0227e..6cca890a4862d3b9521462ae2e3d3d3c8a944530 100644 --- a/source/constraints/isobject.mjs +++ b/source/constraints/isobject.mjs @@ -34,7 +34,7 @@ class IsObject extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { if (isObject(value)) { @@ -46,7 +46,7 @@ class IsObject extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/oroperator.mjs b/source/constraints/oroperator.mjs index bd646f05e9c6debbd6e7d29f5f0dd40afd122bbc..d92e65ef58f209040abe2da7925a0f1cd2d94938 100644 --- a/source/constraints/oroperator.mjs +++ b/source/constraints/oroperator.mjs @@ -35,7 +35,7 @@ class OrOperator extends AbstractOperator { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { var self = this; @@ -74,7 +74,7 @@ class OrOperator extends AbstractOperator { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/valid.mjs b/source/constraints/valid.mjs index ca35035d3f3b0448debfe56a2acdb6e3436b6ab2..2dd5cac4bf8ed8db81c233f3cd710a6fbdb89f7f 100644 --- a/source/constraints/valid.mjs +++ b/source/constraints/valid.mjs @@ -35,7 +35,7 @@ class Valid extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.resolve(value); @@ -43,7 +43,7 @@ class Valid extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource.mjs b/source/data/datasource.mjs index cce4b0eeba069eb64c557af07abd082c9c670765..776f52e8e8146f7fb49940496b160ac09449025e 100644 --- a/source/data/datasource.mjs +++ b/source/data/datasource.mjs @@ -52,7 +52,6 @@ const internalDataSymbol = Symbol.for( * @license AGPLv3 * @since 1.22.0 * @copyright schukai GmbH - * @memberOf Monster.Data * @summary The datasource class encapsulates the access to data objects. */ class Datasource extends Base { @@ -74,7 +73,7 @@ class Datasource extends Base { * attach a new observer * * @param {Observer} observer - * @returns {Datasource} + * @return {Datasource} */ attachObserver(observer) { this[internalDataSymbol].attachObserver(observer); @@ -85,7 +84,7 @@ class Datasource extends Base { * detach a observer * * @param {Observer} observer - * @returns {Datasource} + * @return {Datasource} */ detachObserver(observer) { this[internalDataSymbol].detachObserver(observer); @@ -94,7 +93,7 @@ class Datasource extends Base { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[internalDataSymbol].containsObserver(observer); @@ -204,7 +203,7 @@ class Datasource extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/dom.mjs b/source/data/datasource/dom.mjs index 262c03a133e20d56ef065407cfff252f6acdd10a..c6b7588e3e244968f39975883d0d5a54ec10e413 100644 --- a/source/data/datasource/dom.mjs +++ b/source/data/datasource/dom.mjs @@ -40,7 +40,7 @@ class DomStorage extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/storage/dom-storage"); diff --git a/source/data/datasource/server.mjs b/source/data/datasource/server.mjs index d0cfe053b76d7416a01d527fc3fa57b2bf8014bb..ae81ba1a8641512b3f3d292eb5388d7d76a91491 100644 --- a/source/data/datasource/server.mjs +++ b/source/data/datasource/server.mjs @@ -39,7 +39,7 @@ const serverVersionSymbol = Symbol("serverVersion"); class Server extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/server"); @@ -51,7 +51,7 @@ class Server extends Datasource { * * @private * @param {Object} payload - * @returns {Object} + * @return {Object} */ transformServerPayload(payload) { payload = doTransform.call(this, "read", payload); @@ -70,7 +70,7 @@ class Server extends Datasource { * * @private * @param {Object} payload - * @returns {Object} + * @return {Object} */ prepareServerPayload(payload) { payload = doTransform.call(this, "write", payload); @@ -92,7 +92,7 @@ class Server extends Datasource { /** * * @param obj - * @returns {*} + * @return {*} */ function doDiff(obj) { if ( @@ -122,7 +122,7 @@ function doDiff(obj) { * @private * @param {string} type * @param {Object} obj - * @returns {Object} + * @return {Object} */ function doTransform(type, obj) { const transformation = this.getOption(`${type}.mapping.transformer`); diff --git a/source/data/datasource/server/restapi.mjs b/source/data/datasource/server/restapi.mjs index 2ef7c94649d5fbf6feab5fe7bdff8af84e51e8c9..dabfab585c21b7d43e9ce6346dc8401a28d2f0f2 100644 --- a/source/data/datasource/server/restapi.mjs +++ b/source/data/datasource/server/restapi.mjs @@ -56,7 +56,7 @@ class RestAPI extends Server { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -189,7 +189,7 @@ class RestAPI extends Server { * @param init * @param key * @param callback - * @returns {Promise<string>} + * @return {Promise<string>} */ function fetchData(init, key, callback) { let response; diff --git a/source/data/datasource/server/restapi/data-fetch-error.mjs b/source/data/datasource/server/restapi/data-fetch-error.mjs index d27fe0ca168dedf434b59a554e54a245e56f1bf5..b30d1638259352c0bf12cc862b92504292be7604 100644 --- a/source/data/datasource/server/restapi/data-fetch-error.mjs +++ b/source/data/datasource/server/restapi/data-fetch-error.mjs @@ -40,7 +40,7 @@ class DataFetchError extends Error { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/data/datasource/server/restapi/writeerror.mjs b/source/data/datasource/server/restapi/writeerror.mjs index c14e799f59023c2f402d033daa9f9bc965e5c709..7fdfa63a14e383249315157fd65e41b5387c5ac8 100644 --- a/source/data/datasource/server/restapi/writeerror.mjs +++ b/source/data/datasource/server/restapi/writeerror.mjs @@ -42,7 +42,7 @@ class WriteError extends Error { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/server/webconnect.mjs b/source/data/datasource/server/webconnect.mjs index 56490fe6d762593ec1b7334c168d86e57f2d4570..8691c95dfb3bf9cae57d7bdfd0a7ea2fc5ffc132 100644 --- a/source/data/datasource/server/webconnect.mjs +++ b/source/data/datasource/server/webconnect.mjs @@ -67,14 +67,14 @@ class WebConnect extends Server { /** * - * @returns {Promise} + * @return {Promise} */ connect() { return this[webConnectSymbol].connect(); } /** - * @returns {boolean} + * @return {boolean} */ isConnected() { return this[webConnectSymbol].isConnected(); @@ -82,7 +82,7 @@ class WebConnect extends Server { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/server/webconnect"); @@ -142,7 +142,7 @@ class WebConnect extends Server { /** * This method closes the connection. * - * @returns {Promise} + * @return {Promise} */ close() { return this[webConnectSymbol].close(); diff --git a/source/data/datasource/storage.mjs b/source/data/datasource/storage.mjs index 0352fefe2f1c897ba0d52f977ef13d6d7612be77..de225ee57cec25ac8a5858b611fd7a7c0fd82e8f 100644 --- a/source/data/datasource/storage.mjs +++ b/source/data/datasource/storage.mjs @@ -48,7 +48,7 @@ class Storage extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/storage/localstorage.mjs b/source/data/datasource/storage/localstorage.mjs index 0217bdda3a050f52dc7ae47e98fcc4fbf55f2ef3..e77b16c25e64bc3d1b9bed53ccc88ea57ea3e210 100644 --- a/source/data/datasource/storage/localstorage.mjs +++ b/source/data/datasource/storage/localstorage.mjs @@ -40,7 +40,7 @@ class LocalStorage extends Storage { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/storage/sessionstorage.mjs b/source/data/datasource/storage/sessionstorage.mjs index 09e2c079f52ea2e40e23f7e185b0e476b39e4753..c933fbcf8384c13753bcfb0ca096764f1c0abd94 100644 --- a/source/data/datasource/storage/sessionstorage.mjs +++ b/source/data/datasource/storage/sessionstorage.mjs @@ -40,7 +40,7 @@ class SessionStorage extends Storage { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/pathfinder.mjs b/source/data/pathfinder.mjs index c0fd5f10d5d6a648548bb3ffb4d7340674aa9c2c..7b96b5bf9165ca70d48250875f12635675747b5d 100644 --- a/source/data/pathfinder.mjs +++ b/source/data/pathfinder.mjs @@ -81,12 +81,13 @@ const WILDCARD = "*"; * new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}} * ``` * - * @externalExample ../../example/data/pathfinder-1.mjs - * @externalExample ../../example/data/pathfinder-2.mjs + * @example /examples/libraries/pathfinder/example-1/ Example 1 + * @example /examples/libraries/pathfinder/example-2/ Example 2 + * * @license AGPLv3 * @since 1.4.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary Pathfinder is a class to find a path to an object. */ class Pathfinder extends Base { /** @@ -124,7 +125,7 @@ class Pathfinder extends Base { * * @param {string|array} path * @since 1.4.0 - * @returns {*} + * @return {*} * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end * @throws {TypeError} value is not a string @@ -139,7 +140,7 @@ class Pathfinder extends Base { * * @param {string|array} path * @param {*} value - * @returns {Pathfinder} + * @return {Pathfinder} * @since 1.4.0 * @throws {TypeError} unsupported type * @throws {TypeError} value is not a string @@ -155,7 +156,7 @@ class Pathfinder extends Base { * Delete Via Path * * @param {string|array} path - * @returns {Pathfinder} + * @return {Pathfinder} * @since 1.6.0 * @throws {TypeError} unsupported type * @throws {TypeError} value is not a string @@ -226,7 +227,7 @@ function iterate(subject, path, check) { * @param subject * @param path * @param check - * @returns {V|*|Map} + * @return {V|*|Map} * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end * @throws {Error} unsupported action for this data type @@ -306,7 +307,7 @@ function getValueViaPath(subject, path, check) { * @param {object} subject * @param {string|array} path * @param {*} value - * @returns {void} + * @return {void} * @throws {TypeError} unsupported type * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end @@ -405,7 +406,7 @@ function assignProperty(object, key, value) { * * @param {object} subject * @param {string} path - * @returns {void} + * @return {void} * @throws {TypeError} unsupported type * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end diff --git a/source/data/pipe.mjs b/source/data/pipe.mjs index bb959c67fe835ad10673a584ad16727bafd64d82..a381ce46f0736b6f768d2f4eceaf2c6553dde11d 100644 --- a/source/data/pipe.mjs +++ b/source/data/pipe.mjs @@ -32,11 +32,12 @@ const DELIMITER = "|"; * With the Pipe, processing steps can be combined. Here, the value of an object is accessed via the pathfinder (path command). * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char. * - * @externalExample ../../example/data/pipe.mjs + * @example /examples/libraries/pipe/example-1/ + * * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary The pipe class makes it possible to combine several processing steps. */ class Pipe extends Base { /** @@ -56,7 +57,7 @@ class Pipe extends Base { * @param {string} name * @param {function} callback * @param {object} context - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ @@ -72,7 +73,7 @@ class Pipe extends Base { * run a pipe * * @param {*} value - * @returns {*} + * @return {*} */ run(value) { return this.pipe.reduce((accumulator, transformer, currentIndex, array) => { diff --git a/source/data/transformer.mjs b/source/data/transformer.mjs index 89f16eaa2278ea6c5598234992a7ef52789eb562..ff4f31c45b29deccac9a79260e76177a722fb3b4 100644 --- a/source/data/transformer.mjs +++ b/source/data/transformer.mjs @@ -35,21 +35,21 @@ import { Pathfinder } from "./pathfinder.mjs"; export { Transformer }; /** - * The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up. + * The transformer class is a swiss army knife for manipulating values. * * A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used. * - * ``` + * ```js * let t = new Transformer('tolower').run('ABC'); // ↦ abc * ``` * - * @see {@link https://monsterjs.org/en/doc/#transformer|Monster Docs} + * @fragments /fragments/libraries/transformer + * + * @example /examples/libraries/transformer/simple * - * @externalExample ../../example/data/transformer.mjs - * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up. */ class Transformer extends Base { /** @@ -68,7 +68,7 @@ class Transformer extends Base { * @param {string} name * @param {function} callback * @param {object} context - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ @@ -91,7 +91,7 @@ class Transformer extends Base { /** * * @param {*} value - * @returns {*} + * @return {*} * @throws {Error} unknown command * @throws {TypeError} unsupported type * @throws {Error} type not supported @@ -104,7 +104,7 @@ class Transformer extends Base { /** * * @param {string} command - * @returns {array} + * @return {array} * @private */ function disassemble(command) { @@ -149,7 +149,7 @@ function disassemble(command) { * tries to make a string out of value and if this succeeds to return it back * * @param {*} value - * @returns {string} + * @return {string} * @private */ function convertToString(value) { @@ -164,7 +164,7 @@ function convertToString(value) { /** * * @param {*} value - * @returns {*} + * @return {*} * @private * @throws {Error} unknown command * @throws {TypeError} unsupported type @@ -835,6 +835,13 @@ function transform(value) { } } +/** + * converts special strings to their values + * @private + * @param input + * @param value + * @return {undefined|*|null|string} + */ function convertSpecialStrings(input, value) { switch (input) { case "value": @@ -850,6 +857,11 @@ function convertSpecialStrings(input, value) { } } +/** + * checks if a value is true or not + * @param value + * @return {boolean} + */ function evaluateCondition(value) { const lowerValue = typeof value === "string" ? value.toLowerCase() : value; diff --git a/source/dom/assembler.mjs b/source/dom/assembler.mjs index d908915b29880fc6106b5af5dd9a90a56925dd72..f4b93cc40c89c4c3ddd26b5d72a1b6b4d83bde83 100644 --- a/source/dom/assembler.mjs +++ b/source/dom/assembler.mjs @@ -53,7 +53,7 @@ class Assembler extends Base { /** * * @param {string} prefix - * @returns {Assembler} + * @return {Assembler} * @throws {TypeError} value is not a string */ setAttributePrefix(prefix) { @@ -64,7 +64,7 @@ class Assembler extends Base { /** * - * @returns {string} + * @return {string} */ getAttributePrefix() { return this.attributePrefix; diff --git a/source/dom/attributes.mjs b/source/dom/attributes.mjs index b0989ec7b2cd4cf09c0ef684cf219718ed275c13..da4b2a8bee5f87f1d28235ac19454a69505fe045 100644 --- a/source/dom/attributes.mjs +++ b/source/dom/attributes.mjs @@ -65,7 +65,7 @@ function findClosestObjectLink(element) { * @param element * @param symbol * @param object - * @returns {*} + * @return {*} */ function addToObjectLink(element, symbol, object) { validateInstance(element, HTMLElement); @@ -89,7 +89,7 @@ function addToObjectLink(element, symbol, object) { * @memberOf Monster.DOM * @param {HTMLElement} element * @param {Symbol} symbol - * @returns {*} + * @return {*} */ function removeObjectLink(element, symbol) { validateInstance(element, HTMLElement); diff --git a/source/dom/customcontrol.mjs b/source/dom/customcontrol.mjs index 4169dfcb764893b07b95fd9f72fb203cb5ae6cbb..fc68feb3c358193e722166ee6d4df2cb00730526 100644 --- a/source/dom/customcontrol.mjs +++ b/source/dom/customcontrol.mjs @@ -83,7 +83,7 @@ class CustomControl extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/customelement.mjs b/source/dom/customelement.mjs index fd614b4a0e02dac82028e1e69937e81966121f48..af5163ea8cd79854b1dec288208f469cb6ba6938 100644 --- a/source/dom/customelement.mjs +++ b/source/dom/customelement.mjs @@ -119,49 +119,6 @@ const updateCloneDataSymbol = Symbol("@schukai/monster/dom/@@updateCloneData"); */ const scriptHostElementSymbol = Symbol("scriptHostElement"); -/** - * HTMLElement - * @external HTMLElement - * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement - * - * @startuml customelement-sequencediagram.png - * skinparam monochrome true - * skinparam shadowing false - * - * autonumber - * - * Script -> DOM: element = document.createElement('my-element') - * DOM -> CustomElement: constructor() - * CustomElement -> CustomElement: [initMethodSymbol]() - * - * CustomElement --> DOM: Element - * DOM --> Script : element - * - * - * Script -> DOM: document.querySelector('body').append(element) - * - * DOM -> CustomElement : connectedCallback() - * - * note right CustomElement: is only called at\nthe first connection - * CustomElement -> CustomElement : [assembleMethodSymbol]() - * - * ... ... - * - * autonumber - * - * Script -> DOM: document.querySelector('monster-confirm-button').parentNode.removeChild(element) - * DOM -> CustomElement: disconnectedCallback() - * - * - * @enduml - * - * @startuml customelement-class.png - * skinparam monochrome true - * skinparam shadowing false - * HTMLElement <|-- CustomElement - * @enduml - */ - /** * The `CustomElement` class provides a way to define a new HTML element using the power of Custom Elements. * @@ -237,12 +194,12 @@ const scriptHostElementSymbol = Symbol("scriptHostElement"); */ class CustomElement extends HTMLElement { /** - * A new object is created. First the `initOptions` method is called. Here the + * A new object is created. First, the `initOptions` method is called. Here the * options can be defined in derived classes. Subsequently, the shadowRoot is initialized. * * IMPORTANT: CustomControls instances are not created via the constructor, but either via a tag in the HTML or via <code>document.createElement()</code>. * - * @throws {Error} the options attribute does not contain a valid json definition. + * @throws {Error} the option attribute does not contain a valid JSON definition. */ constructor() { super(); @@ -258,7 +215,8 @@ class CustomElement extends HTMLElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -281,7 +239,7 @@ class CustomElement extends HTMLElement { * * @param attribute * @param callback - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} */ addAttributeObserver(attribute, callback) { validateFunction(callback); @@ -292,7 +250,7 @@ class CustomElement extends HTMLElement { /** * * @param attribute - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} */ removeAttributeObserver(attribute) { delete this[attributeObserverSymbol][attribute]; @@ -354,7 +312,7 @@ class CustomElement extends HTMLElement { * * Before you can use this method, you must have loaded the translations. * - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} * @throws {Error} Cannot find an element with translations. Add a translation object to the document. */ updateI18n() { @@ -433,10 +391,12 @@ class CustomElement extends HTMLElement { * Example usage: * * ```js - * static getCSSStyleSheet() { - * const sheet = new CSSStyleSheet(); - * sheet.replaceSync("p { color: red; }"); - * return sheet; + * class MyElement extends CustomElement { + * static getCSSStyleSheet() { + * const sheet = new CSSStyleSheet(); + * sheet.replaceSync("p { color: red; }"); + * return sheet; + * } * } * ``` * @@ -462,7 +422,7 @@ class CustomElement extends HTMLElement { * attach a new observer * * @param {Observer} observer - * @returns {CustomElement} + * @return {CustomElement} */ attachObserver(observer) { this[internalSymbol].attachObserver(observer); @@ -473,7 +433,7 @@ class CustomElement extends HTMLElement { * detach a observer * * @param {Observer} observer - * @returns {CustomElement} + * @return {CustomElement} */ detachObserver(observer) { this[internalSymbol].detachObserver(observer); @@ -482,7 +442,7 @@ class CustomElement extends HTMLElement { /** * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ containsObserver(observer) { return this[internalSymbol].containsObserver(observer); @@ -556,13 +516,18 @@ class CustomElement extends HTMLElement { * This method is called once when the object is equipped with update for the dynamic change of the dom. * The functions returned here can be used as pipe functions in the template. * - * In the example, the function `my-transformer` is defined. In the template you can use it as follows: + * In the example, the function `my-transformer` is defined. In the template, you can use it as follows: * * ```html - * <my-element data-monster-option-transformer="path:my-value | call:my-transformer"></my-element> + * <my-element + * data-monster-option-transformer="path:my-value | call:my-transformer"> + * </my-element> * ``` * - * @example + * The function `my-transformer` is called with the value of `my-value` as a parameter. + * + * ```js + * class MyElement extends CustomElement { * [updaterTransformerMethodsSymbol]() { * return { * "my-transformer": (value) => { @@ -577,6 +542,8 @@ class CustomElement extends HTMLElement { * } * }; * }; + * } + * ``` * * @return {object} * @since 2.43.0 @@ -587,11 +554,13 @@ class CustomElement extends HTMLElement { /** * This method is called once when the object is included in the DOM for the first time. It performs the following actions: - * 1. Extracts the options from the attributes and the script tag of the element and sets them. - * 2. Initializes the shadow root and its CSS stylesheet (if specified). - * 3. Initializes the HTML content of the element. - * 4. Initializes the custom elements inside the shadow root and the slotted elements. - * 5. Attaches a mutation observer to observe changes to the attributes of the element. + * + * <ol> + * <li>Extracts the options from the attributes and the script tag of the element and sets them.</li> + * <li>Initializes the shadow root and its CSS stylesheet (if specified).</li> + * <li>Initializes the HTML content of the element.</li> + * <li>Initializes the custom elements inside the shadow root and the slotted elements.</li> + * <li>Attaches a mutation observer to observe changes to the attributes of the element.</li> * * @return {CustomElement} - The updated custom element. * @since 1.8.0 @@ -672,7 +641,7 @@ class CustomElement extends HTMLElement { * You know what you are doing? This function is only for advanced users. * The result is a clone of the internal data. * - * @returns {*} + * @return {*} */ getInternalUpdateCloneData() { return clone(this[updateCloneDataSymbol]); @@ -764,7 +733,7 @@ class CustomElement extends HTMLElement { * * @param {string} name * @param {*} args - * @returns {*} + * @return {*} */ callCallback(name, args) { return callControlCallback.call(this, name, ...args); @@ -1066,7 +1035,7 @@ function getOptionsFromAttributes() { * * @private * @param {string} data The JSON data to be parsed. - * @returns {Object} The parsed object. + * @return {Object} The parsed object. * @throws {error} Throws an error if the JSON data is not valid. */ function parseOptionsJSON(data) { diff --git a/source/dom/dimension.mjs b/source/dom/dimension.mjs index 171286d2437742e18adacbea3dfa165972cdfc06..376f35766659b7a762d1f81ba6f93e037bbe2987 100644 --- a/source/dom/dimension.mjs +++ b/source/dom/dimension.mjs @@ -21,7 +21,7 @@ export { convertToPixels, getDeviceDPI }; * Stores the DPI of the device. * * @private - * @returns {number} + * @return {number} * @since 3.34.0 * @type {number|function} */ @@ -40,7 +40,7 @@ let CURRENT_DEVICE_DPI = function () { * * @since 3.34.0 * @memberOf Monster.DOM - * @returns {number} + * @return {number} */ function getDeviceDPI() { // only call the function once @@ -72,7 +72,7 @@ function getDeviceDPI() { * @param {string} value * @param {HTMLElement} [parentElement=document.documentElement] * @param {HTMLElement} [fontSizeElement=document.documentElement] - * @returns {number} + * @return {number} * @license AGPLv3 * @since 3.34.0 * @copyright schukai GmbH diff --git a/source/dom/focusmanager.mjs b/source/dom/focusmanager.mjs index 3f8e367257f9064d72f991483fd17d720eea3e64..9356de8ba98e722aec1fd1300bc51d5f89fe262d 100644 --- a/source/dom/focusmanager.mjs +++ b/source/dom/focusmanager.mjs @@ -63,7 +63,7 @@ class FocusManager extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/locale.mjs b/source/dom/locale.mjs index 5b6c8a003ba8595874430a50ff5a7b0bc459ee1d..d3ff7af080c7d8fc1d800dc675dc28eec320733a 100644 --- a/source/dom/locale.mjs +++ b/source/dom/locale.mjs @@ -64,7 +64,7 @@ function getLocaleOfDocument() { /** * @private - * @returns {string|undefined|*} + * @return {string|undefined|*} * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages */ diff --git a/source/dom/resource/data.mjs b/source/dom/resource/data.mjs index b698a9edd2b9667b36b365f2ad39b66151a896d3..63db716329760bc5e69daadbdaeac9285d252803 100644 --- a/source/dom/resource/data.mjs +++ b/source/dom/resource/data.mjs @@ -85,7 +85,7 @@ class Data extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/link.mjs b/source/dom/resource/link.mjs index e2b6e588ac8db480f160232c7bfb0f32b8fb9f77..db41c8c72614e8da96cfe490e88fd0a9365fee60 100644 --- a/source/dom/resource/link.mjs +++ b/source/dom/resource/link.mjs @@ -77,7 +77,7 @@ class Link extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/link/stylesheet.mjs b/source/dom/resource/link/stylesheet.mjs index 26b841ca49e369f8799f82c68a2108152fcc1148..f22240cf16951d6f73b5849e684db50e65cef261 100644 --- a/source/dom/resource/link/stylesheet.mjs +++ b/source/dom/resource/link/stylesheet.mjs @@ -39,7 +39,7 @@ class Stylesheet extends Link { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/script.mjs b/source/dom/resource/script.mjs index dbcb430514a20629863fec55ee8a7d4c1d451d08..3408833c7fb79996e912166a4a68192f51eeaea6 100644 --- a/source/dom/resource/script.mjs +++ b/source/dom/resource/script.mjs @@ -61,7 +61,7 @@ class Script extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/template.mjs b/source/dom/template.mjs index 10fc5a05227971cb6d86058f29359cf0766908b2..99aa7f5d429ff1ed8b51cded02b2f04f54278390 100644 --- a/source/dom/template.mjs +++ b/source/dom/template.mjs @@ -48,7 +48,7 @@ class Template extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -57,7 +57,7 @@ class Template extends Base { /** * - * @returns {HTMLTemplateElement} + * @return {HTMLTemplateElement} */ getTemplateElement() { return this.template; diff --git a/source/dom/theme.mjs b/source/dom/theme.mjs index 126aa5942baa65526588429b841d96d6670caa36..75a2d473edd0597c289d8e351679178c82c5d9ed 100644 --- a/source/dom/theme.mjs +++ b/source/dom/theme.mjs @@ -43,7 +43,7 @@ class Theme extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -52,7 +52,7 @@ class Theme extends Base { /** * - * @returns {string} + * @return {string} */ getName() { return this.name; diff --git a/source/dom/updater.mjs b/source/dom/updater.mjs index 5c42adc70090ec5379f1a4e33a7c42a8b76c2166..350d5e4bc7759545899a69313c6eccdd6c4e34eb 100644 --- a/source/dom/updater.mjs +++ b/source/dom/updater.mjs @@ -244,7 +244,7 @@ class Updater extends Base { * * @param {string} name * @param {function} callback - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ diff --git a/source/dom/util.mjs b/source/dom/util.mjs index bda75c8f4a04168decf22529678f45dbff525586..aae4a3048d4db20e2c2882fe145b4cc2902c4b81 100644 --- a/source/dom/util.mjs +++ b/source/dom/util.mjs @@ -55,7 +55,7 @@ export { * } * ``` * - * @returns {object} + * @return {object} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -103,7 +103,7 @@ function getDocument() { * } * ``` * - * @returns {object} + * @return {object} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -149,7 +149,7 @@ function getWindow() { * } * ``` * - * @returns {DocumentFragment} + * @return {DocumentFragment} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -173,7 +173,7 @@ function getDocumentFragmentFromString(html) { * * @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from. * @param {string} targetId - The ID of the target element to find. - * @returns {HTMLElement|null} - The ancestor element with the specified ID, or null if not found. + * @return {HTMLElement|null} - The ancestor element with the specified ID, or null if not found. * @memberOf Monster.DOM * @since 3.29.0 * @license AGPLv3 @@ -222,7 +222,7 @@ function findElementWithIdUpwards(element, targetId) { * * @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from. * @param {string} selector - The selector of the target element to find. - * @returns {HTMLElement|null} - The ancestor element with the specified selector, or null if not found. + * @return {HTMLElement|null} - The ancestor element with the specified selector, or null if not found. * @memberOf Monster.DOM * @since 3.55.0 */ @@ -259,7 +259,7 @@ function findElementWithSelectorUpwards(element, selector) { /** * @private * @param {HTMLElement} element - * @returns {HTMLElement|null} + * @return {HTMLElement|null} */ function traverseShadowRoots(element) { let currentRoot = element.shadowRoot; @@ -296,7 +296,7 @@ function traverseShadowRoots(element) { * Recursively searches upwards from a given element to find an ancestor element * * @param {HTMLElement} element - * @returns {*} + * @return {*} * @throws {Error} Invalid argument. Expected an HTMLElement. * @memberOf Monster.DOM * @since 3.36.0 @@ -318,10 +318,10 @@ function getContainingDocument(element) { /** * Returns a list of all registered custom elements in the current document. * - * @returns {string[]} + * @return {string[]} * @since 4.0.0 * @memberOf Monster.DOM - * @returns {string[]} + * @return {string[]} */ function getRegisteredCustomElements() { const customElementTags = Array.from(document.querySelectorAll("*")) diff --git a/source/dom/util/extract-keys.mjs b/source/dom/util/extract-keys.mjs index 6e388af4b183b3539e799d59007c43b773ddc4c2..1e306b75b4dcfb4ebc305ade5a6b1a7f79a11a96 100644 --- a/source/dom/util/extract-keys.mjs +++ b/source/dom/util/extract-keys.mjs @@ -22,7 +22,7 @@ export { extractKeys }; * @param {string} keyPrefix * @param {string} keySeparator * @param {string} valueSeparator - * @returns {Map<any, any>} + * @return {Map<any, any>} */ function extractKeys( obj, diff --git a/source/dom/util/init-options-from-attributes.mjs b/source/dom/util/init-options-from-attributes.mjs index 75232d5bc7d8d90da1b37d54905067f3240fce05..aa38cc8316b8e68ce330be1b112c713ea92fb5e8 100644 --- a/source/dom/util/init-options-from-attributes.mjs +++ b/source/dom/util/init-options-from-attributes.mjs @@ -54,7 +54,7 @@ export { initOptionsFromAttributes }; * @param {Object} options - The options object to be initialized. * @param {Object} mapping - A mapping between the attribute value and the property value. * @param {string} prefix - The prefix of the attributes to be considered. - * @returns {Object} - The initialized options object. + * @return {Object} - The initialized options object. * @this HTMLElement - The context of the DOM element. */ function initOptionsFromAttributes( diff --git a/source/dom/util/set-option-from-attribute.mjs b/source/dom/util/set-option-from-attribute.mjs index 34f92b498b074857184d72c9e4578a95dd9bd953..412f2b85f856542bf6b017241fac831363045b38 100644 --- a/source/dom/util/set-option-from-attribute.mjs +++ b/source/dom/util/set-option-from-attribute.mjs @@ -46,7 +46,7 @@ export { setOptionFromAttribute }; * @param {Object} options - The options object to be initialized. * @param {Object} mapping - A mapping between the attribute value and the property value. * @param {string} prefix - The prefix of the attributes to be considered. - * @returns {Object} - The initialized options object. + * @return {Object} - The initialized options object. * @this HTMLElement - The context of the DOM element. */ function setOptionFromAttribute( diff --git a/source/i18n/formatter.mjs b/source/i18n/formatter.mjs index f2b40f1fcb36fa896a8e91d40c641b5de75acb88..8fc0b523f052a659b3db71cdeb0c0814ba391489 100644 --- a/source/i18n/formatter.mjs +++ b/source/i18n/formatter.mjs @@ -51,7 +51,7 @@ class Formatter extends TextFormatter { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { diff --git a/source/i18n/locale.mjs b/source/i18n/locale.mjs index c67b95ee62590b22d946a077c98188e266199237..45099b30528d6c9c3e3dbafc255290a5f7125c33 100644 --- a/source/i18n/locale.mjs +++ b/source/i18n/locale.mjs @@ -109,7 +109,7 @@ class Locale extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { @@ -254,7 +254,7 @@ class Locale extends Base { * ``` * * @param {string} locale - * @returns {Locale} + * @return {Locale} * @license AGPLv3 * @since 1.14.0 * @copyright schukai GmbH diff --git a/source/i18n/provider.mjs b/source/i18n/provider.mjs index c7b87a3812161aa3d51b2ba81aba967bb17d9717..6cb4a3c5d6170ebf4483d5b7c671b9bc3b6923a3 100644 --- a/source/i18n/provider.mjs +++ b/source/i18n/provider.mjs @@ -46,7 +46,7 @@ const translationsLinkSymbol = Symbol.for( class Provider extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { diff --git a/source/i18n/providers/embed.mjs b/source/i18n/providers/embed.mjs index 34dea76ea835232ef3357060dbec7b3a191ec1c0..b08f1dfaebc4d04e0e9c53ea975ed0f282670ae1 100644 --- a/source/i18n/providers/embed.mjs +++ b/source/i18n/providers/embed.mjs @@ -148,7 +148,7 @@ class Embed extends Provider { * `script[data-monster-role=translations]` is searched for and the translations are assigned to the element. * * @param element - * @returns {Promise<Awaited<unknown>[]>} + * @return {Promise<Awaited<unknown>[]>} */ static assignTranslationsToElement(element) { const d = getDocument(); diff --git a/source/i18n/translations.mjs b/source/i18n/translations.mjs index c5db03b259a620458ad0e6c9553c0bca082ba96c..cf25b86f48f3b3374160cc97b49d670815ebbf7a 100644 --- a/source/i18n/translations.mjs +++ b/source/i18n/translations.mjs @@ -56,7 +56,7 @@ class Translations extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { @@ -214,7 +214,7 @@ class Translations extends Base { * Returns the translations for the current document. * * @param {HTMLElement|undefined} [element] - Element to search for translations. Default: element with objectlink @schukai/monster/i18n/translations@@link. - * @returns {Translations} + * @return {Translations} * @throws {Error} Element is not an HTMLElement. * @throws {Error} Cannot find the element with translations. Add the translation object to the document. * @throws {Error} This element has no translations. diff --git a/source/logging/handler.mjs b/source/logging/handler.mjs index abd00ec1626247ba7d3d96e8de038c8996c2a6a6..aa1eff9c28e69c28eea4c644c8ad67155cd6745d 100644 --- a/source/logging/handler.mjs +++ b/source/logging/handler.mjs @@ -45,7 +45,7 @@ class Handler extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {LogEntry} entry - * @returns {boolean} + * @return {boolean} */ log(entry) { validateInstance(entry, LogEntry); @@ -61,7 +61,7 @@ class Handler extends Base { * set loglevel * * @param {integer} loglevel - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setLogLevel(loglevel) { @@ -73,7 +73,7 @@ class Handler extends Base { /** * get loglevel * - * @returns {integer} + * @return {integer} * @since 1.5.0 */ getLogLevel() { @@ -83,7 +83,7 @@ class Handler extends Base { /** * Set log level to All * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setAll() { @@ -94,7 +94,7 @@ class Handler extends Base { /** * Set log level to Trace * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setTrace() { @@ -105,7 +105,7 @@ class Handler extends Base { /** * Set log level to Debug * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setDebug() { @@ -116,7 +116,7 @@ class Handler extends Base { /** * Set log level to Info * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setInfo() { @@ -127,7 +127,7 @@ class Handler extends Base { /** * Set log level to Warn * - * @returns {undefined} + * @return {undefined} * @since 1.5.0 */ setWarn() { @@ -138,7 +138,7 @@ class Handler extends Base { /** * Set log level to Error * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setError() { @@ -149,7 +149,7 @@ class Handler extends Base { /** * Set log level to Fatal * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setFatal() { @@ -160,7 +160,7 @@ class Handler extends Base { /** * Set log level to Off * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setOff() { diff --git a/source/logging/handler/console.mjs b/source/logging/handler/console.mjs index c7b830e6bb70cc0e60f6525b61e3efc3f02df81c..3e52bf39b778fc76399ae1d83445fe6edd2c2d60 100644 --- a/source/logging/handler/console.mjs +++ b/source/logging/handler/console.mjs @@ -34,7 +34,7 @@ class ConsoleHandler extends Handler { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {LogEntry} entry - * @returns {boolean} + * @return {boolean} */ log(entry) { if (super.log(entry)) { diff --git a/source/logging/logentry.mjs b/source/logging/logentry.mjs index 63d1d6caabdcd9e5dbfc7c0ffd6e128637950072..93d6039c4f5f6b92bc66b2d5a51ca5fc89e6d198 100644 --- a/source/logging/logentry.mjs +++ b/source/logging/logentry.mjs @@ -41,7 +41,7 @@ class LogEntry extends Base { /** * - * @returns {integerr} + * @return {integerr} */ getLogLevel() { return this.loglevel; @@ -49,7 +49,7 @@ class LogEntry extends Base { /** * - * @returns {array} + * @return {array} */ getArguments() { return this.arguments; diff --git a/source/logging/logger.mjs b/source/logging/logger.mjs index 0b6e1e0909afdfc27ea9c76cdbdef81e4a7bbc0f..856322f5152d175fdf29dde3fb8f9e4f80c54b8d 100644 --- a/source/logging/logger.mjs +++ b/source/logging/logger.mjs @@ -84,7 +84,7 @@ class Logger extends Base { /** * * @param {Handler} handler - * @returns {Logger} + * @return {Logger} * @throws {Error} the handler must be an instance of Handler */ addHandler(handler) { @@ -100,7 +100,7 @@ class Logger extends Base { /** * * @param {Handler} handler - * @returns {Logger} + * @return {Logger} * @throws {Error} the handler must be an instance of Handler */ removeHandler(handler) { @@ -119,7 +119,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logTrace(...args) { @@ -137,7 +137,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logDebug(...args) { @@ -156,7 +156,7 @@ class Logger extends Base { * * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logInfo(...args) { @@ -174,7 +174,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logWarn(...args) { @@ -192,7 +192,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logError(...args) { @@ -210,7 +210,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logFatal(...args) { @@ -226,7 +226,7 @@ class Logger extends Base { * Labels * * @param {integer} level - * @returns {string} + * @return {string} */ getLabel(level) { validateInteger(level); @@ -247,7 +247,7 @@ class Logger extends Base { * Level * * @param {string} label - * @returns {integer} + * @return {integer} */ getLevel(label) { validateString(label); @@ -270,7 +270,7 @@ class Logger extends Base { * * @param {integer} loglevel * @param {*} args - * @returns {Logger} + * @return {Logger} * @private */ function triggerLog(loglevel, ...args) { diff --git a/source/math/random.mjs b/source/math/random.mjs index 021e6154c05b29d26aefaf95c61269d23111a1b1..199a744be3d165fb73fa5aaf215bb9fff55faa2e 100644 --- a/source/math/random.mjs +++ b/source/math/random.mjs @@ -21,7 +21,7 @@ export { random }; * * @param {number} min starting value of the definition set (default is 0) * @param {number} max end value of the definition set (default is 1000000000) - * @returns {number} + * @return {number} * @memberOf Monster.Math * @throws {Error} missing crypt * @throws {Error} we cannot generate numbers larger than 53 bits. @@ -62,7 +62,7 @@ Math.log2 = * * @param {number} min * @param {number} max - * @returns {number} + * @return {number} * @private * @throws {Error} missing crypt * @throws {Error} we cannot generate numbers larger than 53 bits. diff --git a/source/net/webconnect.mjs b/source/net/webconnect.mjs index 686b538e36765d6c3ef886e079d0c06f6006fccc..93f1f2fb96f032711ab37c387499cbc9b2d5ccc9 100644 --- a/source/net/webconnect.mjs +++ b/source/net/webconnect.mjs @@ -209,7 +209,7 @@ class WebConnect extends BaseWithOptions { /** * - * @returns {Promise} + * @return {Promise} */ connect() { return new Promise((resolve, reject) => { @@ -218,7 +218,7 @@ class WebConnect extends BaseWithOptions { } /** - * @returns {boolean} + * @return {boolean} */ isConnected() { return this[connectionSymbol]?.socket?.readyState === 1; @@ -226,7 +226,7 @@ class WebConnect extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/net/webconnect"); @@ -259,7 +259,7 @@ class WebConnect extends BaseWithOptions { * * @param {Number} [code=1000] The close code. * @param {String} [reason=""] The close reason. - * @returns {Promise} + * @return {Promise} * @see https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1 */ close(statusCode, reason) { @@ -286,7 +286,7 @@ class WebConnect extends BaseWithOptions { /** * Polls the receive queue for new messages. * - * @returns {Message} + * @return {Message} */ poll() { return this[receiveQueueSymbol].poll(); @@ -295,7 +295,7 @@ class WebConnect extends BaseWithOptions { /** * Are there any messages in the receive queue? * - * @returns {boolean} + * @return {boolean} */ dataReceived() { return !this[receiveQueueSymbol].isEmpty(); @@ -304,7 +304,7 @@ class WebConnect extends BaseWithOptions { /** * Get Message from the receive queue, but do not remove it. * - * @returns {Object} + * @return {Object} */ peek() { return this[receiveQueueSymbol].peek(); @@ -314,7 +314,7 @@ class WebConnect extends BaseWithOptions { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this[receiveQueueSymbol].attachObserver(observer); @@ -325,7 +325,7 @@ class WebConnect extends BaseWithOptions { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this[receiveQueueSymbol].detachObserver(observer); @@ -334,7 +334,7 @@ class WebConnect extends BaseWithOptions { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[receiveQueueSymbol].containsObserver(observer); diff --git a/source/net/webconnect/message.mjs b/source/net/webconnect/message.mjs index 3d860755d5004d1cefc0c1fd274a032431ed7ec0..d2deb48bcfd521d0d210e58246cf9299674aee38 100644 --- a/source/net/webconnect/message.mjs +++ b/source/net/webconnect/message.mjs @@ -40,14 +40,14 @@ class Message extends Base { /** * Returns the raw message. * - * @returns {object} + * @return {object} */ getData() { return this[dataSymbol]; } /** - * @returns {*} + * @return {*} */ toJSON() { return this[dataSymbol]; @@ -55,7 +55,7 @@ class Message extends Base { /** * @param {string} json - * @returns {Message} + * @return {Message} * @throws {TypeError} value is not a string */ static fromJSON(json) { diff --git a/source/text/bracketed-key-value-hash.mjs b/source/text/bracketed-key-value-hash.mjs index 64032dd3c65f0b743dee6c4d83b0bc03779c07a5..f44f7618a293f74c655727bce69ad0e51d5d41c3 100644 --- a/source/text/bracketed-key-value-hash.mjs +++ b/source/text/bracketed-key-value-hash.mjs @@ -48,7 +48,7 @@ export { parseBracketedKeyValueHash, createBracketedKeyValueHash }; * * @since 3.37.0 * @param {string} hashString - The string to parse, containing bracketed key-value pairs. - * @returns {Object} - An object representing the parsed result, with keys representing the selectors and values representing the key-value pairs associated with each selector. + * @return {Object} - An object representing the parsed result, with keys representing the selectors and values representing the key-value pairs associated with each selector. * - Returns an empty object if there was an error during parsing. */ function parseBracketedKeyValueHash(hashString) { const selectors = {}; @@ -207,7 +207,7 @@ function parseBracketedKeyValueHash(hashString) { * * @param {Object} object - The object containing selectors and key-value pairs. * @param {boolean} addHashPrefix - Whether to add the hash prefix # to the beginning of the string. - * @returns {string} The hash selector string. + * @return {string} The hash selector string. * @since 3.37.0 */ function createBracketedKeyValueHash(object, addHashPrefix = true) { diff --git a/source/text/generate-range-comparison-expression.mjs b/source/text/generate-range-comparison-expression.mjs index ea9a197ccbc5ddb324d1477af2cc90a8cb1ce101..05d6edb1ac619b4222fdd65a6c324ee52bbed859 100644 --- a/source/text/generate-range-comparison-expression.mjs +++ b/source/text/generate-range-comparison-expression.mjs @@ -58,7 +58,7 @@ export { generateRangeComparisonExpression }; * @param {string} [options.eqOp='=='] - The comparison operator for equality to use. * @param {string} [options.geOp='>='] - The comparison operator for greater than or equal to to use. * @param {string} [options.leOp='<='] - The comparison operator for less than or equal to to use. - * @returns {string} The generated comparison expression. + * @return {string} The generated comparison expression. * @throws {Error} If the input is invalid. * @memberOf Monster.Text * @summary Generates a comparison expression based on a range of values. diff --git a/source/types/base.mjs b/source/types/base.mjs index c0fabff3e6901865a36014af49eecf5befac231a..dd2bb81edd63fe879db584247b0fc1675e1a01e8 100644 --- a/source/types/base.mjs +++ b/source/types/base.mjs @@ -43,7 +43,7 @@ export { Base }; */ class Base extends Object { /** - * @returns {string} + * @return {string} */ toString() { return JSON.stringify(this); @@ -51,7 +51,7 @@ class Base extends Object { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -61,7 +61,7 @@ class Base extends Object { /** * This method is called by the `instanceof` operator. * @param that - * @returns {boolean} + * @return {boolean} * @since 2.1.0 */ static [Symbol.hasInstance](that) { @@ -96,7 +96,7 @@ class Base extends Object { * * @private * @param obj - * @returns {boolean|any|boolean} + * @return {boolean|any|boolean} * @since 2.1.0 */ function checkInstanceSymbol(obj) { diff --git a/source/types/dataurl.mjs b/source/types/dataurl.mjs index 9f1e1626daa0d0a3691ac5df7735b59ac0dd36f5..7507444efdcd5d0e51b53c6a7759463c4e468ca6 100644 --- a/source/types/dataurl.mjs +++ b/source/types/dataurl.mjs @@ -30,12 +30,11 @@ export { DataUrl, parseDataURL }; const internal = Symbol("internal"); /** - * You can create an object via the monster namespace `new Monster.Types.DataUrl()`. + * You can create an object via the monster namespace `new DataUrl()`. * * @license AGPLv3 * @since 1.8.0 * @copyright schukai GmbH - * @memberOf Monster.Types * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs * @see https://datatracker.ietf.org/doc/html/rfc2397 */ @@ -43,7 +42,7 @@ class DataUrl extends Base { /** * * @param {String} content - * @param {String|Monster.Types.MediaType} mediatype + * @param {String|MediaType} mediatype * @param {boolean} base64=true */ constructor(content, mediatype, base64) { @@ -62,7 +61,7 @@ class DataUrl extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -98,7 +97,7 @@ class DataUrl extends Base { } /** - * You can call the function via the monster namespace `Monster.Types.parseDataURL()`. + * You can call the function via the monster namespace `parseDataURL()`. * * Specification: * @@ -109,13 +108,12 @@ class DataUrl extends Base { * parameter := attribute "=" value * ``` * - * @param {String} dataurl - * @return {Monster.Types.DataUrl} * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs * @see https://datatracker.ietf.org/doc/html/rfc2397 * @throws {TypeError} incorrect or missing data protocol * @throws {TypeError} malformed data url - * @memberOf Monster.Types + * @param {string} dataurl + * @return {DataUrl} */ function parseDataURL(dataurl) { validateString(dataurl); diff --git a/source/types/global.mjs b/source/types/global.mjs index e6933cd1e0ec7c5b4f82def3bc60248cc37e3599..00197a5fa70dac609a07a046e3d29224ec9d2e54 100644 --- a/source/types/global.mjs +++ b/source/types/global.mjs @@ -74,7 +74,7 @@ let globalReference; * @license AGPLv3 * @since 1.6.0 * @memberOf Monster.Types - * @returns {object} globalThis + * @return {object} globalThis */ function getGlobal() { return globalReference; @@ -107,7 +107,7 @@ function getGlobal() { * @since 1.6.0 * @memberOf Monster.Types * @param {string} name - * @returns {object} + * @return {object} * @throws {Error} the object is not defined * @throws {TypeError} value is not a object * @throws {TypeError} value is not a string diff --git a/source/types/internal.mjs b/source/types/internal.mjs index 700182432e7f3f6e56f8c6e11b7d46ef9ff22833..e2cbe6e90626ff8493b6133acb365d87224a59bb 100644 --- a/source/types/internal.mjs +++ b/source/types/internal.mjs @@ -63,7 +63,7 @@ function equipWithInternal() { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ this["attachInternalObserver"] = (observer) => { this[internalSymbol].attachObserver(observer); @@ -74,7 +74,7 @@ function equipWithInternal() { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ this["detachInternalObserver"] = (observer) => { this[internalSymbol].detachObserver(observer); @@ -85,7 +85,7 @@ function equipWithInternal() { * Check if a observer is attached * * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ this["containsInternalObserver"] = (observer) => { return this[internalSymbol].containsObserver(observer); diff --git a/source/types/is.mjs b/source/types/is.mjs index 22ea464c4c512a71672111951dabfa279797a382..0b91dab05d95142c76fd14b0c1f7c83a662dd0c4 100644 --- a/source/types/is.mjs +++ b/source/types/is.mjs @@ -34,7 +34,7 @@ export { * * @externalExample ../../example/types/is-1.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.2.0 * @copyright schukai GmbH @@ -53,7 +53,7 @@ function isIterable(value) { * * @externalExample ../../example/types/is-2.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -87,7 +87,7 @@ function isPrimitive(value) { * * @externalExample ../../example/types/is-3.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.9.0 * @copyright schukai GmbH @@ -104,7 +104,7 @@ function isSymbol(value) { * * @externalExample ../../example/types/is-4.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -125,7 +125,7 @@ function isBoolean(value) { * * @externalExample ../../example/types/is-5.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -145,7 +145,7 @@ function isString(value) { * * @externalExample ../../example/types/is-6.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -170,7 +170,7 @@ function isObject(value) { * @externalExample ../../example/types/is-7.mjs * @param {*} value * @param {*} instance - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH @@ -190,7 +190,7 @@ function isInstance(value, instance) { * * @externalExample ../../example/types/is-8.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -208,7 +208,7 @@ function isArray(value) { * * @externalExample ../../example/types/is-9.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -232,7 +232,7 @@ function isFunction(value) { * * @externalExample ../../example/types/is-10.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.4.0 * @copyright schukai GmbH diff --git a/source/types/mediatype.mjs b/source/types/mediatype.mjs index e76edf29d510eef012301c707e8d9b03e6aafc10..0773ad287115bee68fa850078e8ed32bdefef64b 100644 --- a/source/types/mediatype.mjs +++ b/source/types/mediatype.mjs @@ -62,7 +62,7 @@ class MediaType extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/types/node.mjs b/source/types/node.mjs index ddf45d14271cc47b4d2437a3d173ebbc73999eef..82ea597f8f86ee5ad2c9a9d4ef3c92cbd2eee127 100644 --- a/source/types/node.mjs +++ b/source/types/node.mjs @@ -59,7 +59,7 @@ class Node extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/types/nodelist.mjs b/source/types/nodelist.mjs index 02224e28258f081efbfb5d14a077d7a16d11238a..47c08705b2644d859be5a83c356228095f8432eb 100644 --- a/source/types/nodelist.mjs +++ b/source/types/nodelist.mjs @@ -49,7 +49,7 @@ class NodeList extends Set { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -68,7 +68,7 @@ class NodeList extends Set { /** * @param {Node} node - * @returns {NodeList} + * @return {NodeList} */ remove(node) { super.delete(validateInstance(node, Node)); @@ -77,14 +77,14 @@ class NodeList extends Set { /** * @param {Node} node - * @returns {boolean} + * @return {boolean} */ has(node) { return super.has(validateInstance(node, Node)); } /** - * @returns {NodeList} + * @return {NodeList} */ clear() { super.clear(); @@ -92,21 +92,21 @@ class NodeList extends Set { } /** - * @returns {NodeList} + * @return {NodeList} */ toArray() { return Array.from(this); } /** - * @returns {NodeList} + * @return {NodeList} */ toJSON() { return this.toArray(); } /** - * @returns {NodeList} + * @return {NodeList} */ toString() { const parts = []; diff --git a/source/types/observablequeue.mjs b/source/types/observablequeue.mjs index a57249515d3008a6bdc6d034352177e0a07ec7bc..caf7755001e55b17f546fcda3f35066360bab9fa 100644 --- a/source/types/observablequeue.mjs +++ b/source/types/observablequeue.mjs @@ -40,7 +40,7 @@ class ObservableQueue extends Queue { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/types/observablequeue"); @@ -50,7 +50,7 @@ class ObservableQueue extends Queue { * Add a new element to the end of the queue. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ add(value) { super.add(value); @@ -61,7 +61,7 @@ class ObservableQueue extends Queue { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { super.clear(); @@ -73,7 +73,7 @@ class ObservableQueue extends Queue { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this[internalSymbol].observers.attach(observer); @@ -84,7 +84,7 @@ class ObservableQueue extends Queue { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this[internalSymbol].observers.detach(observer); @@ -94,7 +94,7 @@ class ObservableQueue extends Queue { /** * Notify all observer * - * @returns {Promise} + * @return {Promise} */ notifyObservers() { return this[internalSymbol].observers.notify(this); @@ -102,7 +102,7 @@ class ObservableQueue extends Queue { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[internalSymbol].observers.contains(observer); diff --git a/source/types/observer.mjs b/source/types/observer.mjs index 2970d71f3bbf61c7198fb6227b38ad8da8205e33..4f486bfe651f8a26ccdb906229f8ec6991719737 100644 --- a/source/types/observer.mjs +++ b/source/types/observer.mjs @@ -77,7 +77,7 @@ class Observer extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -87,7 +87,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {Observer} + * @return {Observer} */ addTag(tag) { this.tags.add(tag); @@ -97,7 +97,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {Observer} + * @return {Observer} */ removeTag(tag) { this.tags.remove(tag); @@ -106,7 +106,7 @@ class Observer extends Base { /** * - * @returns {Array} + * @return {Array} */ getTags() { return this.tags.entries(); @@ -115,7 +115,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {boolean} + * @return {boolean} */ hasTag(tag) { return this.tags.contains(tag); @@ -124,7 +124,7 @@ class Observer extends Base { /** * * @param {object} subject - * @returns {Promise} + * @return {Promise} */ update(subject) { const self = this; diff --git a/source/types/proxyobserver.mjs b/source/types/proxyobserver.mjs index 8af7d89b2dc76317ffb492fb2b5d95c7bc0e60e5..c9484341300344dcb944fc2eaa1e0fcceb3bdb01 100644 --- a/source/types/proxyobserver.mjs +++ b/source/types/proxyobserver.mjs @@ -57,7 +57,7 @@ class ProxyObserver extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -65,7 +65,7 @@ class ProxyObserver extends Base { } /** - * @returns {object} + * @return {object} */ getSubject() { return this.subject; @@ -93,7 +93,7 @@ class ProxyObserver extends Base { * * Changes to this object are not noticed by the observers, so you can make a large number of changes and inform the observers later. * - * @returns {object} + * @return {object} */ getRealSubject() { return this.realSubject; @@ -103,7 +103,7 @@ class ProxyObserver extends Base { * attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this.observers.attach(observer); @@ -114,7 +114,7 @@ class ProxyObserver extends Base { * detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this.observers.detach(observer); @@ -124,7 +124,7 @@ class ProxyObserver extends Base { /** * notify all observer * - * @returns {Promise} + * @return {Promise} */ notifyObservers() { return this.observers.notify(this); @@ -132,7 +132,7 @@ class ProxyObserver extends Base { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this.observers.contains(observer); @@ -141,7 +141,7 @@ class ProxyObserver extends Base { /** * - * @returns {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}} + * @return {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}} * @private * @see {@link https://gitlab.schukai.com/-/snippets/49} */ diff --git a/source/types/queue.mjs b/source/types/queue.mjs index 7ea7a449eda73660b31f4c28818dcc390edce278..1386c7d9233e633bf892f827d81fe48e9615c41c 100644 --- a/source/types/queue.mjs +++ b/source/types/queue.mjs @@ -41,7 +41,7 @@ class Queue extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -72,7 +72,7 @@ class Queue extends Base { * Add a new element to the end of the queue. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ add(value) { this.data.push(value); @@ -82,7 +82,7 @@ class Queue extends Base { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { this.data = []; diff --git a/source/types/stack.mjs b/source/types/stack.mjs index bd8e08d0a8129dc93a00cc31b14ad81c1966cbc8..5384cbb13488fe43f0bd97c0180f9d95b0173a52 100644 --- a/source/types/stack.mjs +++ b/source/types/stack.mjs @@ -34,7 +34,7 @@ class Stack extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -65,7 +65,7 @@ class Stack extends Base { * pushes an item onto the top of this stack. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ push(value) { this.data.push(value); @@ -75,7 +75,7 @@ class Stack extends Base { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { this.data = []; diff --git a/source/types/tokenlist.mjs b/source/types/tokenlist.mjs index c8f2f24d456bd2014aae54277fe379bb7bf65ee7..7fc012437ffa36ef94dbbe51c819034ec6358ab8 100644 --- a/source/types/tokenlist.mjs +++ b/source/types/tokenlist.mjs @@ -46,7 +46,7 @@ class TokenList extends Base { /** * Iterator protocol * - * @returns {Symbol.iterator} + * @return {Symbol.iterator} */ getIterator() { return this[Symbol.iterator](); @@ -55,7 +55,7 @@ class TokenList extends Base { /** * Iterator * - * @returns {{next: ((function(): ({value: *, done: boolean}))|*)}} + * @return {{next: ((function(): ({value: *, done: boolean}))|*)}} */ [Symbol.iterator]() { // Use a new index for each iterator. This makes multiple @@ -80,7 +80,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-2.mjs * @param {array|string|iteratable} value - * @returns {boolean} + * @return {boolean} */ contains(value) { if (isString(value)) { @@ -111,7 +111,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-3.mjs * @param {array|string|iteratable} value - * @returns {TokenList} + * @return {TokenList} * @throws {TypeError} unsupported value */ add(value) { @@ -134,7 +134,7 @@ class TokenList extends Base { /** * remove all tokens * - * @returns {TokenList} + * @return {TokenList} */ clear() { this.tokens.clear(); @@ -146,7 +146,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-4.mjs * @param {array|string|iteratable} value - * @returns {TokenList} + * @return {TokenList} * @throws {TypeError} unsupported value */ remove(value) { @@ -174,7 +174,7 @@ class TokenList extends Base { * * @param {string} token * @param {string} newToken - * @returns {TokenList} + * @return {TokenList} */ replace(token, newToken) { validateString(token); @@ -199,7 +199,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-5.mjs * @param {array|string|iteratable} value - * @returns {boolean} + * @return {boolean} * @throws {TypeError} unsupported value */ toggle(value) { @@ -221,7 +221,7 @@ class TokenList extends Base { /** * returns an array with all tokens * - * @returns {array} + * @return {array} */ entries() { return Array.from(this.tokens); @@ -231,7 +231,7 @@ class TokenList extends Base { * executes the provided function with each value of the set * * @param {function} callback - * @returns {TokenList} + * @return {TokenList} */ forEach(callback) { validateFunction(callback); @@ -242,7 +242,7 @@ class TokenList extends Base { /** * returns the individual tokens separated by a blank character * - * @returns {string} + * @return {string} */ toString() { return this.entries().join(" "); @@ -252,7 +252,7 @@ class TokenList extends Base { /** * @private * @param token - * @returns {toggleValue} + * @return {toggleValue} * @throws {Error} must be called with TokenList.call */ function toggleValue(token) { diff --git a/source/types/uniquequeue.mjs b/source/types/uniquequeue.mjs index 16eda2533930d4f69a763d5819e6347d91a4a197..a10c1ba79df11ac40deb9c728f91fbde2f751638 100644 --- a/source/types/uniquequeue.mjs +++ b/source/types/uniquequeue.mjs @@ -41,7 +41,7 @@ class UniqueQueue extends Queue { * Add a new element to the end of the queue. * * @param {object} value - * @returns {Queue} + * @return {Queue} * @throws {TypeError} value is not a object */ add(value) { @@ -58,7 +58,7 @@ class UniqueQueue extends Queue { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { super.clear(); diff --git a/source/types/version.mjs b/source/types/version.mjs index 13d0bb1d269b882eb5415ffcb7ca4d2eb4b19234..635740c6933b75e199a3ea2844494694998c1a08 100644 --- a/source/types/version.mjs +++ b/source/types/version.mjs @@ -82,7 +82,7 @@ class Version extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -91,7 +91,7 @@ class Version extends Base { /** * - * @returns {string} + * @return {string} */ toString() { return `${this.major}.${this.minor}.${this.patch}`; @@ -102,7 +102,7 @@ class Version extends Base { * than the compared version * * @param {string|Version} version Version to compare - * @returns {number} + * @return {number} */ compareTo(version) { if (version instanceof Version) { @@ -144,7 +144,7 @@ let monsterVersion; /** * Version of monster * - * @returns {Version} + * @return {Version} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH diff --git a/source/util/clone.mjs b/source/util/clone.mjs index 81ce44e046d56e9e1d1acd4536cc33d97ccab9db..a85d9dac8871c3bef0d504f14ffdc14fa5b4d9f9 100644 --- a/source/util/clone.mjs +++ b/source/util/clone.mjs @@ -29,7 +29,7 @@ export { clone }; * If an object has a method `getClone()`, this method is used to create the clone. * * @param {*} obj object to be cloned - * @returns {*} + * @return {*} * @license AGPLv3 * @since 1.0.0 * @memberOf Monster.Util @@ -106,7 +106,7 @@ function clone(obj) { /** * * @param {object} obj - * @returns {object} + * @return {object} * @private */ function cloneObject(obj) { diff --git a/source/util/freeze.mjs b/source/util/freeze.mjs index e1572e0cb2cf4b7c31e93c0f1c193325ed53ee20..f12ce1d60c3ddffe2841b4da9061f3c91c394b74 100644 --- a/source/util/freeze.mjs +++ b/source/util/freeze.mjs @@ -22,7 +22,7 @@ export { deepFreeze }; * @param {object} object object to be freeze * @license AGPLv3 * @since 1.0.0 - * @returns {object} + * @return {object} * @memberOf Monster.Util * @copyright schukai GmbH * @throws {TypeError} value is not a object diff --git a/source/util/runtime.mjs b/source/util/runtime.mjs index d4b3592e1e916bd7e1194d2c9f048f3655a75b52..f24be3ab06aae98beee58573cf07b813508f3550 100644 --- a/source/util/runtime.mjs +++ b/source/util/runtime.mjs @@ -64,7 +64,7 @@ const ENV_UNKNOWN = "unknown"; * * @since 3.34.0 * @memberOf Monster.Util - * @returns {string} The detected runtime environment. Possible values are: + * @return {string} The detected runtime environment. Possible values are: */ function detectRuntimeEnvironment() { // AWS Lambda environment