Documentation ¶
Index ¶
- Constants
- type Assignment
- type DTS
- func (d *DTS) EndArg(text string)
- func (d *DTS) EndBlock(msg string)
- func (d *DTS) EndFunction(text string)
- func (d *DTS) EndVariable(text string)
- func (d *DTS) Extends(text string)
- func (d *DTS) FSetIdentifier(text string)
- func (d *DTS) FSetType(text string)
- func (d *DTS) Implements(text string)
- func (d *DTS) Init(fpath string)
- func (d *DTS) Json() (string, error)
- func (d *DTS) NewArg(text string)
- func (d *DTS) NewBlock(modifiers string, kind Kind)
- func (d *DTS) NewFunction(text string)
- func (d *DTS) NewVariable(text string)
- func (d *DTS) SetBlockID(name string)
- func (d *DTS) Show(text string)
- func (d *DTS) VSetIdentifier(text string)
- func (d *DTS) VSetType(text string)
- type Function
- type Identifier
- type Kind
- type Object
- type Variable
Constants ¶
View Source
const ( TopLevel Kind = "TopLevel" Module = "Module" Class = "Class" Interface = "Interface" Enum = "Enum" Obj = "Object" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct { Identifier Value string // just a string }
is this usefull?
type DTS ¶
type DTS struct { // TopLevel object Object // contains filtered or unexported fields }
func (*DTS) EndFunction ¶
func (*DTS) EndVariable ¶
func (*DTS) FSetIdentifier ¶
func (*DTS) Implements ¶
func (*DTS) NewFunction ¶
func (*DTS) NewVariable ¶
func (*DTS) SetBlockID ¶
func (*DTS) VSetIdentifier ¶
type Function ¶
type Function struct { Identifier Args []*Variable ReturnType []string }
type Identifier ¶
type Object ¶
type Object struct { Identifier // module/class/interface/enum/js object/ or top level Kind Kind // for class/interface/object Extents []string `json:",omitempty"` // ids Implements []string `json:",omitempty"` // ids // var difinitions Vars map[string]*Variable `json:",omitempty"` Assignments map[string]*Assignment `json:",omitempty"` // using slice here, incase of function override Funcs []*Function `json:",omitempty"` // helpers // constructor for class Constructor *Function `json:",omitempty"` Classes map[string]*Object `json:",omitempty"` Interfaces map[string]*Object `json:",omitempty"` Modules map[string]*Object `json:",omitempty"` Enums map[string]*Object `json:",omitempty"` Objects map[string]*Object `json:",omitempty"` // contains filtered or unexported fields }
type Variable ¶
type Variable struct { Identifier // use for func type IsOptional bool // only convert the KNOWN type to go Type []string // multipy types, return type }
KNOWN type: string -> string
number -> float64 object -> js.M funcion -> func class -> struct module -> struct interface -> struct toplevel -> convert the same name package toplevel object has the base name of the .d.ts file
// var/func overrides -> comment // other types just output as comment
Click to show internal directories.
Click to hide internal directories.