@schukai/monster 3.80.2 → 3.80.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/package.json +1 -1
- package/source/components/content/copy.mjs +7 -4
- package/source/components/datatable/change-button.mjs +1 -1
- package/source/components/datatable/columnbar.mjs +1 -1
- package/source/components/datatable/dataset.mjs +3 -3
- package/source/components/datatable/datasource/dom.mjs +2 -2
- package/source/components/datatable/datasource/rest.mjs +7 -7
- package/source/components/datatable/datasource.mjs +3 -3
- package/source/components/datatable/datatable/header.mjs +11 -11
- package/source/components/datatable/datatable.mjs +15 -15
- package/source/components/datatable/embedded-pagination.mjs +2 -2
- package/source/components/datatable/filter/date-range.mjs +5 -5
- package/source/components/datatable/filter/input.mjs +2 -2
- package/source/components/datatable/filter/range.mjs +3 -3
- package/source/components/datatable/filter/settings.mjs +5 -5
- package/source/components/datatable/filter/util.mjs +3 -3
- package/source/components/datatable/filter-button.mjs +1 -1
- package/source/components/datatable/filter.mjs +11 -11
- package/source/components/datatable/pagination.mjs +3 -3
- package/source/components/datatable/save-button.mjs +1 -1
- package/source/components/datatable/status.mjs +1 -1
- package/source/components/form/action-button.mjs +2 -2
- package/source/components/form/api-button.mjs +1 -1
- package/source/components/form/button-bar.mjs +3 -3
- package/source/components/form/confirm-button.mjs +4 -4
- package/source/components/form/context-error.mjs +4 -4
- package/source/components/form/context-help.mjs +1 -1
- package/source/components/form/field-set.mjs +2 -2
- package/source/components/form/form.mjs +3 -3
- package/source/components/form/message-state-button.mjs +6 -6
- package/source/components/form/popper-button.mjs +1 -1
- package/source/components/form/reload.mjs +5 -22
- package/source/components/form/select.mjs +2015 -1958
- package/source/components/form/shadow-reload.mjs +1 -1
- package/source/components/form/state-button.mjs +1 -1
- package/source/components/form/style/select.pcss +3 -1
- package/source/components/form/stylesheet/select.mjs +7 -14
- package/source/components/form/template.mjs +4 -4
- package/source/components/form/toggle-switch.mjs +1 -1
- package/source/components/form/tree-select.mjs +1 -1
- package/source/components/form/util/floating-ui.mjs +1 -1
- package/source/components/host/call-button.mjs +1 -1
- package/source/components/host/config-manager.mjs +6 -6
- package/source/components/host/host.mjs +8 -8
- package/source/components/host/overlay.mjs +13 -13
- package/source/components/host/toggle-button.mjs +1 -1
- package/source/components/host/util.mjs +1 -1
- package/source/components/host/viewer.mjs +5 -5
- package/source/components/layout/collapse.mjs +20 -19
- package/source/components/layout/details.mjs +5 -5
- package/source/components/layout/iframe.mjs +2 -2
- package/source/components/layout/panel.mjs +3 -3
- package/source/components/layout/popper.mjs +1 -1
- package/source/components/layout/slider.mjs +6 -6
- package/source/components/layout/split-panel.mjs +3 -3
- package/source/components/layout/tabs.mjs +3 -9
- package/source/components/layout/width-toggle.mjs +4 -4
- package/source/components/navigation/table-of-content.mjs +3 -3
- package/source/components/notify/message.mjs +0 -1
- package/source/components/state/log/entry.mjs +6 -6
- package/source/components/state/log.mjs +3 -39
- package/source/components/state/state.mjs +1 -1
- package/source/components/tree-menu/dragable-tree-menu.mjs +2 -2
- package/source/components/tree-menu/tree-menu.mjs +1 -1
- package/source/constraints/abstract.mjs +2 -2
- package/source/constraints/abstractoperator.mjs +1 -1
- package/source/constraints/andoperator.mjs +5 -5
- package/source/constraints/invalid.mjs +5 -5
- package/source/constraints/isarray.mjs +5 -5
- package/source/constraints/isobject.mjs +5 -5
- package/source/constraints/oroperator.mjs +5 -5
- package/source/constraints/valid.mjs +4 -4
- package/source/data/buildmap.mjs +2 -1
- package/source/data/datasource/dom.mjs +1 -1
- package/source/data/datasource/server/restapi/data-fetch-error.mjs +1 -1
- package/source/data/datasource/server/restapi/writeerror.mjs +1 -1
- package/source/data/datasource/server/restapi.mjs +2 -2
- package/source/data/datasource/server/webconnect.mjs +4 -4
- package/source/data/datasource/server.mjs +5 -5
- package/source/data/datasource/storage/localstorage.mjs +1 -1
- package/source/data/datasource/storage/sessionstorage.mjs +1 -1
- package/source/data/datasource/storage.mjs +1 -1
- package/source/data/datasource.mjs +4 -5
- package/source/data/pathfinder.mjs +10 -9
- package/source/data/pipe.mjs +5 -4
- package/source/data/transformer.mjs +23 -11
- package/source/dom/assembler.mjs +2 -2
- package/source/dom/attributes.mjs +2 -2
- package/source/dom/customcontrol.mjs +1 -1
- package/source/dom/customelement.mjs +36 -67
- package/source/dom/dimension.mjs +3 -3
- package/source/dom/focusmanager.mjs +1 -1
- package/source/dom/locale.mjs +1 -1
- package/source/dom/resource/data.mjs +1 -1
- package/source/dom/resource/link/stylesheet.mjs +1 -1
- package/source/dom/resource/link.mjs +1 -1
- package/source/dom/resource/script.mjs +1 -1
- package/source/dom/template.mjs +2 -2
- package/source/dom/theme.mjs +2 -2
- package/source/dom/updater.mjs +5 -6
- package/source/dom/util/extract-keys.mjs +1 -1
- package/source/dom/util/init-options-from-attributes.mjs +1 -1
- package/source/dom/util/set-option-from-attribute.mjs +1 -1
- package/source/dom/util.mjs +9 -9
- package/source/i18n/formatter.mjs +1 -1
- package/source/i18n/locale.mjs +2 -2
- package/source/i18n/provider.mjs +1 -1
- package/source/i18n/providers/embed.mjs +1 -3
- package/source/i18n/translations.mjs +2 -2
- package/source/logging/handler/console.mjs +1 -1
- package/source/logging/handler.mjs +11 -11
- package/source/logging/logentry.mjs +2 -2
- package/source/logging/logger.mjs +11 -11
- package/source/math/random.mjs +2 -2
- package/source/monster.mjs +1 -0
- package/source/net/webconnect/message.mjs +3 -3
- package/source/net/webconnect.mjs +10 -10
- package/source/text/bracketed-key-value-hash.mjs +2 -2
- package/source/text/generate-range-comparison-expression.mjs +1 -1
- package/source/types/base.mjs +4 -4
- package/source/types/basewithoptions.mjs +3 -4
- package/source/types/dataurl.mjs +6 -8
- package/source/types/global.mjs +2 -2
- package/source/types/internal.mjs +3 -3
- package/source/types/is.mjs +10 -20
- package/source/types/mediatype.mjs +1 -1
- package/source/types/node.mjs +1 -1
- package/source/types/nodelist.mjs +7 -7
- package/source/types/observablequeue.mjs +7 -7
- package/source/types/observer.mjs +6 -6
- package/source/types/proxyobserver.mjs +8 -8
- package/source/types/queue.mjs +3 -3
- package/source/types/stack.mjs +3 -3
- package/source/types/tokenlist.mjs +12 -12
- package/source/types/uniquequeue.mjs +2 -2
- package/source/types/version.mjs +4 -4
- package/source/util/clone.mjs +2 -2
- package/source/util/comparator.mjs +1 -2
- package/source/util/deadmansswitch.mjs +7 -5
- package/source/util/freeze.mjs +1 -1
- package/source/util/processing.mjs +2 -2
- package/source/util/runtime.mjs +1 -1
package/source/dom/locale.mjs
CHANGED
@@ -64,7 +64,7 @@ function getLocaleOfDocument() {
|
|
64
64
|
|
65
65
|
/**
|
66
66
|
* @private
|
67
|
-
* @
|
67
|
+
* @return {string|undefined|*}
|
68
68
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
|
69
69
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages
|
70
70
|
*/
|
package/source/dom/template.mjs
CHANGED
@@ -48,7 +48,7 @@ class Template extends Base {
|
|
48
48
|
|
49
49
|
/**
|
50
50
|
* This method is called by the `instanceof` operator.
|
51
|
-
* @
|
51
|
+
* @return {symbol}
|
52
52
|
* @since 2.1.0
|
53
53
|
*/
|
54
54
|
static get [instanceSymbol]() {
|
@@ -57,7 +57,7 @@ class Template extends Base {
|
|
57
57
|
|
58
58
|
/**
|
59
59
|
*
|
60
|
-
* @
|
60
|
+
* @return {HTMLTemplateElement}
|
61
61
|
*/
|
62
62
|
getTemplateElement() {
|
63
63
|
return this.template;
|
package/source/dom/theme.mjs
CHANGED
@@ -43,7 +43,7 @@ class Theme extends Base {
|
|
43
43
|
|
44
44
|
/**
|
45
45
|
* This method is called by the `instanceof` operator.
|
46
|
-
* @
|
46
|
+
* @return {symbol}
|
47
47
|
* @since 2.1.0
|
48
48
|
*/
|
49
49
|
static get [instanceSymbol]() {
|
@@ -52,7 +52,7 @@ class Theme extends Base {
|
|
52
52
|
|
53
53
|
/**
|
54
54
|
*
|
55
|
-
* @
|
55
|
+
* @return {string}
|
56
56
|
*/
|
57
57
|
getName() {
|
58
58
|
return this.name;
|
package/source/dom/updater.mjs
CHANGED
@@ -54,11 +54,11 @@ export { Updater, addObjectWithUpdaterToElement };
|
|
54
54
|
* to other values as well, you have to insert the attribute `data-monster-select-this`. This should be
|
55
55
|
* done with care, as it can reduce performance.
|
56
56
|
*
|
57
|
-
* @
|
57
|
+
* @example /examples/libraries/dom/updater/simple/ Simple example
|
58
|
+
*
|
58
59
|
* @license AGPLv3
|
59
60
|
* @since 1.8.0
|
60
61
|
* @copyright schukai GmbH
|
61
|
-
* @memberOf Monster.DOM
|
62
62
|
* @throws {Error} the value is not iterable
|
63
63
|
* @throws {Error} pipes are not allowed when cloning a node.
|
64
64
|
* @throws {Error} no template was found with the specified key.
|
@@ -149,7 +149,7 @@ class Updater extends Base {
|
|
149
149
|
/**
|
150
150
|
* With this method, the eventlisteners are hooked in and the magic begins.
|
151
151
|
*
|
152
|
-
* ```
|
152
|
+
* ```js
|
153
153
|
* updater.run().then(() => {
|
154
154
|
* updater.enableEventProcessing();
|
155
155
|
* });
|
@@ -198,7 +198,7 @@ class Updater extends Base {
|
|
198
198
|
* The run method must be called for the update to start working.
|
199
199
|
* The method ensures that changes are detected.
|
200
200
|
*
|
201
|
-
* ```
|
201
|
+
* ```js
|
202
202
|
* updater.run().then(() => {
|
203
203
|
* updater.enableEventProcessing();
|
204
204
|
* });
|
@@ -244,7 +244,7 @@ class Updater extends Base {
|
|
244
244
|
*
|
245
245
|
* @param {string} name
|
246
246
|
* @param {function} callback
|
247
|
-
* @
|
247
|
+
* @return {Transformer}
|
248
248
|
* @throws {TypeError} value is not a string
|
249
249
|
* @throws {TypeError} value is not a function
|
250
250
|
*/
|
@@ -317,7 +317,6 @@ function getControlEventHandler() {
|
|
317
317
|
* @throws {Error} the bind argument must start as a value with a path
|
318
318
|
* @param {HTMLElement} element
|
319
319
|
* @return void
|
320
|
-
* @memberOf Monster.DOM
|
321
320
|
* @private
|
322
321
|
*/
|
323
322
|
function retrieveAndSetValue(element) {
|
@@ -54,7 +54,7 @@ export { initOptionsFromAttributes };
|
|
54
54
|
* @param {Object} options - The options object to be initialized.
|
55
55
|
* @param {Object} mapping - A mapping between the attribute value and the property value.
|
56
56
|
* @param {string} prefix - The prefix of the attributes to be considered.
|
57
|
-
* @
|
57
|
+
* @return {Object} - The initialized options object.
|
58
58
|
* @this HTMLElement - The context of the DOM element.
|
59
59
|
*/
|
60
60
|
function initOptionsFromAttributes(
|
@@ -46,7 +46,7 @@ export { setOptionFromAttribute };
|
|
46
46
|
* @param {Object} options - The options object to be initialized.
|
47
47
|
* @param {Object} mapping - A mapping between the attribute value and the property value.
|
48
48
|
* @param {string} prefix - The prefix of the attributes to be considered.
|
49
|
-
* @
|
49
|
+
* @return {Object} - The initialized options object.
|
50
50
|
* @this HTMLElement - The context of the DOM element.
|
51
51
|
*/
|
52
52
|
function setOptionFromAttribute(
|
package/source/dom/util.mjs
CHANGED
@@ -55,7 +55,7 @@ export {
|
|
55
55
|
* }
|
56
56
|
* ```
|
57
57
|
*
|
58
|
-
* @
|
58
|
+
* @return {object}
|
59
59
|
* @license AGPLv3
|
60
60
|
* @since 1.6.0
|
61
61
|
* @copyright schukai GmbH
|
@@ -103,7 +103,7 @@ function getDocument() {
|
|
103
103
|
* }
|
104
104
|
* ```
|
105
105
|
*
|
106
|
-
* @
|
106
|
+
* @return {object}
|
107
107
|
* @license AGPLv3
|
108
108
|
* @since 1.6.0
|
109
109
|
* @copyright schukai GmbH
|
@@ -149,7 +149,7 @@ function getWindow() {
|
|
149
149
|
* }
|
150
150
|
* ```
|
151
151
|
*
|
152
|
-
* @
|
152
|
+
* @return {DocumentFragment}
|
153
153
|
* @license AGPLv3
|
154
154
|
* @since 1.6.0
|
155
155
|
* @copyright schukai GmbH
|
@@ -173,7 +173,7 @@ function getDocumentFragmentFromString(html) {
|
|
173
173
|
*
|
174
174
|
* @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from.
|
175
175
|
* @param {string} targetId - The ID of the target element to find.
|
176
|
-
* @
|
176
|
+
* @return {HTMLElement|null} - The ancestor element with the specified ID, or null if not found.
|
177
177
|
* @memberOf Monster.DOM
|
178
178
|
* @since 3.29.0
|
179
179
|
* @license AGPLv3
|
@@ -222,7 +222,7 @@ function findElementWithIdUpwards(element, targetId) {
|
|
222
222
|
*
|
223
223
|
* @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from.
|
224
224
|
* @param {string} selector - The selector of the target element to find.
|
225
|
-
* @
|
225
|
+
* @return {HTMLElement|null} - The ancestor element with the specified selector, or null if not found.
|
226
226
|
* @memberOf Monster.DOM
|
227
227
|
* @since 3.55.0
|
228
228
|
*/
|
@@ -259,7 +259,7 @@ function findElementWithSelectorUpwards(element, selector) {
|
|
259
259
|
/**
|
260
260
|
* @private
|
261
261
|
* @param {HTMLElement} element
|
262
|
-
* @
|
262
|
+
* @return {HTMLElement|null}
|
263
263
|
*/
|
264
264
|
function traverseShadowRoots(element) {
|
265
265
|
let currentRoot = element.shadowRoot;
|
@@ -296,7 +296,7 @@ function traverseShadowRoots(element) {
|
|
296
296
|
* Recursively searches upwards from a given element to find an ancestor element
|
297
297
|
*
|
298
298
|
* @param {HTMLElement} element
|
299
|
-
* @
|
299
|
+
* @return {*}
|
300
300
|
* @throws {Error} Invalid argument. Expected an HTMLElement.
|
301
301
|
* @memberOf Monster.DOM
|
302
302
|
* @since 3.36.0
|
@@ -318,10 +318,10 @@ function getContainingDocument(element) {
|
|
318
318
|
/**
|
319
319
|
* Returns a list of all registered custom elements in the current document.
|
320
320
|
*
|
321
|
-
* @
|
321
|
+
* @return {string[]}
|
322
322
|
* @since 4.0.0
|
323
323
|
* @memberOf Monster.DOM
|
324
|
-
* @
|
324
|
+
* @return {string[]}
|
325
325
|
*/
|
326
326
|
function getRegisteredCustomElements() {
|
327
327
|
const customElementTags = Array.from(document.querySelectorAll("*"))
|
package/source/i18n/locale.mjs
CHANGED
@@ -109,7 +109,7 @@ class Locale extends Base {
|
|
109
109
|
|
110
110
|
/**
|
111
111
|
* This method is called by the `instanceof` operator.
|
112
|
-
* @
|
112
|
+
* @return {symbol}
|
113
113
|
* @since 3.27.0
|
114
114
|
*/
|
115
115
|
static get [instanceSymbol]() {
|
@@ -254,7 +254,7 @@ class Locale extends Base {
|
|
254
254
|
* ```
|
255
255
|
*
|
256
256
|
* @param {string} locale
|
257
|
-
* @
|
257
|
+
* @return {Locale}
|
258
258
|
* @license AGPLv3
|
259
259
|
* @since 1.14.0
|
260
260
|
* @copyright schukai GmbH
|
package/source/i18n/provider.mjs
CHANGED
@@ -30,9 +30,7 @@ export { Embed };
|
|
30
30
|
* @license AGPLv3
|
31
31
|
* @since 1.13.0
|
32
32
|
* @copyright schukai GmbH
|
33
|
-
* @memberOf Monster.I18n.Providers
|
34
33
|
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
|
35
|
-
* @tutorial i18n-locale-and-formatter
|
36
34
|
*/
|
37
35
|
class Embed extends Provider {
|
38
36
|
/**
|
@@ -148,7 +146,7 @@ class Embed extends Provider {
|
|
148
146
|
* `script[data-monster-role=translations]` is searched for and the translations are assigned to the element.
|
149
147
|
*
|
150
148
|
* @param element
|
151
|
-
* @returns {Promise<Awaited<unknown>[]>}
|
149
|
+
* @returns {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
|
152
150
|
*/
|
153
151
|
static assignTranslationsToElement(element) {
|
154
152
|
const d = getDocument();
|
@@ -56,7 +56,7 @@ class Translations extends Base {
|
|
56
56
|
|
57
57
|
/**
|
58
58
|
* This method is called by the `instanceof` operator.
|
59
|
-
* @
|
59
|
+
* @return {symbol}
|
60
60
|
* @since 3.27.0
|
61
61
|
*/
|
62
62
|
static get [instanceSymbol]() {
|
@@ -214,7 +214,7 @@ class Translations extends Base {
|
|
214
214
|
* Returns the translations for the current document.
|
215
215
|
*
|
216
216
|
* @param {HTMLElement|undefined} [element] - Element to search for translations. Default: element with objectlink @schukai/monster/i18n/translations@@link.
|
217
|
-
* @
|
217
|
+
* @return {Translations}
|
218
218
|
* @throws {Error} Element is not an HTMLElement.
|
219
219
|
* @throws {Error} Cannot find the element with translations. Add the translation object to the document.
|
220
220
|
* @throws {Error} This element has no translations.
|
@@ -45,7 +45,7 @@ class Handler extends Base {
|
|
45
45
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
46
46
|
*
|
47
47
|
* @param {LogEntry} entry
|
48
|
-
* @
|
48
|
+
* @return {boolean}
|
49
49
|
*/
|
50
50
|
log(entry) {
|
51
51
|
validateInstance(entry, LogEntry);
|
@@ -61,7 +61,7 @@ class Handler extends Base {
|
|
61
61
|
* set loglevel
|
62
62
|
*
|
63
63
|
* @param {integer} loglevel
|
64
|
-
* @
|
64
|
+
* @return {Handler}
|
65
65
|
* @since 1.5.0
|
66
66
|
*/
|
67
67
|
setLogLevel(loglevel) {
|
@@ -73,7 +73,7 @@ class Handler extends Base {
|
|
73
73
|
/**
|
74
74
|
* get loglevel
|
75
75
|
*
|
76
|
-
* @
|
76
|
+
* @return {integer}
|
77
77
|
* @since 1.5.0
|
78
78
|
*/
|
79
79
|
getLogLevel() {
|
@@ -83,7 +83,7 @@ class Handler extends Base {
|
|
83
83
|
/**
|
84
84
|
* Set log level to All
|
85
85
|
*
|
86
|
-
* @
|
86
|
+
* @return {Handler}
|
87
87
|
* @since 1.5.0
|
88
88
|
*/
|
89
89
|
setAll() {
|
@@ -94,7 +94,7 @@ class Handler extends Base {
|
|
94
94
|
/**
|
95
95
|
* Set log level to Trace
|
96
96
|
*
|
97
|
-
* @
|
97
|
+
* @return {Handler}
|
98
98
|
* @since 1.5.0
|
99
99
|
*/
|
100
100
|
setTrace() {
|
@@ -105,7 +105,7 @@ class Handler extends Base {
|
|
105
105
|
/**
|
106
106
|
* Set log level to Debug
|
107
107
|
*
|
108
|
-
* @
|
108
|
+
* @return {Handler}
|
109
109
|
* @since 1.5.0
|
110
110
|
*/
|
111
111
|
setDebug() {
|
@@ -116,7 +116,7 @@ class Handler extends Base {
|
|
116
116
|
/**
|
117
117
|
* Set log level to Info
|
118
118
|
*
|
119
|
-
* @
|
119
|
+
* @return {Handler}
|
120
120
|
* @since 1.5.0
|
121
121
|
*/
|
122
122
|
setInfo() {
|
@@ -127,7 +127,7 @@ class Handler extends Base {
|
|
127
127
|
/**
|
128
128
|
* Set log level to Warn
|
129
129
|
*
|
130
|
-
* @
|
130
|
+
* @return {undefined}
|
131
131
|
* @since 1.5.0
|
132
132
|
*/
|
133
133
|
setWarn() {
|
@@ -138,7 +138,7 @@ class Handler extends Base {
|
|
138
138
|
/**
|
139
139
|
* Set log level to Error
|
140
140
|
*
|
141
|
-
* @
|
141
|
+
* @return {Handler}
|
142
142
|
* @since 1.5.0
|
143
143
|
*/
|
144
144
|
setError() {
|
@@ -149,7 +149,7 @@ class Handler extends Base {
|
|
149
149
|
/**
|
150
150
|
* Set log level to Fatal
|
151
151
|
*
|
152
|
-
* @
|
152
|
+
* @return {Handler}
|
153
153
|
* @since 1.5.0
|
154
154
|
*/
|
155
155
|
setFatal() {
|
@@ -160,7 +160,7 @@ class Handler extends Base {
|
|
160
160
|
/**
|
161
161
|
* Set log level to Off
|
162
162
|
*
|
163
|
-
* @
|
163
|
+
* @return {Handler}
|
164
164
|
* @since 1.5.0
|
165
165
|
*/
|
166
166
|
setOff() {
|
@@ -41,7 +41,7 @@ class LogEntry extends Base {
|
|
41
41
|
|
42
42
|
/**
|
43
43
|
*
|
44
|
-
* @
|
44
|
+
* @return {integerr}
|
45
45
|
*/
|
46
46
|
getLogLevel() {
|
47
47
|
return this.loglevel;
|
@@ -49,7 +49,7 @@ class LogEntry extends Base {
|
|
49
49
|
|
50
50
|
/**
|
51
51
|
*
|
52
|
-
* @
|
52
|
+
* @return {array}
|
53
53
|
*/
|
54
54
|
getArguments() {
|
55
55
|
return this.arguments;
|
@@ -84,7 +84,7 @@ class Logger extends Base {
|
|
84
84
|
/**
|
85
85
|
*
|
86
86
|
* @param {Handler} handler
|
87
|
-
* @
|
87
|
+
* @return {Logger}
|
88
88
|
* @throws {Error} the handler must be an instance of Handler
|
89
89
|
*/
|
90
90
|
addHandler(handler) {
|
@@ -100,7 +100,7 @@ class Logger extends Base {
|
|
100
100
|
/**
|
101
101
|
*
|
102
102
|
* @param {Handler} handler
|
103
|
-
* @
|
103
|
+
* @return {Logger}
|
104
104
|
* @throws {Error} the handler must be an instance of Handler
|
105
105
|
*/
|
106
106
|
removeHandler(handler) {
|
@@ -119,7 +119,7 @@ class Logger extends Base {
|
|
119
119
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
120
120
|
*
|
121
121
|
* @param {*} arguments
|
122
|
-
* @
|
122
|
+
* @return {Logger}
|
123
123
|
* @since 1.5.0
|
124
124
|
*/
|
125
125
|
logTrace(...args) {
|
@@ -137,7 +137,7 @@ class Logger extends Base {
|
|
137
137
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
138
138
|
*
|
139
139
|
* @param {*} arguments
|
140
|
-
* @
|
140
|
+
* @return {Logger}
|
141
141
|
* @since 1.5.0
|
142
142
|
*/
|
143
143
|
logDebug(...args) {
|
@@ -156,7 +156,7 @@ class Logger extends Base {
|
|
156
156
|
*
|
157
157
|
*
|
158
158
|
* @param {*} arguments
|
159
|
-
* @
|
159
|
+
* @return {Logger}
|
160
160
|
* @since 1.5.0
|
161
161
|
*/
|
162
162
|
logInfo(...args) {
|
@@ -174,7 +174,7 @@ class Logger extends Base {
|
|
174
174
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
175
175
|
*
|
176
176
|
* @param {*} arguments
|
177
|
-
* @
|
177
|
+
* @return {Logger}
|
178
178
|
* @since 1.5.0
|
179
179
|
*/
|
180
180
|
logWarn(...args) {
|
@@ -192,7 +192,7 @@ class Logger extends Base {
|
|
192
192
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
193
193
|
*
|
194
194
|
* @param {*} arguments
|
195
|
-
* @
|
195
|
+
* @return {Logger}
|
196
196
|
* @since 1.5.0
|
197
197
|
*/
|
198
198
|
logError(...args) {
|
@@ -210,7 +210,7 @@ class Logger extends Base {
|
|
210
210
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
211
211
|
*
|
212
212
|
* @param {*} arguments
|
213
|
-
* @
|
213
|
+
* @return {Logger}
|
214
214
|
* @since 1.5.0
|
215
215
|
*/
|
216
216
|
logFatal(...args) {
|
@@ -226,7 +226,7 @@ class Logger extends Base {
|
|
226
226
|
* Labels
|
227
227
|
*
|
228
228
|
* @param {integer} level
|
229
|
-
* @
|
229
|
+
* @return {string}
|
230
230
|
*/
|
231
231
|
getLabel(level) {
|
232
232
|
validateInteger(level);
|
@@ -247,7 +247,7 @@ class Logger extends Base {
|
|
247
247
|
* Level
|
248
248
|
*
|
249
249
|
* @param {string} label
|
250
|
-
* @
|
250
|
+
* @return {integer}
|
251
251
|
*/
|
252
252
|
getLevel(label) {
|
253
253
|
validateString(label);
|
@@ -270,7 +270,7 @@ class Logger extends Base {
|
|
270
270
|
*
|
271
271
|
* @param {integer} loglevel
|
272
272
|
* @param {*} args
|
273
|
-
* @
|
273
|
+
* @return {Logger}
|
274
274
|
* @private
|
275
275
|
*/
|
276
276
|
function triggerLog(loglevel, ...args) {
|
package/source/math/random.mjs
CHANGED
@@ -21,7 +21,7 @@ export { random };
|
|
21
21
|
*
|
22
22
|
* @param {number} min starting value of the definition set (default is 0)
|
23
23
|
* @param {number} max end value of the definition set (default is 1000000000)
|
24
|
-
* @
|
24
|
+
* @return {number}
|
25
25
|
* @memberOf Monster.Math
|
26
26
|
* @throws {Error} missing crypt
|
27
27
|
* @throws {Error} we cannot generate numbers larger than 53 bits.
|
@@ -62,7 +62,7 @@ Math.log2 =
|
|
62
62
|
*
|
63
63
|
* @param {number} min
|
64
64
|
* @param {number} max
|
65
|
-
* @
|
65
|
+
* @return {number}
|
66
66
|
* @private
|
67
67
|
* @throws {Error} missing crypt
|
68
68
|
* @throws {Error} we cannot generate numbers larger than 53 bits.
|
package/source/monster.mjs
CHANGED
@@ -106,6 +106,7 @@ export * from "./util/deadmansswitch.mjs";
|
|
106
106
|
export * from "./util/comparator.mjs";
|
107
107
|
export * from "./util/freeze.mjs";
|
108
108
|
export * from "./util/clone.mjs";
|
109
|
+
export * from "./util/processing/callback.mjs";
|
109
110
|
export * from "./logging/handler/console.mjs";
|
110
111
|
export * from "./logging/logger.mjs";
|
111
112
|
export * from "./logging/handler.mjs";
|
@@ -40,14 +40,14 @@ class Message extends Base {
|
|
40
40
|
/**
|
41
41
|
* Returns the raw message.
|
42
42
|
*
|
43
|
-
* @
|
43
|
+
* @return {object}
|
44
44
|
*/
|
45
45
|
getData() {
|
46
46
|
return this[dataSymbol];
|
47
47
|
}
|
48
48
|
|
49
49
|
/**
|
50
|
-
* @
|
50
|
+
* @return {*}
|
51
51
|
*/
|
52
52
|
toJSON() {
|
53
53
|
return this[dataSymbol];
|
@@ -55,7 +55,7 @@ class Message extends Base {
|
|
55
55
|
|
56
56
|
/**
|
57
57
|
* @param {string} json
|
58
|
-
* @
|
58
|
+
* @return {Message}
|
59
59
|
* @throws {TypeError} value is not a string
|
60
60
|
*/
|
61
61
|
static fromJSON(json) {
|
@@ -209,7 +209,7 @@ class WebConnect extends BaseWithOptions {
|
|
209
209
|
|
210
210
|
/**
|
211
211
|
*
|
212
|
-
* @
|
212
|
+
* @return {Promise}
|
213
213
|
*/
|
214
214
|
connect() {
|
215
215
|
return new Promise((resolve, reject) => {
|
@@ -218,7 +218,7 @@ class WebConnect extends BaseWithOptions {
|
|
218
218
|
}
|
219
219
|
|
220
220
|
/**
|
221
|
-
* @
|
221
|
+
* @return {boolean}
|
222
222
|
*/
|
223
223
|
isConnected() {
|
224
224
|
return this[connectionSymbol]?.socket?.readyState === 1;
|
@@ -226,7 +226,7 @@ class WebConnect extends BaseWithOptions {
|
|
226
226
|
|
227
227
|
/**
|
228
228
|
* This method is called by the `instanceof` operator.
|
229
|
-
* @
|
229
|
+
* @return {symbol}
|
230
230
|
*/
|
231
231
|
static get [instanceSymbol]() {
|
232
232
|
return Symbol.for("@schukai/monster/net/webconnect");
|
@@ -259,7 +259,7 @@ class WebConnect extends BaseWithOptions {
|
|
259
259
|
*
|
260
260
|
* @param {Number} [code=1000] The close code.
|
261
261
|
* @param {String} [reason=""] The close reason.
|
262
|
-
* @
|
262
|
+
* @return {Promise}
|
263
263
|
* @see https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
|
264
264
|
*/
|
265
265
|
close(statusCode, reason) {
|
@@ -286,7 +286,7 @@ class WebConnect extends BaseWithOptions {
|
|
286
286
|
/**
|
287
287
|
* Polls the receive queue for new messages.
|
288
288
|
*
|
289
|
-
* @
|
289
|
+
* @return {Message}
|
290
290
|
*/
|
291
291
|
poll() {
|
292
292
|
return this[receiveQueueSymbol].poll();
|
@@ -295,7 +295,7 @@ class WebConnect extends BaseWithOptions {
|
|
295
295
|
/**
|
296
296
|
* Are there any messages in the receive queue?
|
297
297
|
*
|
298
|
-
* @
|
298
|
+
* @return {boolean}
|
299
299
|
*/
|
300
300
|
dataReceived() {
|
301
301
|
return !this[receiveQueueSymbol].isEmpty();
|
@@ -304,7 +304,7 @@ class WebConnect extends BaseWithOptions {
|
|
304
304
|
/**
|
305
305
|
* Get Message from the receive queue, but do not remove it.
|
306
306
|
*
|
307
|
-
* @
|
307
|
+
* @return {Object}
|
308
308
|
*/
|
309
309
|
peek() {
|
310
310
|
return this[receiveQueueSymbol].peek();
|
@@ -314,7 +314,7 @@ class WebConnect extends BaseWithOptions {
|
|
314
314
|
* Attach a new observer
|
315
315
|
*
|
316
316
|
* @param {Observer} observer
|
317
|
-
* @
|
317
|
+
* @return {ProxyObserver}
|
318
318
|
*/
|
319
319
|
attachObserver(observer) {
|
320
320
|
this[receiveQueueSymbol].attachObserver(observer);
|
@@ -325,7 +325,7 @@ class WebConnect extends BaseWithOptions {
|
|
325
325
|
* Detach a observer
|
326
326
|
*
|
327
327
|
* @param {Observer} observer
|
328
|
-
* @
|
328
|
+
* @return {ProxyObserver}
|
329
329
|
*/
|
330
330
|
detachObserver(observer) {
|
331
331
|
this[receiveQueueSymbol].detachObserver(observer);
|
@@ -334,7 +334,7 @@ class WebConnect extends BaseWithOptions {
|
|
334
334
|
|
335
335
|
/**
|
336
336
|
* @param {Observer} observer
|
337
|
-
* @
|
337
|
+
* @return {boolean}
|
338
338
|
*/
|
339
339
|
containsObserver(observer) {
|
340
340
|
return this[receiveQueueSymbol].containsObserver(observer);
|