tsgencore

package
v0.0.88 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullableMarkerReflectType = reflect.TypeOf((*TSNullableMarker)(nil)).Elem()
View Source
var OptionalMarkerReflectType = reflect.TypeOf((*TSOptionalMarker)(nil)).Elem()

Functions

func IsMarkedNullable

func IsMarkedNullable(t reflect.Type) bool

func IsMarkedOptional

func IsMarkedOptional(t reflect.Type) bool

Types

type AdHocType

type AdHocType = struct {
	// Instance of the struct to generate TypeScript for
	TypeInstance any
	// Name is required only if type is anonymous, otherwise optional override
	TSTypeName string
}

type IDStr

type IDStr = string

type Results

type Results struct {
	Types []*TypeInfo
	// contains filtered or unexported fields
}

func ProcessTypes

func ProcessTypes(adHocTypes []*AdHocType) Results

func (*Results) GetTypeInfo

func (m *Results) GetTypeInfo(adHocType *AdHocType) *TypeInfo

type TSNullableMarker

type TSNullableMarker interface{ TSNullable() }

type TSOptionalMarker

type TSOptionalMarker interface{ TSOptional() }

type TypeInfo

type TypeInfo struct {
	OriginalName string
	ResolvedName string
	ReflectType  reflect.Type
	TSStr        string
	// contains filtered or unexported fields
}

func (*TypeInfo) IsTSBasicType

func (t *TypeInfo) IsTSBasicType() bool

func (*TypeInfo) IsTSUndefined

func (t *TypeInfo) IsTSUndefined() bool

func (*TypeInfo) IsTSUnknown

func (t *TypeInfo) IsTSUnknown() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL