botbuilder-core
Version:
Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.
35 lines • 1.13 kB
JavaScript
/**
* @module botbuilder
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentRegistration = void 0;
/**
* ComponentRegistration is a signature class for discovering assets from components.
*/
class ComponentRegistration {
/**
* Gets list of all ComponentRegistration objects registered.
*
* @returns A list of ComponentRegistration objects.
*/
static get components() {
return Array.from(ComponentRegistration._components.values());
}
/**
* Add a component, only one instance per type is allowed for components.
*
* @param componentRegistration The component to be registered.
*/
static add(componentRegistration) {
const name = componentRegistration.constructor.name;
ComponentRegistration._components.set(name, componentRegistration);
}
}
exports.ComponentRegistration = ComponentRegistration;
ComponentRegistration._components = new Map();
//# sourceMappingURL=componentRegistration.js.map
;