Skip to content

Commit

Permalink
Include ColorEnum type in color fields in optional parameter definiti…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
FiretronP75 committed Feb 14, 2024
1 parent b5f04af commit 9ebb9d4
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 68 deletions.
30 changes: 15 additions & 15 deletions haas-production-flex-numbers/hs.charting.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions haas-production-flex-numbers/hs.input-fields.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion haas-production-flex-numbers/hs.memory-helpers.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 15 additions & 15 deletions haas-production/hs.charting.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions haas-production/hs.input-fields.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion haas-production/hs.memory-helpers.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 9ebb9d4

Please sign in to comment.