andywer / andywer/typed-emitter
Variable Event Names
- Linguagem predominante
- JavaScript
- Estrelas
- 285
- Forks
- 29
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Hey there!
Is there any way to type events with variable event names?
Specifically, i am trying to type https://github.com/PrismarineJS/prismarine-world/blob/55a6f78b4802519b7bee7ace20daa7e956e6ca7f/src/worldsync.js#L69
The World Class emits events called `blockUpdate:${position}`, which stringifies to `blockUpdate:(123, 123, 123)`.
Is typing this kind of event possible with typed-emitter?
I know that such complex string type matching is possible in Typescript, see Typescript DFA, but is there any way to do this while using typed-emitter?
Thanks for your time!
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.