[{"name":"ReportBuilder","comment":" A report builder is a data structure that allows you to build a report\nwith a list of records and a list of fields. You can add fields to the\nreport and then generate a CSV representation of the report.\n\n\n# Definition\n\n@docs ReportBuilder\n\n\n# Constructor\n\n@docs new\n\n\n# Modification\n\n@docs addField, withName\n\n\n# Output\n\n@docs toCsv\n\n\n# Commands\n\n@docs downloadCsv\n\n","unions":[{"name":"ReportBuilder","comment":" A report builder is a data structure that allows you to build a report\nwith a list of records and a list of fields. You can add fields to the\nreport and then generate a CSV representation of the report.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"addField","comment":" Add a field to the report builder.\n","type":"ReportBuilder.Field.Field a -> ReportBuilder.ReportBuilder a -> ReportBuilder.ReportBuilder a"},{"name":"downloadCsv","comment":" Generate a command to download the CSV representation of the report\nbuilder.\n","type":"ReportBuilder.ReportBuilder a -> Platform.Cmd.Cmd msg"},{"name":"new","comment":" Create a new report builder with a list of records.\n","type":"{ records : List.List a } -> ReportBuilder.ReportBuilder a"},{"name":"toCsv","comment":" Convert a report builder to a CSV string.\n","type":"ReportBuilder.ReportBuilder a -> String.String"},{"name":"withName","comment":" Set the name of the report builder.\n\nThis is used for generating the filename when downloading the CSV.\n\n","type":"String.String -> ReportBuilder.ReportBuilder a -> ReportBuilder.ReportBuilder a"}],"binops":[]},{"name":"ReportBuilder.Field","comment":" `ReportBuilder.Field` provides a way to define fields that can be used to\ngenerate reports.\n\n\n# Definitions\n\n@docs Field, FieldAccess\n\n\n# Constructor\n\n@docs new\n\n\n# Field Types\n\n@docs bool, int, string\n\n\n# Field Modifiers\n\n@docs optional\n\n\n# Computed FieldAccess\n\n@docs lengthOf\n\n\n# Generate values\n\n@docs encode, header\n\n\n# Annotate numeric values\n\n@docs isNumeric, numeric\n\n","unions":[{"name":"Field","comment":" A field describes a column in a report. It has a name, an accessor function\nand a type.\n","args":["a"],"cases":[]},{"name":"FieldAccess","comment":" A field accessor is a function that takes a record and returns a string.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"bool","comment":" Define field access for a boolean.\n","type":"{ true : String.String, false : String.String } -> (a -> Basics.Bool) -> ReportBuilder.Field.FieldAccess a"},{"name":"encode","comment":" Given a field and a corresponding record, return the value of the field.\n","type":"a -> ReportBuilder.Field.Field a -> String.String"},{"name":"header","comment":" Get the header value of a field.\n","type":"ReportBuilder.Field.Field a -> String.String"},{"name":"int","comment":" Define field access for an integer.\n","type":"(a -> Basics.Int) -> ReportBuilder.Field.FieldAccess a"},{"name":"isNumeric","comment":" Check if a field is numeric.\n","type":"ReportBuilder.Field.Field a -> Basics.Bool"},{"name":"lengthOf","comment":" Define field access for the length of a list.\n","type":"(a -> List.List b) -> ReportBuilder.Field.FieldAccess a"},{"name":"new","comment":" Create a new field with a name and an accessor function.\n","type":"String.String -> ReportBuilder.Field.FieldAccess a -> ReportBuilder.Field.Field a"},{"name":"numeric","comment":" Mark a field as numeric.\n","type":"ReportBuilder.Field.Field a -> ReportBuilder.Field.Field a"},{"name":"optional","comment":" Mark a field as optional.\n","type":"((a -> b) -> ReportBuilder.Field.FieldAccess a) -> (a -> Maybe.Maybe b) -> ReportBuilder.Field.FieldAccess a"},{"name":"string","comment":" Define field access for a string.\n","type":"(a -> String.String) -> ReportBuilder.Field.FieldAccess a"}],"binops":[]}]