With Rivet composability, you are able to reuse fundamental pieces of your contracts, such as data types, to make them much more maintainable. We do this by leveraging CommonJS modules and compiling your contracts to JSON.
Composing with shared types
JSON Schema has a limited number of data types that it supports. For example, string, number, boolean. However, you can build custom data type validation using the pattern key in JSON schema.
Custom Data Types
You can create custom data types to share between your contracts. If you need them on multiple applications, consider using an npm module.