marshallswain / feathers-pinia

Connect your Feathers API to the elegant data store for Vue
52 stars 22 forks source link

Warnings with types #143

Closed Granipouss closed 4 months ago

Granipouss commented 10 months ago

Hey,

I am trying to use feather-pinia v4 with feathersjs v5. But I have some typescript warnings in vscode.

import { client } from '@/feathersClient'
import { createPiniaClient } from 'feathers-pinia'
import { getActivePinia } from 'pinia'

export const api = createPiniaClient(client, {
  pinia: getActivePinia(),
  idField: '_id'
})

It shows me :

Exported variable 'api' has or is using name 'AppExtensions' from external module "path/to/node_modules/feathers-pinia/dist/create-pinia-client" but cannot be named.ts(4023)
const api: Application<CreatePiniaServiceTypes<ServiceTypes>, any> & AppExtensions

And indeed it seems like types are not exported in create-pinia-client.ts

I think that can be resolved by simply ensuring that every type used in exported methods is also exported.

Cheers

marshallswain commented 5 months ago

@Granipouss did this issue get resolved by merging your PR?

marshallswain commented 4 months ago

I think we're making good progress in this area. I'm closing this for now. Feel free to reopen if the issue persists.