botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
62 lines • 2.17 kB
JavaScript
;
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticActivityTemplate = void 0;
/**
* Defines a static activity as a template.
*/
class StaticActivityTemplate {
/**
* Intialize a new instance of StaticActivityTemplate class.
*
* @param activity Activity as a template.
*/
constructor(activity) {
this.toString = () => {
return `${this.activity.text}`;
};
this.activity = activity;
}
/**
* @param _property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
getConverter(_property) {
return undefined;
}
/**
* @param config The configuration.
* @returns A object with the given configuration.
*/
configure(config) {
const { activity } = config;
this.activity = activity;
return this;
}
/**
* @returns A promise representing the asynchronous operation.
*/
bind() {
return __awaiter(this, void 0, void 0, function* () {
return Promise.resolve(this.activity);
});
}
}
exports.StaticActivityTemplate = StaticActivityTemplate;
StaticActivityTemplate.$kind = 'Microsoft.StaticActivityTemplate';
//# sourceMappingURL=staticActivityTemplate.js.map