terminalservice.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  3. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  5. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  6. return c > 3 && r && Object.defineProperty(target, key, r), r;
  7. };
  8. Object.defineProperty(exports, "__esModule", { value: true });
  9. var core_1 = require("@angular/core");
  10. var rxjs_1 = require("rxjs");
  11. var TerminalService = /** @class */ (function () {
  12. function TerminalService() {
  13. this.commandSource = new rxjs_1.Subject();
  14. this.responseSource = new rxjs_1.Subject();
  15. this.commandHandler = this.commandSource.asObservable();
  16. this.responseHandler = this.responseSource.asObservable();
  17. }
  18. TerminalService.prototype.sendCommand = function (command) {
  19. if (command) {
  20. this.commandSource.next(command);
  21. }
  22. };
  23. TerminalService.prototype.sendResponse = function (response) {
  24. if (response) {
  25. this.responseSource.next(response);
  26. }
  27. };
  28. TerminalService = __decorate([
  29. core_1.Injectable()
  30. ], TerminalService);
  31. return TerminalService;
  32. }());
  33. exports.TerminalService = TerminalService;
  34. //# sourceMappingURL=terminalservice.js.map