Add type inference for type definitions