|
4 | 4 | ---@alias undefined any |
5 | 5 |
|
6 | 6 | ---@alias Color string |
7 | | ----@alias Align integer |
8 | | ----@alias Wrap integer |
9 | 7 | ---@alias Direction integer |
10 | 8 | ---@alias Position integer |
11 | 9 | ---@alias Stdio integer |
@@ -610,15 +608,11 @@ ya = ya |
610 | 608 | -- | Return | `integer` | |
611 | 609 | ---@field width fun(self: self): integer |
612 | 610 | -- Set the alignment of the line. |
613 | | --- | In/Out | Type | |
614 | | --- | ------- | ------- | |
615 | | --- | `self` | `Self` | |
616 | | --- | `align` | `Align` | |
617 | | --- | Return | `self` | |
618 | | --- The `align` accepts the following constants: |
619 | | --- - `ui.Line.LEFT` |
620 | | --- - `ui.Line.CENTER` |
621 | | --- - `ui.Line.RIGHT` |
| 611 | +-- | In/Out | Type | |
| 612 | +-- | ------- | ----------------- | |
| 613 | +-- | `self` | `Self` | |
| 614 | +-- | `align` | [`Align`](#align) | |
| 615 | +-- | Return | `self` | |
622 | 616 | ---@field align fun(self: self, align: Align): self |
623 | 617 | -- Whether the line is visible, i.e. includes any printable characters. |
624 | 618 | -- | In/Out | Type | |
@@ -665,26 +659,18 @@ ya = ya |
665 | 659 | -- If `rect` is not specified, it returns the current area. |
666 | 660 | ---@field area fun(self: self, rect: ui.Rect?): self|ui.Rect |
667 | 661 | -- Set the alignment of the text. |
668 | | --- | In/Out | Type | |
669 | | --- | ------- | ------- | |
670 | | --- | `self` | `Self` | |
671 | | --- | `align` | `Align` | |
672 | | --- | Return | `self` | |
673 | | --- The `align` accepts the following constants: |
674 | | --- - `ui.Text.LEFT` |
675 | | --- - `ui.Text.CENTER` |
676 | | --- - `ui.Text.RIGHT` |
| 662 | +-- | In/Out | Type | |
| 663 | +-- | ------- | ----------------- | |
| 664 | +-- | `self` | `Self` | |
| 665 | +-- | `align` | [`Align`](#align) | |
| 666 | +-- | Return | `self` | |
677 | 667 | ---@field align fun(self: self, align: Align): self |
678 | 668 | -- Set the wrap of the text. |
679 | | --- | In/Out | Type | |
680 | | --- | ------ | ------ | |
681 | | --- | `self` | `Self` | |
682 | | --- | `wrap` | `Wrap` | |
683 | | --- | Return | `self` | |
684 | | --- The `wrap` accepts the following constants: |
685 | | --- - `ui.Text.WRAP_NO` - No wrap |
686 | | --- - `ui.Text.WRAP` - Wrap at the end of the line |
687 | | --- - `ui.Text.WRAP_TRIM` - Wrap at the end of the line, and trim the leading whitespace |
| 669 | +-- | In/Out | Type | |
| 670 | +-- | ------ | --------------- | |
| 671 | +-- | `self` | `Self` | |
| 672 | +-- | `wrap` | [`Wrap`](#wrap) | |
| 673 | +-- | Return | `self` | |
688 | 674 | ---@field wrap fun(self: self, wrap: Wrap): self |
689 | 675 | -- Calculate the maximum width of the text across all lines. |
690 | 676 | -- | In/Out | Type | |
@@ -921,15 +907,9 @@ ya = ya |
921 | 907 |
|
922 | 908 | -- Create a bar: |
923 | 909 | -- ```lua |
924 | | --- ui.Bar(direction) |
| 910 | +-- ui.Bar(edge) |
925 | 911 | -- ``` |
926 | | --- The first attribute denotes the direction of the bar and accepts the following constants: |
927 | | --- - `ui.Bar.NONE` |
928 | | --- - `ui.Bar.TOP` |
929 | | --- - `ui.Bar.RIGHT` |
930 | | --- - `ui.Bar.BOTTOM` |
931 | | --- - `ui.Bar.LEFT` |
932 | | --- - `ui.Bar.ALL` |
| 912 | +-- The first attribute denotes the direction of the bar and accepts an [`Edge`](#edge) constant. |
933 | 913 | ---@class (exact) ui.Bar |
934 | 914 | -- Set the area of the bar. |
935 | 915 | -- | In/Out | Type | |
@@ -957,15 +937,9 @@ ya = ya |
957 | 937 |
|
958 | 938 | -- Create a border: |
959 | 939 | -- ```lua |
960 | | --- ui.Border(position) |
| 940 | +-- ui.Border(edge) |
961 | 941 | -- ``` |
962 | | --- The first attribute denotes the position of the border and accepts the following constants: |
963 | | --- - `ui.Border.NONE` |
964 | | --- - `ui.Border.TOP` |
965 | | --- - `ui.Border.RIGHT` |
966 | | --- - `ui.Border.BOTTOM` |
967 | | --- - `ui.Border.LEFT` |
968 | | --- - `ui.Border.ALL` |
| 942 | +-- The first attribute denotes the edge of the border and accepts an [`Edge`](#edge) constant. |
969 | 943 | ---@class (exact) ui.Border |
970 | 944 | -- Set the area of the border. |
971 | 945 | -- | In/Out | Type | |
@@ -996,7 +970,7 @@ ya = ya |
996 | 970 | -- | `style` | [`Style`](#style) | |
997 | 971 | -- | Return | `self` | |
998 | 972 | ---@field style fun(self: self, style: ui.Style): self |
999 | | ----@overload fun(value: Position): ui.Border |
| 973 | +---@overload fun(edge: Edge): ui.Border |
1000 | 974 |
|
1001 | 975 | -- Create a gauge: |
1002 | 976 | -- ```lua |
@@ -1067,6 +1041,75 @@ ya = ya |
1067 | 1041 | ---@field area fun(self: self, rect: ui.Rect?): self|ui.Rect |
1068 | 1042 | ---@overload fun(): ui.Clear |
1069 | 1043 |
|
| 1044 | +-- Align is used to set the alignment of an element, such as a [Line](#line) or [Text](#text). |
| 1045 | +---@class (exact) Align |
| 1046 | +-- Align to the left. |
| 1047 | +-- | | | |
| 1048 | +-- | ---- | ----------- | |
| 1049 | +-- | Type | `undefined` | |
| 1050 | +---@field LEFT undefined |
| 1051 | +-- Align to the center. |
| 1052 | +-- | | | |
| 1053 | +-- | ---- | ----------- | |
| 1054 | +-- | Type | `undefined` | |
| 1055 | +---@field CENTER undefined |
| 1056 | +-- Align to the right. |
| 1057 | +-- | | | |
| 1058 | +-- | ---- | ----------- | |
| 1059 | +-- | Type | `undefined` | |
| 1060 | +---@field RIGHT undefined |
| 1061 | + |
| 1062 | +-- |
| 1063 | +---@class (exact) Wrap |
| 1064 | +-- Disables wrapping. |
| 1065 | +-- | | | |
| 1066 | +-- | ---- | ----------- | |
| 1067 | +-- | Type | `undefined` | |
| 1068 | +---@field NO undefined |
| 1069 | +-- Enables wrapping. |
| 1070 | +-- | | | |
| 1071 | +-- | ---- | ----------- | |
| 1072 | +-- | Type | `undefined` | |
| 1073 | +---@field YES undefined |
| 1074 | +-- Enables wrapping and trims the leading whitespace. |
| 1075 | +-- | | | |
| 1076 | +-- | ---- | ----------- | |
| 1077 | +-- | Type | `undefined` | |
| 1078 | +---@field TRIM undefined |
| 1079 | + |
| 1080 | +-- |
| 1081 | +---@class (exact) Edge |
| 1082 | +-- No edge is applied. |
| 1083 | +-- | | | |
| 1084 | +-- | ---- | ----------- | |
| 1085 | +-- | Type | `undefined` | |
| 1086 | +---@field NONE undefined |
| 1087 | +-- Applies the top edge. |
| 1088 | +-- | | | |
| 1089 | +-- | ---- | ----------- | |
| 1090 | +-- | Type | `undefined` | |
| 1091 | +---@field TOP undefined |
| 1092 | +-- Applies the right edge. |
| 1093 | +-- | | | |
| 1094 | +-- | ---- | ----------- | |
| 1095 | +-- | Type | `undefined` | |
| 1096 | +---@field RIGHT undefined |
| 1097 | +-- Applies the bottom edge. |
| 1098 | +-- | | | |
| 1099 | +-- | ---- | ----------- | |
| 1100 | +-- | Type | `undefined` | |
| 1101 | +---@field BOTTOM undefined |
| 1102 | +-- Applies the left edge. |
| 1103 | +-- | | | |
| 1104 | +-- | ---- | ----------- | |
| 1105 | +-- | Type | `undefined` | |
| 1106 | +---@field LEFT undefined |
| 1107 | +-- Applies all edges. |
| 1108 | +-- | | | |
| 1109 | +-- | ---- | ----------- | |
| 1110 | +-- | Type | `undefined` | |
| 1111 | +---@field ALL undefined |
| 1112 | + |
1070 | 1113 |
|
1071 | 1114 | -- You can access all states within [sync context](/docs/plugins/overview#sync-context) through `cx`. |
1072 | 1115 | ---@class (exact) cx |
@@ -2073,7 +2116,7 @@ ya = ya |
2073 | 2116 | -- | `self` | `Self` | |
2074 | 2117 | -- | `args` | `string[]` | |
2075 | 2118 | -- | Return | `self` | |
2076 | | ----@field args fun(args: string[]): self |
| 2119 | +---@field args fun(self: self, args: string[]): self |
2077 | 2120 | -- Set the current working directory of the command: |
2078 | 2121 | -- ```lua |
2079 | 2122 | -- local cmd = Command("ls"):cwd("/root") |
@@ -2384,11 +2427,11 @@ ya = ya |
2384 | 2427 | -- | Return | `Self` | |
2385 | 2428 | ---@field Bar fun(value: Direction): ui.Bar |
2386 | 2429 | -- Make a new border. |
2387 | | --- | In/Out | Type | |
2388 | | --- | ------- | ---------- | |
2389 | | --- | `value` | `Position` | |
2390 | | --- | Return | `Self` | |
2391 | | ----@field Border fun(value: Position): ui.Border |
| 2430 | +-- | In/Out | Type | |
| 2431 | +-- | ------ | --------------- | |
| 2432 | +-- | `edge` | [`Edge`](#edge) | |
| 2433 | +-- | Return | `Self` | |
| 2434 | +---@field Border fun(edge: Edge): ui.Border |
2392 | 2435 | -- Make a new gauge. |
2393 | 2436 | -- | In/Out | Type | |
2394 | 2437 | -- | ------ | ------ | |
|
0 commit comments