Skip to content

Commit e70e0ec

Browse files
authored
🤖 Merge PR DefinitelyTyped#74153 Updating Box Element properties to include align and valign by @hashkeeper
1 parent e7d5d04 commit e70e0ec

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

‎types/blessed/blessed-tests.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,22 @@ screen.key("q", function() {
876876

877877
screen.render();
878878

879+
// Adding align and valign properties to Box element
880+
881+
const box8 = blessed.box({
882+
left: 1,
883+
top: 2,
884+
height: 6,
885+
width: 8,
886+
content: "test",
887+
style: {
888+
bg: "green",
889+
},
890+
});
891+
892+
box8.align = "center";
893+
box8.valign = "middle";
894+
879895
// https://github.com/chjj/blessed/blob/master/test/program-mouse.js
880896

881897
const program = blessed.program({

‎types/blessed/index.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,12 @@ export namespace Widgets {
21832183
* Original options object.
21842184
*/
21852185
options: BoxOptions;
2186+
2187+
/**
2188+
* Content/Text alignment
2189+
*/
2190+
align: "left" | "center" | "right";
2191+
valign: "top" | "middle" | "bottom";
21862192
}
21872193

21882194
interface TextOptions extends ElementOptions {

0 commit comments

Comments
 (0)