This commit is contained in:
Egor Aristov 2025-12-06 13:13:12 +03:00
parent 6e7565284e
commit 57e4b16afc
Signed by: egor3f
GPG Key ID: 40482A264AAEC85F
2 changed files with 9 additions and 25 deletions

View File

@ -124,10 +124,10 @@ func (p *TypescriptApiParser) fieldToVal(typ *ast.TypeNode) (types.ValType, erro
case "Buffer":
return types.TBlob, nil
default:
return 0, fmt.Errorf("reference type %s is not supported yet", ident.Text)
return types.TNoType, fmt.Errorf("reference type %s is not supported yet", ident.Text)
}
default:
return 0, fmt.Errorf("type %s is not supported yet", typ.Kind)
return types.TNoType, fmt.Errorf("type %s is not supported yet", typ.Kind)
}
}

View File

@ -1,28 +1,12 @@
package types
type ValType int
type ValType string
const (
TInt ValType = 1
TString ValType = 2
TBool ValType = 3
TBlob ValType = 4
TArray ValType = 5
TNoType ValType = "" // zero value constant for ValType (please don't use just "" as zero value!)
TInt ValType = "int"
TString ValType = "string"
TBool ValType = "bool"
TBlob ValType = "blob"
TArray ValType = "array"
)
func (v ValType) String() string {
switch v {
case TInt:
return "int"
case TString:
return "string"
case TBool:
return "bool"
case TBlob:
return "blob"
case TArray:
return "array"
default:
panic("unreachable code")
}
}