Currently, you need to explicitly add tags like ts_type:"Date" and ts_transform:"new Date(__VALUE__)" in order for the conversion to use the correct Typescript type Date for time.Time Go type. But in regard to third-party structs the developer cannot do this tag addition.
Thus, the library should handle this particular use case automatically.
Also, providing an interface that enables developers to handle these edge cases with third-party structs would be useful, like an .Add() method with additional optional arguments to control ts_type and ts_transform.
Currently, you need to explicitly add tags like
ts_type:"Date"
andts_transform:"new Date(__VALUE__)"
in order for the conversion to use the correct Typescript typeDate
fortime.Time
Go type. But in regard to third-party structs the developer cannot do this tag addition.Thus, the library should handle this particular use case automatically.
Also, providing an interface that enables developers to handle these edge cases with third-party structs would be useful, like an
.Add()
method with additional optional arguments to controlts_type
andts_transform
.