Documentation
¶
Overview ¶
Package config provides standard configurations for the guts package. These configurations are useful for common use cases.
Index ¶
- func BiomeLintIgnoreAnyTypeParameters(ts *guts.Typescript)
- func EnumLists(ts *guts.Typescript)
- func ExportTypes(ts *guts.Typescript)
- func OverrideLiteral(keyword bindings.LiteralKeyword) guts.TypeOverride
- func OverrideNullable(t guts.TypeOverride) guts.TypeOverride
- func ReadOnly(ts *guts.Typescript)
- func SimplifyOmitEmpty(ts *guts.Typescript)
- func StandardMappings() map[string]guts.TypeOverride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BiomeLintIgnoreAnyTypeParameters ¶
func BiomeLintIgnoreAnyTypeParameters(ts *guts.Typescript)
BiomeLintIgnoreAnyTypeParameters adds a biome-ignore comment to any type parameters that are of type "any". It is questionable if we should even add 'extends any' at all to the typescript.
func EnumLists ¶
func EnumLists(ts *guts.Typescript)
EnumLists adds a constant that lists all the values in a given enum. Example: type MyEnum = string const ( EnumFoo = "foo" EnumBar = "bar" ) const MyEnums: string = ["foo", "bar"] <-- this is added
func ExportTypes ¶
func ExportTypes(ts *guts.Typescript)
ExportTypes adds 'export' to all top level types. interface Foo {} --> export interface Foo{}
func OverrideLiteral ¶
func OverrideLiteral(keyword bindings.LiteralKeyword) guts.TypeOverride
func OverrideNullable ¶
func OverrideNullable(t guts.TypeOverride) guts.TypeOverride
func ReadOnly ¶
func ReadOnly(ts *guts.Typescript)
ReadOnly sets all interface fields to 'readonly', resulting in all types being immutable. TODO: follow the AST all the way and find nested arrays
func SimplifyOmitEmpty ¶
func SimplifyOmitEmpty(ts *guts.Typescript)
SimplifyOmitEmpty removes the null type from union types that have a question token. This is because if 'omitempty' is set, then golang will omit the object key, rather than sending a null value to the client. Example: number?: number | null --> number?: number
func StandardMappings ¶
func StandardMappings() map[string]guts.TypeOverride
StandardMappings is a list of standard mappings for Go types to Typescript types.
Types ¶
This section is empty.