Would it be possible to export some of the types used in the library?
I am trying to implement a wrapper function of createQueryKeyStore but I can't find a way to get the typings right.
A simple reproduction example is:
function createQueryKeyStoreWrapper<T>(name: string, storeDefinitions: T) {
return createQueryKeyStore(name, storeDefinitions); //Argument of type 'T' is not assignable to parameter of type '{ [x: string]: FactoryProperty | DynamicKey; }'
}
I tried redefining QueryFactorySchema on my end but then
function createQueryKeyStoreWrapper<T extends QueryFactorySchema>(name: string, storeDefinitions: T) {
return createQueryKeyStore(name, storeDefinitions);
}
const result = createQueryKeyStoreWrapper('store', {
byId: (id: number) => [id]
})
result.byId // byId is of type never
I think it would be easier if types like createQueryKeyStore inputs and outputs were to be exported.
Would it be possible to export some of the types used in the library?
I am trying to implement a wrapper function of
createQueryKeyStorebut I can't find a way to get the typings right.A simple reproduction example is:
I tried redefining QueryFactorySchema on my end but then
I think it would be easier if types like createQueryKeyStore inputs and outputs were to be exported.