Environment
Vue 3 (not Nuxt) + TypeScript
Reproduction
import { Model, Repository } from "pinia-orm";
export class MyItem extends Model {
declare id: number;
...
}
export class MyItemRepo extends Repository<MyItem> {
use = MyItem;
...
}
import { useRepo } from "pinia-orm";
const myItemRepo = useRepo(MyItemRepo);
const myItem = myItemRepo.find(1); // Type of `myItem` is `any`, not `MyItem | undefined`.
Describe the bug
When using useRepo to get a repository instance, when calling the find method, the type of the returned value is any, not the type of the Model as you would expect.
This may have been caused by the removal of .find from the Repository class: https://github.com/CodeDredd/pinia-orm/pull/1831/files#diff-de773c674180b12ca839cbf77f65443d6964b83ad45e8615e727e76601c7330fL340-L348
Additional context
No response
Logs
No response
Environment
Vue 3 (not Nuxt) + TypeScript
Reproduction
Describe the bug
When using
useRepoto get a repository instance, when calling thefindmethod, the type of the returned value isany, not the type of the Model as you would expect.This may have been caused by the removal of
.findfrom theRepositoryclass: https://github.com/CodeDredd/pinia-orm/pull/1831/files#diff-de773c674180b12ca839cbf77f65443d6964b83ad45e8615e727e76601c7330fL340-L348Additional context
No response
Logs
No response