data icon indicating copy to clipboard operation
data copied to clipboard

feat: add consumer types for Model APIs

Open runspired opened this issue 11 months ago • 0 comments

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
  • Model APIs
    • [ ] record.belongsTo()
    • [ ] record.hasMany()

adds type utils for

  • [ ] async hasMany
  • [ ] async belongsTo

runspired avatar Mar 04 '24 02:03 runspired