ink 6.2.3 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/build/components/AppContext.d.ts +4 -4
  2. package/build/components/AppContext.js +2 -2
  3. package/build/components/AppContext.js.map +1 -1
  4. package/build/components/Box.d.ts +18 -18
  5. package/build/components/Box.js +2 -2
  6. package/build/components/Box.js.map +1 -1
  7. package/build/components/Newline.d.ts +6 -6
  8. package/build/components/Newline.js +2 -2
  9. package/build/components/Newline.js.map +1 -1
  10. package/build/components/Spacer.d.ts +4 -3
  11. package/build/components/Spacer.js +4 -3
  12. package/build/components/Spacer.js.map +1 -1
  13. package/build/components/Static.d.ts +12 -19
  14. package/build/components/Static.js +6 -11
  15. package/build/components/Static.js.map +1 -1
  16. package/build/components/StderrContext.d.ts +6 -8
  17. package/build/components/StderrContext.js +2 -2
  18. package/build/components/StderrContext.js.map +1 -1
  19. package/build/components/StdinContext.d.ts +8 -9
  20. package/build/components/StdinContext.js +2 -2
  21. package/build/components/StdinContext.js.map +1 -1
  22. package/build/components/StdoutContext.d.ts +6 -8
  23. package/build/components/StdoutContext.js +2 -2
  24. package/build/components/StdoutContext.js.map +1 -1
  25. package/build/components/Text.d.ts +24 -26
  26. package/build/components/Text.js +2 -2
  27. package/build/components/Text.js.map +1 -1
  28. package/build/components/Transform.d.ts +6 -10
  29. package/build/components/Transform.js +2 -5
  30. package/build/components/Transform.js.map +1 -1
  31. package/build/devtools.js +2 -0
  32. package/build/devtools.js.map +1 -1
  33. package/build/hooks/use-app.d.ts +2 -2
  34. package/build/hooks/use-app.js +2 -2
  35. package/build/hooks/use-app.js.map +1 -1
  36. package/build/hooks/use-focus-manager.d.ts +12 -18
  37. package/build/hooks/use-focus-manager.js +2 -3
  38. package/build/hooks/use-focus-manager.js.map +1 -1
  39. package/build/hooks/use-focus.d.ts +12 -17
  40. package/build/hooks/use-focus.js +2 -7
  41. package/build/hooks/use-focus.js.map +1 -1
  42. package/build/hooks/use-input.d.ts +54 -58
  43. package/build/hooks/use-input.js +20 -23
  44. package/build/hooks/use-input.js.map +1 -1
  45. package/build/hooks/use-is-screen-reader-enabled.d.ts +2 -3
  46. package/build/hooks/use-is-screen-reader-enabled.js +2 -3
  47. package/build/hooks/use-is-screen-reader-enabled.js.map +1 -1
  48. package/build/hooks/use-stderr.d.ts +2 -2
  49. package/build/hooks/use-stderr.js +2 -2
  50. package/build/hooks/use-stderr.js.map +1 -1
  51. package/build/hooks/use-stdin.d.ts +2 -2
  52. package/build/hooks/use-stdin.js +2 -2
  53. package/build/hooks/use-stdin.js.map +1 -1
  54. package/build/hooks/use-stdout.d.ts +2 -2
  55. package/build/hooks/use-stdout.js +2 -2
  56. package/build/hooks/use-stdout.js.map +1 -1
  57. package/build/ink.d.ts +1 -0
  58. package/build/ink.js +4 -2
  59. package/build/ink.js.map +1 -1
  60. package/build/measure-element.d.ts +6 -6
  61. package/build/measure-element.js +2 -2
  62. package/build/measure-element.js.map +1 -1
  63. package/build/options.d.ts +52 -0
  64. package/build/options.js +2 -0
  65. package/build/options.js.map +1 -0
  66. package/build/output.d.ts +6 -7
  67. package/build/output.js.map +1 -1
  68. package/build/render.d.ts +45 -38
  69. package/build/render.js +3 -2
  70. package/build/render.js.map +1 -1
  71. package/build/styles.d.ts +132 -141
  72. package/build/styles.js.map +1 -1
  73. package/package.json +3 -3
  74. package/readme.md +153 -153
@@ -0,0 +1,52 @@
1
+ export type CommonOptions = {
2
+ /**
3
+ * Output stream where app will be rendered.
4
+ *
5
+ * @default process.stdout
6
+ */
7
+ stdout?: NodeJS.WriteStream;
8
+ /**
9
+ * Input stream where app will listen for input.
10
+ *
11
+ * @default process.stdin
12
+ */
13
+ stdin?: NodeJS.ReadStream;
14
+ /**
15
+ * Error stream.
16
+ * @default process.stderr
17
+ */
18
+ stderr?: NodeJS.WriteStream;
19
+ /**
20
+ * If true, each update will be rendered as a separate output, without replacing the previous one.
21
+ *
22
+ * @default false
23
+ */
24
+ debug?: boolean;
25
+ /**
26
+ * Configure whether Ink should listen to Ctrl+C keyboard input and exit the app. This is needed in case `process.stdin` is in raw mode, because then Ctrl+C is ignored by default and process is expected to handle it manually.
27
+ *
28
+ * @default true
29
+ */
30
+ exitOnCtrlC?: boolean;
31
+ /**
32
+ * Patch console methods to ensure console output doesn't mix with Ink output.
33
+ *
34
+ * @default true
35
+ */
36
+ patchConsole?: boolean;
37
+ /**
38
+ * Enable screen reader support.
39
+ * See https://github.com/vadimdemedes/ink/blob/master/readme.md#screen-reader-support
40
+ *
41
+ * @default process.env['INK_SCREEN_READER'] === 'true'
42
+ */
43
+ isScreenReaderEnabled?: boolean;
44
+ /**
45
+ * Maximum frames per second for render updates.
46
+ * This controls how frequently the UI can update to prevent excessive re-rendering.
47
+ * Higher values allow more frequent updates but may impact performance.
48
+ *
49
+ * @default 30
50
+ */
51
+ maxFps?: number;
52
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":""}
package/build/output.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import { type OutputTransformer } from './render-node-to-output.js';
2
2
  /**
3
- * "Virtual" output class
4
- *
5
- * Handles the positioning and saving of the output of each node in the tree.
6
- * Also responsible for applying transformations to each character of the output.
7
- *
8
- * Used to generate the final output of all nodes before writing it to actual output stream (e.g. stdout)
9
- */
3
+ "Virtual" output class
4
+
5
+ Handles the positioning and saving of the output of each node in the tree. Also responsible for applying transformations to each character of the output.
6
+
7
+ Used to generate the final output of all nodes before writing it to actual output stream (e.g. stdout)
8
+ */
10
9
  type Options = {
11
10
  width: number;
12
11
  height: number;
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,WAAW,MAAM,cA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AED,MAAM,eAAe,GAAG,MAAM;aAC5B,GAAG,CAAC,IAAI,CAAC,EAAE;YACX,2EAA2E;YAC3E,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;YAEtE,OAAO,mBAAmB,CAAC,qBAAqB,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7D,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO;YACN,MAAM,EAAE,eAAe;YACvB,MAAM,EAAE,MAAM,CAAC,MAAM;SACrB,CAAC;IACH,CAAC;CACD"}
package/build/render.d.ts CHANGED
@@ -2,69 +2,76 @@ import type { ReactNode } from 'react';
2
2
  import Ink from './ink.js';
3
3
  export type RenderOptions = {
4
4
  /**
5
- * Output stream where app will be rendered.
6
- *
7
- * @default process.stdout
8
- */
5
+ Output stream where app will be rendered.
6
+
7
+ @default process.stdout
8
+ */
9
9
  stdout?: NodeJS.WriteStream;
10
10
  /**
11
- * Input stream where app will listen for input.
12
- *
13
- * @default process.stdin
14
- */
11
+ Input stream where app will listen for input.
12
+
13
+ @default process.stdin
14
+ */
15
15
  stdin?: NodeJS.ReadStream;
16
16
  /**
17
- * Error stream.
18
- * @default process.stderr
19
- */
17
+ Error stream.
18
+ @default process.stderr
19
+ */
20
20
  stderr?: NodeJS.WriteStream;
21
21
  /**
22
- * If true, each update will be rendered as a separate output, without replacing the previous one.
23
- *
24
- * @default false
25
- */
22
+ If true, each update will be rendered as separate output, without replacing the previous one.
23
+
24
+ @default false
25
+ */
26
26
  debug?: boolean;
27
27
  /**
28
- * Configure whether Ink should listen to Ctrl+C keyboard input and exit the app. This is needed in case `process.stdin` is in raw mode, because then Ctrl+C is ignored by default and process is expected to handle it manually.
29
- *
30
- * @default true
31
- */
28
+ Configure whether Ink should listen for Ctrl+C keyboard input and exit the app. This is needed in case `process.stdin` is in raw mode, because then Ctrl+C is ignored by default and the process is expected to handle it manually.
29
+
30
+ @default true
31
+ */
32
32
  exitOnCtrlC?: boolean;
33
33
  /**
34
- * Patch console methods to ensure console output doesn't mix with Ink output.
35
- *
36
- * @default true
37
- */
34
+ Patch console methods to ensure console output doesn't mix with Ink's output.
35
+
36
+ @default true
37
+ */
38
38
  patchConsole?: boolean;
39
39
  /**
40
- * Enable screen reader support.
41
- * See https://github.com/vadimdemedes/ink/blob/master/readme.md#screen-reader-support
42
- *
43
- * @default process.env['INK_SCREEN_READER'] === 'true'
44
- */
40
+ Enable screen reader support. See https://github.com/vadimdemedes/ink/blob/master/readme.md#screen-reader-support
41
+
42
+ @default process.env['INK_SCREEN_READER'] === 'true'
43
+ */
45
44
  isScreenReaderEnabled?: boolean;
45
+ /**
46
+ Maximum frames per second for render updates.
47
+ This controls how frequently the UI can update to prevent excessive re-rendering.
48
+ Higher values allow more frequent updates but may impact performance.
49
+
50
+ @default 30
51
+ */
52
+ maxFps?: number;
46
53
  };
47
54
  export type Instance = {
48
55
  /**
49
- * Replace previous root node with a new one or update props of the current root node.
50
- */
56
+ Replace the previous root node with a new one or update props of the current root node.
57
+ */
51
58
  rerender: Ink['render'];
52
59
  /**
53
- * Manually unmount the whole Ink app.
54
- */
60
+ Manually unmount the whole Ink app.
61
+ */
55
62
  unmount: Ink['unmount'];
56
63
  /**
57
- * Returns a promise, which resolves when app is unmounted.
58
- */
64
+ Returns a promise that resolves when the app is unmounted.
65
+ */
59
66
  waitUntilExit: Ink['waitUntilExit'];
60
67
  cleanup: () => void;
61
68
  /**
62
- * Clear output.
63
- */
69
+ Clear output.
70
+ */
64
71
  clear: () => void;
65
72
  };
66
73
  /**
67
- * Mount a component and render the output.
68
- */
74
+ Mount a component and render the output.
75
+ */
69
76
  declare const render: (node: ReactNode, options?: NodeJS.WriteStream | RenderOptions) => Instance;
70
77
  export default render;
package/build/render.js CHANGED
@@ -3,8 +3,8 @@ import process from 'node:process';
3
3
  import Ink from './ink.js';
4
4
  import instances from './instances.js';
5
5
  /**
6
- * Mount a component and render the output.
7
- */
6
+ Mount a component and render the output.
7
+ */
8
8
  const render = (node, options) => {
9
9
  const inkOptions = {
10
10
  stdout: process.stdout,
@@ -13,6 +13,7 @@ const render = (node, options) => {
13
13
  debug: false,
14
14
  exitOnCtrlC: true,
15
15
  patchConsole: true,
16
+ maxFps: 30,
16
17
  ...getOptions(options),
17
18
  };
18
19
  const instance = getInstance(inkOptions.stdout, () => new Ink(inkOptions));
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,GAAiC,MAAM,UAAU,CAAC;AACzD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAsEvC;;GAEG;AACH,MAAM,MAAM,GAAG,CACd,IAAe,EACf,OAA4C,EACjC,EAAE;IACb,MAAM,UAAU,GAAe;QAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;QAClB,GAAG,UAAU,CAAC,OAAO,CAAC;KACtB,CAAC;IAEF,MAAM,QAAQ,GAAQ,WAAW,CAChC,UAAU,CAAC,MAAM,EACjB,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CACzB,CAAC;IAEF,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEtB,OAAO;QACN,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,OAAO;YACN,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QACD,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,MA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,GAAQ,WAAW,CAChC,UAAU,CAAC,MAAM,EACjB,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CACzB,CAAC;IAEF,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEtB,OAAO;QACN,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,OAAO;YACN,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QACD,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;QAClD,KAAK,EAAE,QAAQ,CAAC,KAAK;KACrB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC;AAEtB,MAAM,UAAU,GAAG,CAClB,SAAyD,EAAE,EAC3C,EAAE;IAClB,IAAI,MAAM,YAAY,MAAM,EAAE,CAAC;QAC9B,OAAO;YACN,MAAM;YACN,KAAK,EAAE,OAAO,CAAC,KAAK;SACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CACnB,MAA0B,EAC1B,cAAyB,EACnB,EAAE;IACR,IAAI,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAErC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,QAAQ,GAAG,cAAc,EAAE,CAAC;QAC5B,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC"}
package/build/styles.d.ts CHANGED
@@ -6,243 +6,234 @@ export type Styles = {
6
6
  readonly textWrap?: 'wrap' | 'end' | 'middle' | 'truncate-end' | 'truncate' | 'truncate-middle' | 'truncate-start';
7
7
  readonly position?: 'absolute' | 'relative';
8
8
  /**
9
- * Size of the gap between an element's columns.
10
- */
9
+ Size of the gap between an element's columns.
10
+ */
11
11
  readonly columnGap?: number;
12
12
  /**
13
- * Size of the gap between element's rows.
14
- */
13
+ Size of the gap between an element's rows.
14
+ */
15
15
  readonly rowGap?: number;
16
16
  /**
17
- * Size of the gap between an element's columns and rows. Shorthand for `columnGap` and `rowGap`.
18
- */
17
+ Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
18
+ */
19
19
  readonly gap?: number;
20
20
  /**
21
- * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`.
22
- */
21
+ Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
22
+ */
23
23
  readonly margin?: number;
24
24
  /**
25
- * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
26
- */
25
+ Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
26
+ */
27
27
  readonly marginX?: number;
28
28
  /**
29
- * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
30
- */
29
+ Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
30
+ */
31
31
  readonly marginY?: number;
32
32
  /**
33
- * Top margin.
34
- */
33
+ Top margin.
34
+ */
35
35
  readonly marginTop?: number;
36
36
  /**
37
- * Bottom margin.
38
- */
37
+ Bottom margin.
38
+ */
39
39
  readonly marginBottom?: number;
40
40
  /**
41
- * Left margin.
42
- */
41
+ Left margin.
42
+ */
43
43
  readonly marginLeft?: number;
44
44
  /**
45
- * Right margin.
46
- */
45
+ Right margin.
46
+ */
47
47
  readonly marginRight?: number;
48
48
  /**
49
- * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`.
50
- */
49
+ Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
50
+ */
51
51
  readonly padding?: number;
52
52
  /**
53
- * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
54
- */
53
+ Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
54
+ */
55
55
  readonly paddingX?: number;
56
56
  /**
57
- * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
58
- */
57
+ Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
58
+ */
59
59
  readonly paddingY?: number;
60
60
  /**
61
- * Top padding.
62
- */
61
+ Top padding.
62
+ */
63
63
  readonly paddingTop?: number;
64
64
  /**
65
- * Bottom padding.
66
- */
65
+ Bottom padding.
66
+ */
67
67
  readonly paddingBottom?: number;
68
68
  /**
69
- * Left padding.
70
- */
69
+ Left padding.
70
+ */
71
71
  readonly paddingLeft?: number;
72
72
  /**
73
- * Right padding.
74
- */
73
+ Right padding.
74
+ */
75
75
  readonly paddingRight?: number;
76
76
  /**
77
- * This property defines the ability for a flex item to grow if necessary.
78
- * See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
79
- */
77
+ This property defines the ability for a flex item to grow if necessary.
78
+ See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
79
+ */
80
80
  readonly flexGrow?: number;
81
81
  /**
82
- * It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row.
83
- * See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
84
- */
82
+ It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row.
83
+ See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
84
+ */
85
85
  readonly flexShrink?: number;
86
86
  /**
87
- * It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
88
- * See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
89
- */
87
+ It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
88
+ See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
89
+ */
90
90
  readonly flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
91
91
  /**
92
- * It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
93
- * See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
94
- */
92
+ It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
93
+ See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
94
+ */
95
95
  readonly flexBasis?: number | string;
96
96
  /**
97
- * It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
98
- * See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
99
- */
97
+ It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
98
+ See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
99
+ */
100
100
  readonly flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
101
101
  /**
102
- * The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
103
- * See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
104
- */
102
+ The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
103
+ See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
104
+ */
105
105
  readonly alignItems?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
106
106
  /**
107
- * It makes possible to override the align-items value for specific flex items.
108
- * See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
109
- */
107
+ It makes possible to override the align-items value for specific flex items.
108
+ See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
109
+ */
110
110
  readonly alignSelf?: 'flex-start' | 'center' | 'flex-end' | 'auto';
111
111
  /**
112
- * It defines the alignment along the main axis.
113
- * See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
114
- */
112
+ It defines the alignment along the main axis.
113
+ See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
114
+ */
115
115
  readonly justifyContent?: 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly' | 'center';
116
116
  /**
117
- * Width of the element in spaces.
118
- * You can also set it in percent, which will calculate the width based on the width of parent element.
119
- */
117
+ Width of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
118
+ */
120
119
  readonly width?: number | string;
121
120
  /**
122
- * Height of the element in lines (rows).
123
- * You can also set it in percent, which will calculate the height based on the height of parent element.
124
- */
121
+ Height of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
122
+ */
125
123
  readonly height?: number | string;
126
124
  /**
127
- * Sets a minimum width of the element.
128
- */
125
+ Sets a minimum width of the element.
126
+ */
129
127
  readonly minWidth?: number | string;
130
128
  /**
131
- * Sets a minimum height of the element.
132
- */
129
+ Sets a minimum height of the element.
130
+ */
133
131
  readonly minHeight?: number | string;
134
132
  /**
135
- * Set this property to `none` to hide the element.
136
- */
133
+ Set this property to `none` to hide the element.
134
+ */
137
135
  readonly display?: 'flex' | 'none';
138
136
  /**
139
- * Add a border with a specified style.
140
- * If `borderStyle` is `undefined` (which it is by default), no border will be added.
141
- */
137
+ Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
138
+ */
142
139
  readonly borderStyle?: keyof Boxes | BoxStyle;
143
140
  /**
144
- * Determines whether top border is visible.
145
- *
146
- * @default true
147
- */
141
+ Determines whether top border is visible.
142
+
143
+ @default true
144
+ */
148
145
  readonly borderTop?: boolean;
149
146
  /**
150
- * Determines whether bottom border is visible.
151
- *
152
- * @default true
153
- */
147
+ Determines whether bottom border is visible.
148
+
149
+ @default true
150
+ */
154
151
  readonly borderBottom?: boolean;
155
152
  /**
156
- * Determines whether left border is visible.
157
- *
158
- * @default true
159
- */
153
+ Determines whether left border is visible.
154
+
155
+ @default true
156
+ */
160
157
  readonly borderLeft?: boolean;
161
158
  /**
162
- * Determines whether right border is visible.
163
- *
164
- * @default true
165
- */
159
+ Determines whether right border is visible.
160
+
161
+ @default true
162
+ */
166
163
  readonly borderRight?: boolean;
167
164
  /**
168
- * Change border color.
169
- * Shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor` and `borderLeftColor`.
170
- */
165
+ Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
166
+ */
171
167
  readonly borderColor?: LiteralUnion<ForegroundColorName, string>;
172
168
  /**
173
- * Change top border color.
174
- * Accepts the same values as `color` in `Text` component.
175
- */
169
+ Change top border color. Accepts the same values as `color` in `Text` component.
170
+ */
176
171
  readonly borderTopColor?: LiteralUnion<ForegroundColorName, string>;
177
172
  /**
178
- * Change bottom border color.
179
- * Accepts the same values as `color` in `Text` component.
180
- */
173
+ Change bottom border color. Accepts the same values as `color` in `Text` component.
174
+ */
181
175
  readonly borderBottomColor?: LiteralUnion<ForegroundColorName, string>;
182
176
  /**
183
- * Change left border color.
184
- * Accepts the same values as `color` in `Text` component.
185
- */
177
+ Change left border color. Accepts the same values as `color` in `Text` component.
178
+ */
186
179
  readonly borderLeftColor?: LiteralUnion<ForegroundColorName, string>;
187
180
  /**
188
- * Change right border color.
189
- * Accepts the same values as `color` in `Text` component.
190
- */
181
+ Change right border color. Accepts the same values as `color` in `Text` component.
182
+ */
191
183
  readonly borderRightColor?: LiteralUnion<ForegroundColorName, string>;
192
184
  /**
193
- * Dim the border color.
194
- * Shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor` and `borderRightDimColor`.
195
- *
196
- * @default false
197
- */
185
+ Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
186
+
187
+ @default false
188
+ */
198
189
  readonly borderDimColor?: boolean;
199
190
  /**
200
- * Dim the top border color.
201
- *
202
- * @default false
203
- */
191
+ Dim the top border color.
192
+
193
+ @default false
194
+ */
204
195
  readonly borderTopDimColor?: boolean;
205
196
  /**
206
- * Dim the bottom border color.
207
- *
208
- * @default false
209
- */
197
+ Dim the bottom border color.
198
+
199
+ @default false
200
+ */
210
201
  readonly borderBottomDimColor?: boolean;
211
202
  /**
212
- * Dim the left border color.
213
- *
214
- * @default false
215
- */
203
+ Dim the left border color.
204
+
205
+ @default false
206
+ */
216
207
  readonly borderLeftDimColor?: boolean;
217
208
  /**
218
- * Dim the right border color.
219
- *
220
- * @default false
221
- */
209
+ Dim the right border color.
210
+
211
+ @default false
212
+ */
222
213
  readonly borderRightDimColor?: boolean;
223
214
  /**
224
- * Behavior for an element's overflow in both directions.
225
- *
226
- * @default 'visible'
227
- */
215
+ Behavior for an element's overflow in both directions.
216
+
217
+ @default 'visible'
218
+ */
228
219
  readonly overflow?: 'visible' | 'hidden';
229
220
  /**
230
- * Behavior for an element's overflow in horizontal direction.
231
- *
232
- * @default 'visible'
233
- */
221
+ Behavior for an element's overflow in the horizontal direction.
222
+
223
+ @default 'visible'
224
+ */
234
225
  readonly overflowX?: 'visible' | 'hidden';
235
226
  /**
236
- * Behavior for an element's overflow in vertical direction.
237
- *
238
- * @default 'visible'
239
- */
227
+ Behavior for an element's overflow in the vertical direction.
228
+
229
+ @default 'visible'
230
+ */
240
231
  readonly overflowY?: 'visible' | 'hidden';
241
232
  /**
242
- * Background color for the element.
243
- *
244
- * Accepts the same values as `color` in the `<Text>` component.
245
- */
233
+ Background color for the element.
234
+
235
+ Accepts the same values as `color` in the `<Text>` component.
236
+ */
246
237
  readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
247
238
  };
248
239
  declare const styles: (node: YogaNode, style?: Styles) => void;