hookable
hookable copied to clipboard
Type 'HooksT' does not satisfy the constraint 'Record<string, any>'
Environment
Node: 16.17.1
typescript: 4.9.4
hookable: 5.4.2
Reproduction
Run yarn run build
or tsc
.
Describe the bug
A PR for this issue will be submitted
When compiling with tsc
, everything gets compiled correctly, but we receive this error message:
node_modules/hookable/dist/index.d.ts:65:49 - error TS2344: Type 'HooksT' does not satisfy the constraint 'Record<string, any>'.
65 beforeEach(function_: (event: InferSpyEvent<HooksT>) => void): () => void;
~~~~~~
node_modules/hookable/dist/index.d.ts:46:24
46 declare class Hookable<HooksT = Record<string, HookCallback>, HookNameT extends HookKeys<HooksT> = HookKeys<HooksT>> {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This type parameter might need an `extends Record<string, any>` constraint.
node_modules/hookable/dist/index.d.ts:66:48 - error TS2344: Type 'HooksT' does not satisfy the constraint 'Record<string, any>'.
66 afterEach(function_: (event: InferSpyEvent<HooksT>) => void): () => void;
~~~~~~
node_modules/hookable/dist/index.d.ts:46:24
46 declare class Hookable<HooksT = Record<string, HookCallback>, HookNameT extends HookKeys<HooksT> = HookKeys<HooksT>> {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This type parameter might need an `extends Record<string, any>` constraint.
Found 2 errors in the same file, starting at: node_modules/hookable/dist/index.d.ts:65
error Command failed with exit code 2.
Additional context
No response
Logs
No response