MCPcopy
hub / github.com/electron/forge / namedHookWithTaskFn

Function namedHookWithTaskFn

packages/plugin/base/src/Plugin.ts:57–73  ·  view source on GitHub ↗
(
  hookFn: <Ctx = never>(
    task: ForgeListrTask<Ctx> | null,
    ...args: Parameters<ForgeHookFn<Hook>>
  ) => ReturnType<ForgeHookFn<Hook>>,
  name: string,
)

Source from the content-addressed store, hash-verified

55 * @internal
56 */
57export 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
76export { Plugin as PluginBase };

Callers 3

getHooksMethod · 0.85
VitePluginClass · 0.85
getHooksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected