Files
lodestar/types/mitt/index.d.ts
Nazar Hussain 0c6f50771f chore: use latest TS module resolution (#8419)
**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>
2025-09-18 11:36:48 -04:00

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;
}