Closed soccermax closed 2 months ago
@soccermax I checked other libraries with TypeScript support, they add in the package.json
{
...
"main": "src/index.js",
"types": "src/index.d.ts",
...
)
One additional comment regarding EventProcessingStatusType
. I think the type should be defined like this if you don't want to use an enum
for the EventProcessingStatus
.
declare type EventProcessingStatusKeysType = keyof typeof EventProcessingStatus
export declare type EventProcessingStatusType = typeof EventProcessingStatus[EventProcessingStatusKeysType];
That would look like this
instead of this with the current type
Because looking at the return type of processEvent
https://github.com/cap-js-community/event-queue/blob/acaad703fa19be611a7758ec4b7991b6a54e5abe/src/index.d.ts#L105
The jsdoc states that the value is the integer 0
not the key Open
.
https://github.com/cap-js-community/event-queue/blob/acaad703fa19be611a7758ec4b7991b6a54e5abe/src/EventQueueProcessorBase.js#L84-L86
Other than that our current implementation with CAP TypeScript would work with this update, thanks again for taking the time!
fix https://github.com/cap-js-community/event-queue/issues/155