Versions in this module Expand all Collapse all v1 v1.2.0 Feb 15, 2024 Changes in this version + func EmbedStructs(e *extractor) + func FollowStructs(e *extractor) + func GenerateEnumAsSumType(opt *generateOptions) + func Render(types []TypescriptType, cfg ...GenerateOption) error + func SortAlphabetically(e *extractor) + type AnonStructNamer func(reflect.StructField) string + type DocHandler interface + Method func(parent reflect.Type, method reflect.Method) string + Type func(t reflect.Type) string + type EnumHandler interface + GetMember func(t reflect.Type) ([]TypescriptEnumMember, error) + IsEnum func(t reflect.Type) bool + type ExtractOption func(*extractor) + func CustomNamer(namer TypeNamer) ExtractOption + func NameAnonStructs(namer AnonStructNamer) ExtractOption + func PrimitiveNamer(namer TypeNamer) ExtractOption + func WithDocumentation(handler DocHandler) ExtractOption + func WithEnumerations(handler EnumHandler) ExtractOption + type GenerateOption func(*generateOptions) + func GenerateAdditionalPreamble(preamble string) GenerateOption + func GenerateNamespace(ns string) GenerateOption + func GenerateOutputTo(out io.Writer) GenerateOption + func GeneratePreamble(preamble string) GenerateOption + type ParsedSourceDocHandler struct + func NewParsedSourceDocHandler(srcdir, base string) (*ParsedSourceDocHandler, error) + func (h *ParsedSourceDocHandler) AddToIndex(src, pkg string) error + func (h *ParsedSourceDocHandler) Method(parent reflect.Type, method reflect.Method) string + func (h *ParsedSourceDocHandler) Type(t reflect.Type) string + type ParsedSourceEnumHandler struct + func NewParsedSourceEnumHandler(srcdir string) (*ParsedSourceEnumHandler, error) + func (h *ParsedSourceEnumHandler) GetMember(t reflect.Type) ([]TypescriptEnumMember, error) + func (h *ParsedSourceEnumHandler) IsEnum(t reflect.Type) bool + type TypeNamer func(reflect.Type) string + type TypedElement struct + Name string + Type TypescriptType + type TypescriptEnumMember struct + Comment string + Name string + Value string + type TypescriptKind string + const TypescriptArrayKind + const TypescriptEnumKind + const TypescriptInterfaceKind + const TypescriptMapKind + const TypescriptSimpleKind + type TypescriptMember struct + Args []TypedElement + Comment string + IsFunction bool + IsOptional bool + type TypescriptType struct + Comment string + EnumMembers []TypescriptEnumMember + Kind TypescriptKind + Members []TypescriptMember + Name string + Params []TypescriptType + func Extract(s interface{}, opts ...ExtractOption) ([]TypescriptType, error)