UNPKG

yandex-dialoger

Version:

Ещё одна библиотека/фреймворк для разработки навыков Алисы.

22 lines (21 loc) 671 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransitionProcessor = void 0; class TransitionProcessor { constructor(transitionHandler, replyHandler) { this.transitionHandler = transitionHandler; this.replyHandler = replyHandler; this.applyReply = (replyBuilder, state) => { if (this.replyHandler) { this.replyHandler(replyBuilder, state); } }; } hasReply() { return Boolean(this.replyHandler); } async applyTransition(state) { return this.transitionHandler(state); } } exports.TransitionProcessor = TransitionProcessor;