Skip to content

Commit

Permalink
fix(types): update index.js for better type generation (resolves #402) (
Browse files Browse the repository at this point in the history
#403)

Signed-off-by: Simon Stone <[email protected]>
  • Loading branch information
Simon Stone authored Mar 22, 2022
1 parent e057c68 commit 75c5b42
Show file tree
Hide file tree
Showing 18 changed files with 470 additions and 354 deletions.
102 changes: 69 additions & 33 deletions packages/concerto-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,71 +22,107 @@
*/

// Exceptions
module.exports.SecurityException = require('./lib/securityexception');
module.exports.IllegalModelException = require('./lib/introspect/illegalmodelexception');
module.exports.TypeNotFoundException = require('./lib/typenotfoundexception');
const SecurityException = require('./lib/securityexception');
const IllegalModelException = require('./lib/introspect/illegalmodelexception');
const TypeNotFoundException = require('./lib/typenotfoundexception');

// Decorated
module.exports.Decorator = require('./lib/introspect/decorator');
module.exports.DecoratorFactory = require('./lib/introspect/decoratorfactory');
const Decorator = require('./lib/introspect/decorator');
const DecoratorFactory = require('./lib/introspect/decoratorfactory');

// ClassDeclarations
module.exports.ClassDeclaration = require('./lib/introspect/classdeclaration');
module.exports.IdentifiedDeclaration = require('./lib/introspect/identifieddeclaration');
module.exports.AssetDeclaration = require('./lib/introspect/assetdeclaration');
module.exports.ConceptDeclaration = require('./lib/introspect/conceptdeclaration');
module.exports.EnumValueDeclaration = require('./lib/introspect/enumvaluedeclaration');
module.exports.EventDeclaration = require('./lib/introspect/eventdeclaration');
module.exports.ParticipantDeclaration = require('./lib/introspect/participantdeclaration');
module.exports.TransactionDeclaration = require('./lib/introspect/transactiondeclaration');
const ClassDeclaration = require('./lib/introspect/classdeclaration');
const IdentifiedDeclaration = require('./lib/introspect/identifieddeclaration');
const AssetDeclaration = require('./lib/introspect/assetdeclaration');
const ConceptDeclaration = require('./lib/introspect/conceptdeclaration');
const EnumValueDeclaration = require('./lib/introspect/enumvaluedeclaration');
const EventDeclaration = require('./lib/introspect/eventdeclaration');
const ParticipantDeclaration = require('./lib/introspect/participantdeclaration');
const TransactionDeclaration = require('./lib/introspect/transactiondeclaration');

// Properties
module.exports.Property = require('./lib/introspect/property');
module.exports.Field = require('./lib/introspect/field');
module.exports.EnumDeclaration = require('./lib/introspect/enumdeclaration');
module.exports.RelationshipDeclaration = require('./lib/introspect/relationshipdeclaration');
const Property = require('./lib/introspect/property');
const Field = require('./lib/introspect/field');
const EnumDeclaration = require('./lib/introspect/enumdeclaration');
const RelationshipDeclaration = require('./lib/introspect/relationshipdeclaration');

// Typed
module.exports.Typed = require('./lib/model/typed');
const Typed = require('./lib/model/typed');

// Identifiables
module.exports.Identifiable = require('./lib/model/identifiable');
module.exports.Relationship = require('./lib/model/relationship');
module.exports.Resource = require('./lib/model/resource');
const Identifiable = require('./lib/model/identifiable');
const Relationship = require('./lib/model/relationship');
const Resource = require('./lib/model/resource');

// Factory
module.exports.Factory = require('./lib/factory');
const Factory = require('./lib/factory');

// Globalize
module.exports.Globalize = require('./lib/globalize');
const Globalize = require('./lib/globalize');

// Introspector
module.exports.Introspector = require('./lib/introspect/introspector');
const Introspector = require('./lib/introspect/introspector');

// ModelFile
module.exports.ModelFile = require('./lib/introspect/modelfile');
const ModelFile = require('./lib/introspect/modelfile');

// ModelManager
module.exports.ModelManager = require('./lib/modelmanager');
const ModelManager = require('./lib/modelmanager');

// Serializer
module.exports.Serializer = require('./lib/serializer');
const Serializer = require('./lib/serializer');

// ModelUtil
module.exports.ModelUtil = require('./lib/modelutil');
const ModelUtil = require('./lib/modelutil');

// ModelLoader
module.exports.ModelLoader = require('./lib/modelloader');
const ModelLoader = require('./lib/modelloader');


// DateTimeUtil
module.exports.DateTimeUtil = require('./lib/datetimeutil');
const DateTimeUtil = require('./lib/datetimeutil');

// Concerto
module.exports.Concerto = require('./lib/concerto');
const Concerto = require('./lib/concerto');

// MetaModel
module.exports.MetaModel = require('./lib/introspect/metamodel');
const MetaModel = require('./lib/introspect/metamodel');

// Version
module.exports.version = require('./package.json');
const version = require('./package.json');

module.exports = {
SecurityException,
IllegalModelException,
TypeNotFoundException,
Decorator,
DecoratorFactory,
ClassDeclaration,
IdentifiedDeclaration,
AssetDeclaration,
ConceptDeclaration,
EnumValueDeclaration,
EventDeclaration,
ParticipantDeclaration,
TransactionDeclaration,
Property,
Field,
EnumDeclaration,
RelationshipDeclaration,
Typed,
Identifiable,
Relationship,
Resource,
Factory,
Globalize,
Introspector,
ModelFile,
ModelManager,
Serializer,
ModelUtil,
ModelLoader,
DateTimeUtil,
Concerto,
MetaModel,
version
};
66 changes: 33 additions & 33 deletions packages/concerto-core/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
export var SecurityException: typeof import("./lib/securityexception");
export var IllegalModelException: typeof import("./lib/introspect/illegalmodelexception");
export var TypeNotFoundException: typeof import("./lib/typenotfoundexception");
export var Decorator: typeof import("./lib/introspect/decorator");
export var DecoratorFactory: typeof import("./lib/introspect/decoratorfactory");
export var ClassDeclaration: typeof import("./lib/introspect/classdeclaration");
export var IdentifiedDeclaration: typeof import("./lib/introspect/identifieddeclaration");
export var AssetDeclaration: typeof import("./lib/introspect/assetdeclaration");
export var ConceptDeclaration: typeof import("./lib/introspect/conceptdeclaration");
export var EnumValueDeclaration: typeof import("./lib/introspect/enumvaluedeclaration");
export var EventDeclaration: typeof import("./lib/introspect/eventdeclaration");
export var ParticipantDeclaration: typeof import("./lib/introspect/participantdeclaration");
export var TransactionDeclaration: typeof import("./lib/introspect/transactiondeclaration");
export var Property: typeof import("./lib/introspect/property");
export var Field: typeof import("./lib/introspect/field");
export var EnumDeclaration: typeof import("./lib/introspect/enumdeclaration");
export var RelationshipDeclaration: typeof import("./lib/introspect/relationshipdeclaration");
export var Typed: typeof import("./lib/model/typed");
export var Identifiable: typeof import("./lib/model/identifiable");
export var Relationship: typeof import("./lib/model/relationship");
export var Resource: typeof import("./lib/model/resource");
export var Factory: typeof import("./lib/factory");
export var Globalize: typeof import("./lib/globalize");
export var Introspector: typeof import("./lib/introspect/introspector");
export var ModelFile: typeof import("./lib/introspect/modelfile");
export var ModelManager: typeof import("./lib/modelmanager");
export var Serializer: typeof import("./lib/serializer");
export var ModelUtil: typeof import("./lib/modelutil");
export var ModelLoader: typeof import("./lib/modelloader");
export var DateTimeUtil: typeof import("./lib/datetimeutil");
export var Concerto: typeof import("./lib/concerto");
export var MetaModel: typeof import("./lib/introspect/metamodel");
export var version: any;
import SecurityException = require("./lib/securityexception");
import IllegalModelException = require("./lib/introspect/illegalmodelexception");
import TypeNotFoundException = require("./lib/typenotfoundexception");
import Decorator = require("./lib/introspect/decorator");
import DecoratorFactory = require("./lib/introspect/decoratorfactory");
import ClassDeclaration = require("./lib/introspect/classdeclaration");
import IdentifiedDeclaration = require("./lib/introspect/identifieddeclaration");
import AssetDeclaration = require("./lib/introspect/assetdeclaration");
import ConceptDeclaration = require("./lib/introspect/conceptdeclaration");
import EnumValueDeclaration = require("./lib/introspect/enumvaluedeclaration");
import EventDeclaration = require("./lib/introspect/eventdeclaration");
import ParticipantDeclaration = require("./lib/introspect/participantdeclaration");
import TransactionDeclaration = require("./lib/introspect/transactiondeclaration");
import Property = require("./lib/introspect/property");
import Field = require("./lib/introspect/field");
import EnumDeclaration = require("./lib/introspect/enumdeclaration");
import RelationshipDeclaration = require("./lib/introspect/relationshipdeclaration");
import Typed = require("./lib/model/typed");
import Identifiable = require("./lib/model/identifiable");
import Relationship = require("./lib/model/relationship");
import Resource = require("./lib/model/resource");
import Factory = require("./lib/factory");
import Globalize = require("./lib/globalize");
import Introspector = require("./lib/introspect/introspector");
import ModelFile = require("./lib/introspect/modelfile");
import ModelManager = require("./lib/modelmanager");
import Serializer = require("./lib/serializer");
import ModelUtil = require("./lib/modelutil");
import ModelLoader = require("./lib/modelloader");
import DateTimeUtil = require("./lib/datetimeutil");
import Concerto = require("./lib/concerto");
import MetaModel = require("./lib/introspect/metamodel");
export { SecurityException, IllegalModelException, TypeNotFoundException, Decorator, DecoratorFactory, ClassDeclaration, IdentifiedDeclaration, AssetDeclaration, ConceptDeclaration, EnumValueDeclaration, EventDeclaration, ParticipantDeclaration, TransactionDeclaration, Property, Field, EnumDeclaration, RelationshipDeclaration, Typed, Identifiable, Relationship, Resource, Factory, Globalize, Introspector, ModelFile, ModelManager, Serializer, ModelUtil, ModelLoader, DateTimeUtil, Concerto, MetaModel, version };
Loading

0 comments on commit 75c5b42

Please sign in to comment.