Andy Wermke
                                            Andy Wermke
                                        
                                    Hi @leumasme! Have you tried something like this yet? ```ts import { EventEmitter } from "events" import TypedEmitter from "typed-emitter" type MessageEvents = { `foo:(${string},${string},${string})`: (payload: number) => void }...
You definitely have to use a type alias as I did above, not an interface: `type MessageEvents = { /* ... */ }` > wont be possible without some explicit...
I forgot something, too: The computed property name must be written in brackets (``[`foo:…`]: …``) Anyhow, TypeScript will still fail to compile and tell us that this is not supported…...
I think I've got something… See [here](https://www.typescriptlang.org/play?#code/PTAEGUEMFsAcBsCmoCuBnSBzRAoHAXAT1mQFlE0NsBRAN0QDt81QBeUHUUAH1GugCW+fIgBOdRvgA8AAwBmAewUAuACQBvNPlECGmAL4yANKAAUaAQC9Ey0AxTQARmJNadAY3y3HSpJAYAlGwAfKC0CgIAJsGcPHyCwmISTLKOkKJqmtq6BsZmiqLuNqA+Cn6BIWER0XjuCgxaoNAUVIj8QiKibHaIAO589EztiaKmQZAsACrEiJHDnVLklFhtg8wxOM3LNAmdAHSICaYARIoqAIzHJgBMJnKQ8GiIAXg4IKAAIoju8OmQ+AJ6iwAGQQfAoRxoPC6Tr3IqgaYkOa7MRSOjMUCIAAeIgYkRY8ySazQoXUsUOQjRtHwmJxjHxA3WpgYMGK6IA2scWc1jgBdEx7QXpTBoWwc47CtB8gK2fAACwEUP0eGxsAUohpRBIoAAgqJMA5JGgpJNQux2ZNebTcQz2aZBXtJbZdHIxKAAKpBVihfyEXmxAD8HtitgtVuxNpY7PCUStQfZVtDlrwWuQyXwADEUAxPICGN17UL9aLQL6E17QjHIgQZvEOkSjd1CeI1lI3DkTOmszmAfUNqm6yN01IAHKs630ljtvQmbvuCd4glrOe9hhm0Bkrjc4pj5qxJ26-WGpjGucxZU4SLfX6iZA-CZLyTNjexOoNbQoTzqsY4ZVAA). I tried to seize the opportunity to turn the syntax into something that's hopefully easier to read than the old syntax, too: ```ts...
ping @leumasme
Hey @leumasme. We might be able to "fix it" with a global type declaration extending the existing `events` interface, potentially under a new entry point in `typed-emitter`. Haven't tried yet,...
This experimental syntax requires enabling one of the following parser plugin(s): 'flow, typescript'
Hey @heol-files! I think this is a result of #12… Can you try to add an empty `index.js` file to `node_modules/typed-emitter/` and drop the `main` field from `node_modules/typed-emitter/package.json`?
> Also tried adding it as a constraint on T, but same happens with class MyEventEmitter extends (EventEmitter as { new(): TypedEmitter }) { .. } - still the same...
Now I see. Yeah, that won't work… We need to constrain the generic type parameter `T`: ```diff import TypedEmitter from 'typed-emitter'; + import { EventMap } from 'typed-emitter'; import EventEmitter...
@sp00x Right… But how can it still say `error TS2344: Type 'T' does not satisfy the constraint 'EventMap'.` is there is the type constraint `class MyEventEmitter`? I think this requires...