diff --git a/.changeset/typed-hook-map-interface.md b/.changeset/typed-hook-map-interface.md new file mode 100644 index 0000000..264b6ce --- /dev/null +++ b/.changeset/typed-hook-map-interface.md @@ -0,0 +1,5 @@ +--- +"tapable": patch +--- + +Declare `TypedHookMap` as an interface, as no such class is exported. diff --git a/tapable.d.ts b/tapable.d.ts index e2ca8c2..44770b8 100644 --- a/tapable.d.ts +++ b/tapable.d.ts @@ -155,10 +155,11 @@ export class HookMap { intercept(interceptor: HookMapInterceptor): void; } -type AnyHook = Hook; - -export class TypedHookMap> { - constructor(factory: HookFactory, name?: string); +/** + * A `HookMap` whose keys are typed: each key `K` of `M` maps to the hook `M[K]`. + * It is a type only, for annotating a `HookMap`; create one with `new HookMap()`. + */ +export interface TypedHookMap { name: string | undefined; get(key: K): M[K] | undefined; for(key: K): M[K];