diff --git a/packages/joint-core/types/joint.d.ts b/packages/joint-core/types/joint.d.ts index 13366a3ca..7db7d6708 100644 --- a/packages/joint-core/types/joint.d.ts +++ b/packages/joint-core/types/joint.d.ts @@ -372,9 +372,6 @@ export namespace dia { // custom [eventName: string]: mvc.EventHandler; } - - type DefinedEventMap = ExcludeIndexSignature; - } class Graph extends mvc.Model { @@ -399,18 +396,18 @@ export namespace dia { // events - on( + on( eventName: T, - callback: Graph.DefinedEventMap[T], + callback: Graph.EventMap[T], context?: any ): this; on( - eventName: LiteralUnion, + eventName: LiteralUnion>, callback: mvc.EventHandler, context?: any ): this; - on>( + on>( events: E, context?: any ): this; @@ -1920,8 +1917,6 @@ export namespace dia { [eventName: string]: mvc.EventHandler; } - type DefinedEventMap = ExcludeIndexSignature; - interface BufferOptions { /** * A buffer around the area to extend the search to @@ -2212,18 +2207,18 @@ export namespace dia { // events - on( + on( eventName: T, - callback: Paper.DefinedEventMap[T], + callback: Paper.EventMap[T], context?: any ): this; on( - eventName: LiteralUnion, + eventName: LiteralUnion>, callback: mvc.EventHandler, context?: any ): this; - on>( + on>( events: E, context?: any ): this; @@ -3642,12 +3637,6 @@ export namespace mvc { [event: string]: EventHandler; } - /** - * A partial map of known event callbacks, plus any custom string events. - * Use with a DefinedEventMap to get autocomplete for known events. - */ - type EventCallbackMap = Partial & { [key: string]: EventHandler }; - const Events: Events; interface Events extends EventsMixin {}