JorgenVatle / feathers-factory

🏭 Create data factories for your Feathers services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing types on Factory generator

AshotN opened this issue · comments

I have a UserFactory I have created that doesn't seem to complain if i don't pass any properties. The return type is also based on whatever properties I pass to it. Is this intentional?

export const UserFactory = new Factory(app.service('user'), {

})

This produces no errors, but I would expect it to

I believe the inferred type should be an empty object in this instance.

Type-inference, particularly for v3/v4 Feathers Services are still a little flaky in its current state. 😅

If you have some other examples I could take a look at, maybe I could help out a little more. 👍

Depending on how the Feathers app is constructed, the service could have an implicit any type. Making the app.service('user') yield a loose service type.

Here is the type for app.service('user')

FeathersApplication<ServiceTypes, Configuration>.service<"user">(path: "user"): FeathersService<Application, UserService<UserParams>>

I'm not sure what else to provide to make this easier to debug, I am on Dove so there may be some incompatibility.