JSDoc error fixed

This commit is contained in:
barsdeveloper
2023-04-01 16:29:22 +02:00
parent 275b58dcf0
commit 750c745acc

View File

@@ -27,6 +27,10 @@ import VectorPinTemplate from "../template/pin/VectorPinTemplate.js"
* @typedef {import("lit").CSSResult} CSSResult * @typedef {import("lit").CSSResult} CSSResult
* @typedef {typeof PinElement} PinElementConstructor * @typedef {typeof PinElement} PinElementConstructor
*/ */
/**
* @template T
* @typedef {import("parsimmon").Success<T>} Success
*/
/** /**
* @template {AnyValue} T * @template {AnyValue} T
@@ -54,7 +58,7 @@ export default class PinElement extends IElement {
type: GuidEntity, type: GuidEntity,
converter: { converter: {
fromAttribute: (value, type) => value fromAttribute: (value, type) => value
? Grammar.guidEntity.parse(value).value ? /** @type {Success<GuidEntity>} */(Grammar.guidEntity.parse(value)).value
: null, : null,
toAttribute: (value, type) => value?.toString(), toAttribute: (value, type) => value?.toString(),
}, },
@@ -75,7 +79,7 @@ export default class PinElement extends IElement {
type: LinearColorEntity, type: LinearColorEntity,
converter: { converter: {
fromAttribute: (value, type) => value fromAttribute: (value, type) => value
? Grammar.linearColorFromAnyFormat.parse(value).value ? /** @type {Success<LinearColorEntity>} */(Grammar.linearColorFromAnyFormat.parse(value)).value
: null, : null,
toAttribute: (value, type) => value ? Utility.printLinearColor(value) : null, toAttribute: (value, type) => value ? Utility.printLinearColor(value) : null,
}, },