Large typedef import cleanup and smaller fixes

This commit is contained in:
barsdeveloper
2023-04-15 15:29:21 +02:00
parent baf40a9094
commit a82f61ac4a
76 changed files with 316 additions and 298 deletions

View File

@@ -1,8 +1,8 @@
import Serializer from "./Serializer.js"
/**
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
* @typedef {import("../entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<*>} AnyValueConstructor
*/
/**

View File

@@ -652,7 +652,7 @@ export default class Grammar {
static subObjectEntity = P.lazy(() =>
this.objectEntity
.map(object =>
values => values["SubObject_" + object.Name] = object
values => values[Configuration.subObjectAttributeNameFromEntity(object)] = object
)
)

View File

@@ -77,7 +77,7 @@ export default class ObjectSerializer extends Serializer {
)
}
let result = indentation + "Begin Object"
+ (entity.Class.path ? ` Class=${entity.Class.path}` : "")
+ (entity.Class.type || entity.Class.path ? ` Class=${this.doWriteValue(entity.Class, insideString)}` : "")
+ (entity.Name ? ` Name=${this.doWriteValue(entity.Name, insideString)}` : "")
+ "\n"
+ super.doWrite(

View File

@@ -1,15 +1,15 @@
/**
* @typedef {import("../entity/IEntity").default} IEntity
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
* @typedef {import("../entity/IEntity.js").default} IEntity
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
*/
/**
* @template {AnyValue} T
* @typedef {import("../entity/IEntity").AnyValueConstructor<T>} AnyValueConstructor
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<T>} AnyValueConstructor
*/
/**
* @template {AnyValue} T
* @typedef {import("./Serializer").default<T>} Serializer
* @typedef {import("./Serializer.js").default<T>} Serializer
*/
export default class SerializerFactory {

View File

@@ -2,8 +2,8 @@ import Serializer from "./Serializer.js"
import Utility from "../Utility.js"
/**
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
* @typedef {import("../entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<*>} AnyValueConstructor
*/
/**

View File

@@ -33,10 +33,7 @@ import VariableReferenceEntity from "../entity/VariableReferenceEntity.js"
import Vector2DEntity from "../entity/Vector2DEntity.js"
import VectorEntity from "../entity/VectorEntity.js"
/**
* @typedef {import("../entity/IEntity").AnySimpleValue} AnySimpleValue
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
*/
/** @typedef {import("../entity/IEntity.js").AnySimpleValue} AnySimpleValue */
export default function initializeSerializerFactory() {