From 9ebb9d449de71c3f0ef86ccdf0cd9d91c3a245c0 Mon Sep 17 00:00:00 2001 From: FiretronP75 Date: Wed, 14 Feb 2024 15:34:10 -0600 Subject: [PATCH] Include ColorEnum type in color fields in optional parameter definitions. --- .../hs.charting.def.lua | 30 +++++----- .../hs.input-fields.def.lua | 7 +++ .../hs.memory-helpers.def.lua | 2 +- haas-production/hs.charting.def.lua | 30 +++++----- haas-production/hs.input-fields.def.lua | 7 +++ haas-production/hs.memory-helpers.def.lua | 2 +- haas-staging-flex-numbers/hs.charting.def.lua | 30 +++++----- .../hs.memory-helpers.def.lua | 2 +- haas-staging/hs.charting.def.lua | 30 +++++----- haas-staging/hs.memory-helpers.def.lua | 2 +- .../sample/command-production.sample.ts | 58 +++++++++++++++++++ .../optional-parameter-parsing.service.ts | 11 ++-- 12 files changed, 143 insertions(+), 68 deletions(-) diff --git a/haas-production-flex-numbers/hs.charting.def.lua b/haas-production-flex-numbers/hs.charting.def.lua index 1572d2c..fb26556 100644 --- a/haas-production-flex-numbers/hs.charting.def.lua +++ b/haas-production-flex-numbers/hs.charting.def.lua @@ -8,8 +8,8 @@ function ChangeColorOpacity(color, opacity) end --- The optional parameters of ChartAddAxisLabel. --- @shape OptionalParametersOf_ChartAddAxisLabel ---- @field color string | nil The label fill color. ---- @field textColor string | nil The text color. +--- @field color string | ColorEnum | nil The label fill color. +--- @field textColor string | ColorEnum | nil The text color. --- Adds a label on the y-axis. --- @param chartId number | number[] The chart index on which to add the label. @@ -66,7 +66,7 @@ function ChartSetOptions(chartId, title, height, style) end --- The optional parameters of LineOptions. --- @shape OptionalParametersOf_LineOptions ---- @field color string | nil The color of the line. +--- @field color string | ColorEnum | nil The color of the line. --- @field style Enum | nil The style of the line (Spiked, Smooth, Step and others). --- @field deco Enum | nil The line decoration (Solid, Dashed, Dotted). --- @field width number | number[] | nil The width of the line. @@ -116,7 +116,7 @@ function MarkCandle(chartId, depth) end --- The optional parameters of Plot. --- @shape OptionalParametersOf_Plot ---- @field colorOrOptions any | nil Line options object or a color string. +--- @field colorOrOptions any | ColorEnum | nil Line options object or a color string. --- Creates a data line on the chart. The line can be styled accordingly. A positive chartId will place the line below the main price chart. A negative index above. --- @param chartId number | number[] Index on which to plot the line. @@ -138,7 +138,7 @@ function PlotBands(lineGuid1, lineGuid2, fillColor) end --- The optional parameters of PlotBars. --- @shape OptionalParametersOf_PlotBars --- @field baseValue number | number[] | nil The value from where the bars are drawn. Default is 0. ---- @field fillColor string | nil The inner color of the bars. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the bars. Default is none. --- Changes a line to bars. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -174,7 +174,7 @@ function PlotBuySellZone(chartId, start, endValue) end --- The optional parameters of PlotCircle. --- @shape OptionalParametersOf_PlotCircle ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into circles. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -193,7 +193,7 @@ function PlotCloud(lineGuid1, lineGuid2, opacity) end --- The optional parameters of PlotDoubleColor. --- @shape OptionalParametersOf_PlotDoubleColor ---- @field fillColor string | nil The inner color between the line and the base value. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color between the line and the base value. Default is none. --- Changes the color of the line based on a base value. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -291,11 +291,11 @@ function PlotPivot(leftStrength, rightStrength) end --- @shape OptionalParametersOf_PlotPrice --- @field interval number | number[] | nil The interval which to plot. --- @field style Enum | nil The price plot style. ---- @field upColor string | nil The outer color of the up candle. +--- @field upColor string | ColorEnum | nil The outer color of the up candle. --- @field upFill boolean | nil The inner color of the up candle. ---- @field downColor string | nil The outer color of the down candle. +--- @field downColor string | ColorEnum | nil The outer color of the down candle. --- @field downFill boolean | nil The inner color of the down candle. ---- @field markColor string | nil The outer color of the marked candle. +--- @field markColor string | ColorEnum | nil The outer color of the marked candle. --- @field markFill boolean | nil The inner color of the marked candle. --- Creates a price plot. Candlestick by default. @@ -325,11 +325,11 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor, --- @shape OptionalParametersOf_PlotShape --- @field chartId number | number[] | nil Index on which to plot the line. --- @field shape Enum | nil The shape type. ---- @field color string | nil The color of the shape. +--- @field color string | ColorEnum | nil The color of the shape. --- @field size number | number[] | nil Size of the shape. --- @field aboveCandle boolean | nil If true, the shape will be drawn above the candle else below. --- @field text string | nil Text above or below the candle or shape. ---- @field textColor string | nil The color of the text. +--- @field textColor string | ColorEnum | nil The color of the text. --- @field offset number | number[] | nil A positive offset will move the data points x number of candles. A negative number will move the data points back. --- Draws a shape above the candle or first line on the chart. @@ -355,7 +355,7 @@ function PlotShape(chartId, shape, color, size, aboveCandle, text, textColor, of --- The optional parameters of PlotShapes. --- @shape OptionalParametersOf_PlotShapes ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into a specific shape. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -409,8 +409,8 @@ function PlotVerticalZone(chartId, name, color, start, endValue) end --- The optional parameters of PlotVolume. --- @shape OptionalParametersOf_PlotVolume ---- @field upColor string | nil The outer color of the up candle volume bars. ---- @field downColor string | nil The outer color of the down candle volume bars. +--- @field upColor string | ColorEnum | nil The outer color of the up candle volume bars. +--- @field downColor string | ColorEnum | nil The outer color of the down candle volume bars. --- @field upFill boolean | nil The inner color of the up candle volume bars. --- @field downFill boolean | nil The inner color of the down candle volume bars. --- @field side Enum | nil The axis side to snap. diff --git a/haas-production-flex-numbers/hs.input-fields.def.lua b/haas-production-flex-numbers/hs.input-fields.def.lua index c907c18..d06a86a 100644 --- a/haas-production-flex-numbers/hs.input-fields.def.lua +++ b/haas-production-flex-numbers/hs.input-fields.def.lua @@ -305,6 +305,13 @@ function InputTable(options, ...) end --- @return any Returns the options objects. function InputTableColumn(name, ...) end +--- Creates an table column options object for InputTable() with a dropdown +--- @param name string Column name. +--- @param options any Dropdown options. For example { "options-A", "options-B" } +--- @vararg any Optional - Default values. +--- @return any Returns the options objects. +function InputTableColumnDropdown(name, options, ...) end + --- The optional parameters of InputTableOptions. --- @shape OptionalParametersOf_InputTableOptions --- @field title string | nil Name of the table. diff --git a/haas-production-flex-numbers/hs.memory-helpers.def.lua b/haas-production-flex-numbers/hs.memory-helpers.def.lua index 66adc05..a5f96b0 100644 --- a/haas-production-flex-numbers/hs.memory-helpers.def.lua +++ b/haas-production-flex-numbers/hs.memory-helpers.def.lua @@ -25,7 +25,7 @@ function Load(key, defaultValue) end --- The optional parameters of Log. --- @shape OptionalParametersOf_Log ---- @field color string | nil The color of the log message. +--- @field color string | ColorEnum | nil The color of the log message. --- Create a message in the log. --- @param message any Message to log. diff --git a/haas-production/hs.charting.def.lua b/haas-production/hs.charting.def.lua index a7665c4..41653df 100644 --- a/haas-production/hs.charting.def.lua +++ b/haas-production/hs.charting.def.lua @@ -8,8 +8,8 @@ function ChangeColorOpacity(color, opacity) end --- The optional parameters of ChartAddAxisLabel. --- @shape OptionalParametersOf_ChartAddAxisLabel ---- @field color string | nil The label fill color. ---- @field textColor string | nil The text color. +--- @field color string | ColorEnum | nil The label fill color. +--- @field textColor string | ColorEnum | nil The text color. --- Adds a label on the y-axis. --- @param chartId number The chart index on which to add the label. @@ -66,7 +66,7 @@ function ChartSetOptions(chartId, title, height, style) end --- The optional parameters of LineOptions. --- @shape OptionalParametersOf_LineOptions ---- @field color string | nil The color of the line. +--- @field color string | ColorEnum | nil The color of the line. --- @field style Enum | nil The style of the line (Spiked, Smooth, Step and others). --- @field deco Enum | nil The line decoration (Solid, Dashed, Dotted). --- @field width number | nil The width of the line. @@ -116,7 +116,7 @@ function MarkCandle(chartId, depth) end --- The optional parameters of Plot. --- @shape OptionalParametersOf_Plot ---- @field colorOrOptions any | nil Line options object or a color string. +--- @field colorOrOptions any | ColorEnum | nil Line options object or a color string. --- Creates a data line on the chart. The line can be styled accordingly. A positive chartId will place the line below the main price chart. A negative index above. --- @param chartId number Index on which to plot the line. @@ -138,7 +138,7 @@ function PlotBands(lineGuid1, lineGuid2, fillColor) end --- The optional parameters of PlotBars. --- @shape OptionalParametersOf_PlotBars --- @field baseValue number | nil The value from where the bars are drawn. Default is 0. ---- @field fillColor string | nil The inner color of the bars. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the bars. Default is none. --- Changes a line to bars. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -174,7 +174,7 @@ function PlotBuySellZone(chartId, start, endValue) end --- The optional parameters of PlotCircle. --- @shape OptionalParametersOf_PlotCircle ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into circles. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -193,7 +193,7 @@ function PlotCloud(lineGuid1, lineGuid2, opacity) end --- The optional parameters of PlotDoubleColor. --- @shape OptionalParametersOf_PlotDoubleColor ---- @field fillColor string | nil The inner color between the line and the base value. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color between the line and the base value. Default is none. --- Changes the color of the line based on a base value. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -291,11 +291,11 @@ function PlotPivot(leftStrength, rightStrength) end --- @shape OptionalParametersOf_PlotPrice --- @field interval number | nil The interval which to plot. --- @field style Enum | nil The price plot style. ---- @field upColor string | nil The outer color of the up candle. +--- @field upColor string | ColorEnum | nil The outer color of the up candle. --- @field upFill boolean | nil The inner color of the up candle. ---- @field downColor string | nil The outer color of the down candle. +--- @field downColor string | ColorEnum | nil The outer color of the down candle. --- @field downFill boolean | nil The inner color of the down candle. ---- @field markColor string | nil The outer color of the marked candle. +--- @field markColor string | ColorEnum | nil The outer color of the marked candle. --- @field markFill boolean | nil The inner color of the marked candle. --- Creates a price plot. Candlestick by default. @@ -325,11 +325,11 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor, --- @shape OptionalParametersOf_PlotShape --- @field chartId number | nil Index on which to plot the line. --- @field shape Enum | nil The shape type. ---- @field color string | nil The color of the shape. +--- @field color string | ColorEnum | nil The color of the shape. --- @field size number | nil Size of the shape. --- @field aboveCandle boolean | nil If true, the shape will be drawn above the candle else below. --- @field text string | nil Text above or below the candle or shape. ---- @field textColor string | nil The color of the text. +--- @field textColor string | ColorEnum | nil The color of the text. --- @field offset number | nil A positive offset will move the data points x number of candles. A negative number will move the data points back. --- Draws a shape above the candle or first line on the chart. @@ -355,7 +355,7 @@ function PlotShape(chartId, shape, color, size, aboveCandle, text, textColor, of --- The optional parameters of PlotShapes. --- @shape OptionalParametersOf_PlotShapes ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into a specific shape. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -409,8 +409,8 @@ function PlotVerticalZone(chartId, name, color, start, endValue) end --- The optional parameters of PlotVolume. --- @shape OptionalParametersOf_PlotVolume ---- @field upColor string | nil The outer color of the up candle volume bars. ---- @field downColor string | nil The outer color of the down candle volume bars. +--- @field upColor string | ColorEnum | nil The outer color of the up candle volume bars. +--- @field downColor string | ColorEnum | nil The outer color of the down candle volume bars. --- @field upFill boolean | nil The inner color of the up candle volume bars. --- @field downFill boolean | nil The inner color of the down candle volume bars. --- @field side Enum | nil The axis side to snap. diff --git a/haas-production/hs.input-fields.def.lua b/haas-production/hs.input-fields.def.lua index 9d388f7..a94a23c 100644 --- a/haas-production/hs.input-fields.def.lua +++ b/haas-production/hs.input-fields.def.lua @@ -305,6 +305,13 @@ function InputTable(options, ...) end --- @return any Returns the options objects. function InputTableColumn(name, ...) end +--- Creates an table column options object for InputTable() with a dropdown +--- @param name string Column name. +--- @param options any Dropdown options. For example { "options-A", "options-B" } +--- @vararg any Optional - Default values. +--- @return any Returns the options objects. +function InputTableColumnDropdown(name, options, ...) end + --- The optional parameters of InputTableOptions. --- @shape OptionalParametersOf_InputTableOptions --- @field title string | nil Name of the table. diff --git a/haas-production/hs.memory-helpers.def.lua b/haas-production/hs.memory-helpers.def.lua index 66adc05..a5f96b0 100644 --- a/haas-production/hs.memory-helpers.def.lua +++ b/haas-production/hs.memory-helpers.def.lua @@ -25,7 +25,7 @@ function Load(key, defaultValue) end --- The optional parameters of Log. --- @shape OptionalParametersOf_Log ---- @field color string | nil The color of the log message. +--- @field color string | ColorEnum | nil The color of the log message. --- Create a message in the log. --- @param message any Message to log. diff --git a/haas-staging-flex-numbers/hs.charting.def.lua b/haas-staging-flex-numbers/hs.charting.def.lua index 1572d2c..fb26556 100644 --- a/haas-staging-flex-numbers/hs.charting.def.lua +++ b/haas-staging-flex-numbers/hs.charting.def.lua @@ -8,8 +8,8 @@ function ChangeColorOpacity(color, opacity) end --- The optional parameters of ChartAddAxisLabel. --- @shape OptionalParametersOf_ChartAddAxisLabel ---- @field color string | nil The label fill color. ---- @field textColor string | nil The text color. +--- @field color string | ColorEnum | nil The label fill color. +--- @field textColor string | ColorEnum | nil The text color. --- Adds a label on the y-axis. --- @param chartId number | number[] The chart index on which to add the label. @@ -66,7 +66,7 @@ function ChartSetOptions(chartId, title, height, style) end --- The optional parameters of LineOptions. --- @shape OptionalParametersOf_LineOptions ---- @field color string | nil The color of the line. +--- @field color string | ColorEnum | nil The color of the line. --- @field style Enum | nil The style of the line (Spiked, Smooth, Step and others). --- @field deco Enum | nil The line decoration (Solid, Dashed, Dotted). --- @field width number | number[] | nil The width of the line. @@ -116,7 +116,7 @@ function MarkCandle(chartId, depth) end --- The optional parameters of Plot. --- @shape OptionalParametersOf_Plot ---- @field colorOrOptions any | nil Line options object or a color string. +--- @field colorOrOptions any | ColorEnum | nil Line options object or a color string. --- Creates a data line on the chart. The line can be styled accordingly. A positive chartId will place the line below the main price chart. A negative index above. --- @param chartId number | number[] Index on which to plot the line. @@ -138,7 +138,7 @@ function PlotBands(lineGuid1, lineGuid2, fillColor) end --- The optional parameters of PlotBars. --- @shape OptionalParametersOf_PlotBars --- @field baseValue number | number[] | nil The value from where the bars are drawn. Default is 0. ---- @field fillColor string | nil The inner color of the bars. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the bars. Default is none. --- Changes a line to bars. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -174,7 +174,7 @@ function PlotBuySellZone(chartId, start, endValue) end --- The optional parameters of PlotCircle. --- @shape OptionalParametersOf_PlotCircle ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into circles. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -193,7 +193,7 @@ function PlotCloud(lineGuid1, lineGuid2, opacity) end --- The optional parameters of PlotDoubleColor. --- @shape OptionalParametersOf_PlotDoubleColor ---- @field fillColor string | nil The inner color between the line and the base value. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color between the line and the base value. Default is none. --- Changes the color of the line based on a base value. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -291,11 +291,11 @@ function PlotPivot(leftStrength, rightStrength) end --- @shape OptionalParametersOf_PlotPrice --- @field interval number | number[] | nil The interval which to plot. --- @field style Enum | nil The price plot style. ---- @field upColor string | nil The outer color of the up candle. +--- @field upColor string | ColorEnum | nil The outer color of the up candle. --- @field upFill boolean | nil The inner color of the up candle. ---- @field downColor string | nil The outer color of the down candle. +--- @field downColor string | ColorEnum | nil The outer color of the down candle. --- @field downFill boolean | nil The inner color of the down candle. ---- @field markColor string | nil The outer color of the marked candle. +--- @field markColor string | ColorEnum | nil The outer color of the marked candle. --- @field markFill boolean | nil The inner color of the marked candle. --- Creates a price plot. Candlestick by default. @@ -325,11 +325,11 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor, --- @shape OptionalParametersOf_PlotShape --- @field chartId number | number[] | nil Index on which to plot the line. --- @field shape Enum | nil The shape type. ---- @field color string | nil The color of the shape. +--- @field color string | ColorEnum | nil The color of the shape. --- @field size number | number[] | nil Size of the shape. --- @field aboveCandle boolean | nil If true, the shape will be drawn above the candle else below. --- @field text string | nil Text above or below the candle or shape. ---- @field textColor string | nil The color of the text. +--- @field textColor string | ColorEnum | nil The color of the text. --- @field offset number | number[] | nil A positive offset will move the data points x number of candles. A negative number will move the data points back. --- Draws a shape above the candle or first line on the chart. @@ -355,7 +355,7 @@ function PlotShape(chartId, shape, color, size, aboveCandle, text, textColor, of --- The optional parameters of PlotShapes. --- @shape OptionalParametersOf_PlotShapes ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into a specific shape. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -409,8 +409,8 @@ function PlotVerticalZone(chartId, name, color, start, endValue) end --- The optional parameters of PlotVolume. --- @shape OptionalParametersOf_PlotVolume ---- @field upColor string | nil The outer color of the up candle volume bars. ---- @field downColor string | nil The outer color of the down candle volume bars. +--- @field upColor string | ColorEnum | nil The outer color of the up candle volume bars. +--- @field downColor string | ColorEnum | nil The outer color of the down candle volume bars. --- @field upFill boolean | nil The inner color of the up candle volume bars. --- @field downFill boolean | nil The inner color of the down candle volume bars. --- @field side Enum | nil The axis side to snap. diff --git a/haas-staging-flex-numbers/hs.memory-helpers.def.lua b/haas-staging-flex-numbers/hs.memory-helpers.def.lua index 66adc05..a5f96b0 100644 --- a/haas-staging-flex-numbers/hs.memory-helpers.def.lua +++ b/haas-staging-flex-numbers/hs.memory-helpers.def.lua @@ -25,7 +25,7 @@ function Load(key, defaultValue) end --- The optional parameters of Log. --- @shape OptionalParametersOf_Log ---- @field color string | nil The color of the log message. +--- @field color string | ColorEnum | nil The color of the log message. --- Create a message in the log. --- @param message any Message to log. diff --git a/haas-staging/hs.charting.def.lua b/haas-staging/hs.charting.def.lua index a7665c4..41653df 100644 --- a/haas-staging/hs.charting.def.lua +++ b/haas-staging/hs.charting.def.lua @@ -8,8 +8,8 @@ function ChangeColorOpacity(color, opacity) end --- The optional parameters of ChartAddAxisLabel. --- @shape OptionalParametersOf_ChartAddAxisLabel ---- @field color string | nil The label fill color. ---- @field textColor string | nil The text color. +--- @field color string | ColorEnum | nil The label fill color. +--- @field textColor string | ColorEnum | nil The text color. --- Adds a label on the y-axis. --- @param chartId number The chart index on which to add the label. @@ -66,7 +66,7 @@ function ChartSetOptions(chartId, title, height, style) end --- The optional parameters of LineOptions. --- @shape OptionalParametersOf_LineOptions ---- @field color string | nil The color of the line. +--- @field color string | ColorEnum | nil The color of the line. --- @field style Enum | nil The style of the line (Spiked, Smooth, Step and others). --- @field deco Enum | nil The line decoration (Solid, Dashed, Dotted). --- @field width number | nil The width of the line. @@ -116,7 +116,7 @@ function MarkCandle(chartId, depth) end --- The optional parameters of Plot. --- @shape OptionalParametersOf_Plot ---- @field colorOrOptions any | nil Line options object or a color string. +--- @field colorOrOptions any | ColorEnum | nil Line options object or a color string. --- Creates a data line on the chart. The line can be styled accordingly. A positive chartId will place the line below the main price chart. A negative index above. --- @param chartId number Index on which to plot the line. @@ -138,7 +138,7 @@ function PlotBands(lineGuid1, lineGuid2, fillColor) end --- The optional parameters of PlotBars. --- @shape OptionalParametersOf_PlotBars --- @field baseValue number | nil The value from where the bars are drawn. Default is 0. ---- @field fillColor string | nil The inner color of the bars. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the bars. Default is none. --- Changes a line to bars. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -174,7 +174,7 @@ function PlotBuySellZone(chartId, start, endValue) end --- The optional parameters of PlotCircle. --- @shape OptionalParametersOf_PlotCircle ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into circles. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -193,7 +193,7 @@ function PlotCloud(lineGuid1, lineGuid2, opacity) end --- The optional parameters of PlotDoubleColor. --- @shape OptionalParametersOf_PlotDoubleColor ---- @field fillColor string | nil The inner color between the line and the base value. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color between the line and the base value. Default is none. --- Changes the color of the line based on a base value. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -291,11 +291,11 @@ function PlotPivot(leftStrength, rightStrength) end --- @shape OptionalParametersOf_PlotPrice --- @field interval number | nil The interval which to plot. --- @field style Enum | nil The price plot style. ---- @field upColor string | nil The outer color of the up candle. +--- @field upColor string | ColorEnum | nil The outer color of the up candle. --- @field upFill boolean | nil The inner color of the up candle. ---- @field downColor string | nil The outer color of the down candle. +--- @field downColor string | ColorEnum | nil The outer color of the down candle. --- @field downFill boolean | nil The inner color of the down candle. ---- @field markColor string | nil The outer color of the marked candle. +--- @field markColor string | ColorEnum | nil The outer color of the marked candle. --- @field markFill boolean | nil The inner color of the marked candle. --- Creates a price plot. Candlestick by default. @@ -325,11 +325,11 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor, --- @shape OptionalParametersOf_PlotShape --- @field chartId number | nil Index on which to plot the line. --- @field shape Enum | nil The shape type. ---- @field color string | nil The color of the shape. +--- @field color string | ColorEnum | nil The color of the shape. --- @field size number | nil Size of the shape. --- @field aboveCandle boolean | nil If true, the shape will be drawn above the candle else below. --- @field text string | nil Text above or below the candle or shape. ---- @field textColor string | nil The color of the text. +--- @field textColor string | ColorEnum | nil The color of the text. --- @field offset number | nil A positive offset will move the data points x number of candles. A negative number will move the data points back. --- Draws a shape above the candle or first line on the chart. @@ -355,7 +355,7 @@ function PlotShape(chartId, shape, color, size, aboveCandle, text, textColor, of --- The optional parameters of PlotShapes. --- @shape OptionalParametersOf_PlotShapes ---- @field fillColor string | nil The inner color of the circles. Default is none. +--- @field fillColor string | ColorEnum | nil The inner color of the circles. Default is none. --- Changes the line into a specific shape. --- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot @@ -409,8 +409,8 @@ function PlotVerticalZone(chartId, name, color, start, endValue) end --- The optional parameters of PlotVolume. --- @shape OptionalParametersOf_PlotVolume ---- @field upColor string | nil The outer color of the up candle volume bars. ---- @field downColor string | nil The outer color of the down candle volume bars. +--- @field upColor string | ColorEnum | nil The outer color of the up candle volume bars. +--- @field downColor string | ColorEnum | nil The outer color of the down candle volume bars. --- @field upFill boolean | nil The inner color of the up candle volume bars. --- @field downFill boolean | nil The inner color of the down candle volume bars. --- @field side Enum | nil The axis side to snap. diff --git a/haas-staging/hs.memory-helpers.def.lua b/haas-staging/hs.memory-helpers.def.lua index 66adc05..a5f96b0 100644 --- a/haas-staging/hs.memory-helpers.def.lua +++ b/haas-staging/hs.memory-helpers.def.lua @@ -25,7 +25,7 @@ function Load(key, defaultValue) end --- The optional parameters of Log. --- @shape OptionalParametersOf_Log ---- @field color string | nil The color of the log message. +--- @field color string | ColorEnum | nil The color of the log message. --- Create a message in the log. --- @param message any Message to log. diff --git a/src/command/sample/command-production.sample.ts b/src/command/sample/command-production.sample.ts index d07c743..f237131 100644 --- a/src/command/sample/command-production.sample.ts +++ b/src/command/sample/command-production.sample.ts @@ -27454,6 +27454,64 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "InputTableColumnDropdown", + "Parameters": [ + { + "Index": 0, + "Name": "name", + "Type": 0, + "IsRequired": true, + "IsHidden": false, + "IsField": true, + "AllowNull": false, + "Description": "Column name.", + "ScriptType": null, + "Suggestion": [] + }, + { + "Index": 0, + "Name": "options", + "Type": 4, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Dropdown options. For example { \"options-A\", \"options-B\" }", + "ScriptType": null, + "Suggestion": [] + }, + { + "Index": 0, + "Name": "values[]", + "Type": 100, + "IsRequired": false, + "IsHidden": false, + "IsField": true, + "AllowNull": false, + "Description": "Default values.", + "ScriptType": null, + "Suggestion": [] + } + ], + "Command": 3419, + "CommandType": 1, + "Category": 18, + "Description": "Creates an table column options object for InputTable() with a dropdown", + "ReturnDescription": "Returns the options objects.", + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 4, + "OutputSuggestions": [ + 4406, + 4403 + ], + "ChangeTypes": [] + }, { "CommandName": "InputTableOptions", "Parameters": [ diff --git a/src/parsing/optional-parameter-parsing.service.ts b/src/parsing/optional-parameter-parsing.service.ts index f2aa59c..c15f26b 100644 --- a/src/parsing/optional-parameter-parsing.service.ts +++ b/src/parsing/optional-parameter-parsing.service.ts @@ -1,6 +1,7 @@ -import { CommandModel } from '../command/command.model'; -import { ParameterModel } from '../parameter/parameter.model'; -import { commentPrefix } from './comment-prefix'; +import { CommandModel } from '../command/command.model'; +import { HaasCommandType } from '../haas/haas-command-type'; +import { ParameterModel } from '../parameter/parameter.model'; +import { commentPrefix } from './comment-prefix'; export class OptionalParameterParsingService { @@ -21,7 +22,9 @@ export class OptionalParameterParsingService { protected getOptionalField(parameterItem: ParameterModel): string { - const typeName: string = parameterItem.typeName; + let typeName: string = parameterItem.typeName; + + if (parameterItem.groupIdList.includes(HaasCommandType.ColorAqua)) typeName += ' | ColorEnum'; return `${commentPrefix}@field ${parameterItem.name} ${typeName} | nil ${parameterItem.description}\n`; }