data
data copied to clipboard
feat: add consumer types for Model APIs
adds types for
- decorators
- [x] attr
- [x] transforms
class { @attr declare name string; // enforces transform name is a string, and defaultValue is a primitive or function // and no other keys allowed on the options hash @attr('string', { defaultValue: 'hello world' }) declare name string; // enforces that defaultValue is a primitive or function and no other keys allowed // on the options hash @attr({ defaultValue: 'hello world' }) declare name string; // enforces that the transform name matches the brand symbol on StringTransform // enforces that defaultValue is a primitive value or function whose type matches // the transform's output // enforces that only options allowed by the transform are able to be passed into // the options object @attr<StringTransform>('string', { defaultValue: 'hello world' }) declare name string; }
- [ ] belongsTo
- [ ] hasMany
- [x] attr
- Model APIs
- [ ] record.belongsTo()
- [ ] record.hasMany()
adds type utils for
- [ ] async hasMany
- [ ] async belongsTo