node-apn
node-apn copied to clipboard
topic missing in type ProviderOptions
I had to do this when declaring ParseServerConfig in my app, because the topic field is missing :
declare module 'parse-server' {
import type {ProviderOptions} from '@parse/node-apn'
...
type ParseServerConfig = {
...
push: {
android: {senderId: string, apiKey: string},
ios: (ProviderOptions & {topic?:string})[],
}
...
}
}
Thanks for opening this issue!
Could you please add a full issue description?
There is no template for issues in this repo, unlike for the other parse repos I've submitted issues to, but this is purely a Typescript declaration issue, so, it can't have anything to do with my version of MongoDB.
I don't know what you need to know in addition to what I said. I am using @parse/node-apn 6.0.1 and I see that master branch of @parse/node-apn is also lacking this field in /index.d.ts.
In index.d.ts, in export interface ProviderOptions {...}, insert this line :
topic?:string
Actually, sorry, topic isn't actually a field that goes there at that level. Like most Parse users, I'm configuring this through new ParseServer. Today I've searched parse, parse-server and @parse/node-apn for topic, push, ios and Provider, and didn't find anything relevant, then I realised that I hadn't searched @parse/push-adapter yet, and there it is. The problem I am trying to solve from the start, is to compensate for the lack of type declarations in parse-server, but in this case, the push section has a type that should be defined in @parse/push-adapter instead (a project that also has no type declarations).
Yes, only few repos have started converting to TS; please feel free to open an issue or PR in the respective repo.