2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-04-04 14:08:20 +00:00

TemplateType.Wrapper Removed

This commit is contained in:
2022-09-06 23:29:54 +03:00
parent b04ff2b5a4
commit 3cbfd2eab0
10 changed files with 1376 additions and 506 deletions

View File

@@ -1,8 +1,6 @@
export default
{
Unspecified: 0,
Resource: 1,
Record: 2,
Wrapper: 3,
Enum: 4
Resource: 0,
Record: 1,
Enum: 2
}

View File

@@ -42,6 +42,13 @@ import Codec from '../../Data/Codec.js';
export default class TypeTemplate {
isWrapper = false;
properties = [];
events = [];
functions = [];
members = [];
constants = [];
getEventTemplateByName(eventName) {
for (var i = 0; i < this.events.length; i++)
if (this.events[i].name == eventName)
@@ -222,7 +229,8 @@ export default class TypeTemplate {
};
getDependenciesFunc(template, list);
return list;
return list.filter((value, index, self) => self.indexOf(value) === index);
}
get type() {
@@ -231,20 +239,12 @@ export default class TypeTemplate {
constructor(type, addToWarehouse) {
this.properties = [];
this.events = [];
this.functions = [];
this.members = [];
this.constants = [];
if (type === undefined)
return;
if (type.prototype instanceof DistributedResource)
this.templateType = TemplateType.Wrapper;
else if (type.prototype instanceof IRecord)
if (type.prototype instanceof IRecord)
this.templateType = TemplateType.Record;
else if (type.prototype instanceof IResource)
this.templateType = TemplateType.Resource;
@@ -253,6 +253,8 @@ export default class TypeTemplate {
else
throw new Error("Type must implement IResource, IRecord, IEnum or a subtype of DistributedResource.");
this.isWrapper = (type.prototype instanceof DistributedResource);
this.definedType = type;
let describer = type.template;