mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-08 23:28:10 -05:00
**Motivation** Use latest `module` and `moduleResolution` for TS. **Description** - To use [subpath imports](https://nodejs.org/api/packages.html#subpath-imports) in the PR #8320 we need to update the module solution strategy for TS. - That requires to change the `module` for the TS as well. - Earlier tried to stay with `node18` or `node20`, but the `ts-node` does not work with that. - Maintaining different tsconfig for ts-node is more of hassle on wrong run. - So decided to stick with `nodenext` strategy for `moduleResolution` **Steps to test or reproduce** Run all tests --------- Co-authored-by: Cayman <caymannava@gmail.com>
12 lines
361 B
TypeScript
12 lines
361 B
TypeScript
declare module "mitt" {
|
|
export type Emitter<T extends Record<string, (...args: any[]) => void>> = {
|
|
on<K extends keyof T>(type: K, handler: T[K]): void;
|
|
off<K extends keyof T>(type: K, handler: T[K]): void;
|
|
emit<K extends keyof T>(type: K, ...args: Parameters<T[K]>): void;
|
|
};
|
|
|
|
export function mitt<T>(): Emitter<T>;
|
|
|
|
export default mitt;
|
|
}
|