Helper to define instance methods with properly typed this context.
This is a zero-cost abstraction - at runtime it just returns the methods object.
At compile-time, it provides TypeScript with ThisType<InferInstance & Methods>
so that this inside your methods is correctly typed as the model instance.
Helper to define instance methods with properly typed
thiscontext.This is a zero-cost abstraction - at runtime it just returns the methods object. At compile-time, it provides TypeScript with ThisType<InferInstance & Methods>
so that
thisinside your methods is correctly typed as the model instance.