UNPKG

@glandjs/core

Version:

Glands is a web framework for Node.js (@core)

26 lines (25 loc) 856 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Module = void 0; const instance_wrapper_1 = require("./instance-wrapper"); class Module { constructor(token, metatype) { this.token = token; this.metatype = metatype; this.imports = new Set(); this.controllers = new Map(); this.channels = new Map(); } addImports(imports) { imports.forEach((imp) => this.imports.add(imp)); } addController(controller, instance) { const wrapper = new instance_wrapper_1.InstanceWrapper(controller, instance); this.controllers.set(controller, wrapper); } addChannel(channel, instance) { const wrapper = new instance_wrapper_1.InstanceWrapper(channel, instance); this.channels.set(channel, wrapper); } } exports.Module = Module;