pinia-orm
                                
                                 pinia-orm copied to clipboard
                                
                                    pinia-orm copied to clipboard
                            
                            
                            
                        Enhancing typescript safety in model class by removing generic property declaration
Environment
No response
Reproduction
I don't think we need a reproduction link for this
Describe the bug
The Model class has this line [s: keyof ModelFields]: any;, which I think is problematic because it allows us to use any property of the model without typescript errors. I think we should remove this line. Is there a specific reason for keeping it?
For example for this Foo model, we should get this ts error: Property 'bar' does not exist on type 'Foo'..., while in the example, bar is typed as any
export class Foo extends Model {
  @Uid() id!: number;
}
const foo = new Foo();
foo.bar; //  typed as any
Current behavior
Expected behavior
Additional context
I'm putting this issue here for discussion, but I can tackle this task if needed 😁
Logs
No response
Good Question. I don't know yet. I am not a typescript pro. I try to play with your idea to see if maybe i get any caveats.
Thank you! I've already quickly tested removing that line to see if there was anything blocking, and I didn't find anything special. If you need help with that, I'd be happy to offer a PR when I have some time 😁
I would also love this feature, as I expected the default behavior to be more strict.
Maybe It's something that could be toggled via a config prop?
@joris-gallot @daniandl Well guys its your lucky day. You are getting more than that 😉