botbuilder-core
Version:
Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.
49 lines • 2.1 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertBotComponent = exports.BotComponent = void 0;
const z = __importStar(require("zod"));
/**
* Definition of a BotComponent that allows registration of services, custom actions, memory scopes and adapters.
*
* To make your components available to the system you derive from BotComponent and register services to add functionality.
* These components then are consumed in appropriate places by the systems that need them. When using Composer, configureServices
* gets called automatically on the components by the bot runtime, as long as the components are registered in the configuration.
*/
class BotComponent {
}
exports.BotComponent = BotComponent;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
BotComponent.z = z.custom((val) => typeof val.configureServices === 'function', {
message: 'BotComponent',
});
/**
* @internal
*
* @deprecated Use `BotComponent.z.parse()` instead.
*/
function assertBotComponent(val, ..._args) {
BotComponent.z.parse(val);
}
exports.assertBotComponent = assertBotComponent;
//# sourceMappingURL=botComponent.js.map