UNPKG

3.72 kBJavaScriptView Raw
1"use strict";
2var _a;
3Object.defineProperty(exports, "__esModule", { value: true });
4exports.TextWidget = void 0;
5const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
6const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
7const widget_1 = require("./widget");
8/**
9 * A dashboard widget that displays MarkDown
10 */
11class TextWidget extends widget_1.ConcreteWidget {
12 constructor(props) {
13 super(props.width || 6, props.height || 2);
14 try {
15 jsiiDeprecationWarnings._aws_cdk_aws_cloudwatch_TextWidgetProps(props);
16 }
17 catch (error) {
18 if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
19 Error.captureStackTrace(error, TextWidget);
20 }
21 throw error;
22 }
23 this.markdown = props.markdown;
24 }
25 position(x, y) {
26 this.x = x;
27 this.y = y;
28 }
29 toJson() {
30 return [{
31 type: 'text',
32 width: this.width,
33 height: this.height,
34 x: this.x,
35 y: this.y,
36 properties: {
37 markdown: this.markdown,
38 },
39 }];
40 }
41}
42exports.TextWidget = TextWidget;
43_a = JSII_RTTI_SYMBOL_1;
44TextWidget[_a] = { fqn: "@aws-cdk/aws-cloudwatch.TextWidget", version: "1.198.0" };
45//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRleHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEscUNBQTBDO0FBMEIxQzs7R0FFRztBQUNILE1BQWEsVUFBVyxTQUFRLHVCQUFjO0lBRzVDLFlBQVksS0FBc0I7UUFDaEMsS0FBSyxDQUFDLEtBQUssQ0FBQyxLQUFLLElBQUksQ0FBQyxFQUFFLEtBQUssQ0FBQyxNQUFNLElBQUksQ0FBQyxDQUFDLENBQUM7Ozs7OzsrQ0FKbEMsVUFBVTs7OztRQUtuQixJQUFJLENBQUMsUUFBUSxHQUFHLEtBQUssQ0FBQ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