I’m a little bit skeptic about using the @as
attribute for renaming the underline types.
Because currently it exists to adjust the runtime representation of ReScript data and simply putting the @as
to a wrong place will result in a completely different result:
type options = {
startFrom: float,
@as("persistOptions") persist?: { // makes the type `type persistOptions` instead of `type \"options.persist\"
fileName: string,
path?: string,
fileConfig?: {
extension?: string
}
}
}
I’d like to keep @as
only for changing the runtime representation.