Documentation
¶
Overview ¶
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Package types contains structs/interfaces representing TypeScript types
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Any ¶
type Any struct {
Common
}
Any - any in TypeScript
func (*Any) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Array ¶
Array - array in TypeScript
func (*Array) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Boolean ¶
type Boolean struct {
Common
}
Boolean - boolean in TypeScript
func (*Boolean) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Common ¶
type Common struct {
// PkgName is the package name declared at the beginning of .go files.
// Currently, only exported types in the root package is available.
PkgName string
Position *token.Position
}
Common defines common fields in the all types
func (*Common) GetPackageName ¶
GetPackageName returns PkgName in Common
func (*Common) GetPosition ¶
GetPosition returns Position in Common
func (*Common) SetPackageName ¶
SetPackageName sets PkgName in Common
func (*Common) SetPosition ¶
SetPosition sets Position in Common
type Date ¶
type Date struct {
Common
}
Date - RFC3399 string in TypeScript
func (*Date) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Enumerable ¶
type Enumerable interface {
Type
// AddCandidates adds a candidate for enum
AddCandidates(key string, v interface{})
}
Enumerable interface represents union types
type Map ¶
Map - {[key: ...]: ...} in TypeScript
func (*Map) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Nullable ¶
Nullable - ... | null
func (*Nullable) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Number ¶
type Number struct {
Common
Name string
RawType types.BasicKind
Enum []int64
RawEnum []RawNumberEnumCandidate
}
Number - number in TypeScript
func (*Number) AddCandidates ¶
AddCandidates adds an candidate for enum
func (*Number) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type Object ¶
type Object struct {
Common
Name string
Entries map[string]ObjectEntry
}
Object - {field1: ..., field2: ...} in TypeScript
func (*Object) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map
type ObjectEntry ¶
type ObjectEntry struct {
RawName string
RawTag string
FieldIndex int
Type Type
Position *token.Position
Optional bool
}
ObjectEntry is a field in objects
type RawNumberEnumCandidate ¶
type RawNumberEnumCandidate struct {
Key string
Value interface{}
}
RawNumberEnumCandidate represents a raw candidate for number enum
type RawStringEnumCandidate ¶
RawStringEnumCandidate represents a raw candidate for string enum
type String ¶
type String struct {
Common
Name string
Enum []string
RawEnum []RawStringEnumCandidate
}
String - string in TypeScript
func (*String) AddCandidates ¶
AddCandidates adds an candidate for enum
func (*String) UsedAsMapKey ¶
UsedAsMapKey returns whether this type can be used as the key for map