UNPKG

7-segment-timer.client

Version:
35 lines (34 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _7_segment_timer_contracts_1 = require("7-segment-timer.contracts"); const http_client_1 = require("./http-client"); class SevenSegmentTimerClient { constructor(baseUrl) { this.httpClient = new http_client_1.HttpClient(baseUrl); } off() { return this.httpClient.get('/off'); } showCurrentTime(colors) { return this.httpClient.post(_7_segment_timer_contracts_1.routes.ShowCurrentTime, { color: colors }); } startTimer(time, colors) { return this.httpClient.post(_7_segment_timer_contracts_1.routes.StartTimer, { time: time, color: colors }); } cancelTimer() { return this.httpClient.post(_7_segment_timer_contracts_1.routes.CancelTimer); } changeColor(color) { return this.httpClient.post(_7_segment_timer_contracts_1.routes.ChangeColor, { color: color }); } changeMultipleColors(colors) { return this.httpClient.post(_7_segment_timer_contracts_1.routes.ChangeMultipleColors, { colors: colors }); } startAnimation(animation, colors) { return this.httpClient.post(_7_segment_timer_contracts_1.routes.StartAnimation, { animation: animation, colors: colors }); } stopAnimation() { return this.httpClient.post(_7_segment_timer_contracts_1.routes.StopAnimation); } } exports.default = SevenSegmentTimerClient;