Skip to content

Commit

Permalink
declare type definitions on EventBus
Browse files Browse the repository at this point in the history
To address #54,
adjusts the EventBus import to preserve the imported name, while still adding
type definitions to the imported object.
  • Loading branch information
e-pavlica committed Aug 25, 2020
1 parent ba95295 commit b4a1e29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/event-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface IEventBus {
dispatch: IDispatch
}

import * as EventBusAny from "eventbusjs"
const EventBus: IEventBus = EventBusAny
import * as EventBus from "eventbusjs"
declare module "eventbusjs" {
interface EventBus extends IEventBus {}
}
export { EventBus }

0 comments on commit b4a1e29

Please sign in to comment.