-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working