(
hookFn: <Ctx = never>(
task: ForgeListrTask<Ctx> | null,
...args: Parameters<ForgeHookFn<Hook>>
) => ReturnType<ForgeHookFn<Hook>>,
name: string,
)
| 55 | * @internal |
| 56 | */ |
| 57 | export const namedHookWithTaskFn = <Hook extends ForgeHookName>( |
| 58 | hookFn: <Ctx = never>( |
| 59 | task: ForgeListrTask<Ctx> | null, |
| 60 | ...args: Parameters<ForgeHookFn<Hook>> |
| 61 | ) => ReturnType<ForgeHookFn<Hook>>, |
| 62 | name: string, |
| 63 | ): ForgeHookFn<Hook> => { |
| 64 | function namedHookWithTaskInner( |
| 65 | this: ForgeListrTask<any> | null, |
| 66 | ...args: any[] |
| 67 | ) { |
| 68 | return (hookFn as any)(this, ...args); |
| 69 | } |
| 70 | const fn = namedHookWithTaskInner as any; |
| 71 | fn.__hookName = name; |
| 72 | return fn; |
| 73 | }; |
| 74 | /* eslint-enable @typescript-eslint/no-explicit-any */ |
| 75 | |
| 76 | export { Plugin as PluginBase }; |
no outgoing calls
no test coverage detected