MCPcopy Create free account
hub / github.com/coder/guts / ToTypescriptDeclarationNode

Method ToTypescriptDeclarationNode

bindings/bindings.go:76–96  ·  view source on GitHub ↗
(ety DeclarationType)

Source from the content-addressed store, hash-verified

74}
75
76func (b *Bindings) ToTypescriptDeclarationNode(ety DeclarationType) (*goja.Object, error) {
77 var siObj *goja.Object
78 var err error
79
80 switch ety := ety.(type) {
81 case *Interface:
82 siObj, err = b.Interface(ety)
83 case *Alias:
84 siObj, err = b.Alias(ety)
85 case *VariableStatement:
86 siObj, err = b.VariableStatement(ety)
87 case *Enum:
88 siObj, err = b.EnumDeclaration(ety)
89 case *ImportDeclaration:
90 siObj, err = b.ImportDeclaration(ety)
91 default:
92 return nil, xerrors.Errorf("unsupported type for declaration type: %T", ety)
93 }
94
95 return siObj, err
96}
97
98func (b *Bindings) ToTypescriptExpressionNode(ety ExpressionType) (*goja.Object, error) {
99 var siObj *goja.Object

Callers 1

ToTypescriptNodeMethod · 0.95

Calls 5

InterfaceMethod · 0.95
AliasMethod · 0.95
VariableStatementMethod · 0.95
EnumDeclarationMethod · 0.95
ImportDeclarationMethod · 0.95

Tested by

no test coverage detected