Skip to content

Commit 03f04a2

Browse files
authored
Merge pull request #5591 from NomicFoundation/fix-comments
chore: cleanup comments in hook types
2 parents ca8ee82 + f8d5e97 commit 03f04a2

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

v-next/core/src/types/hooks.ts

+36-35
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export interface ConfigHooks {
6060
* Provide a handler for this hook to extend the user's config, before any
6161
* validation or resolution is done.
6262
*
63-
* @param config - The user's config.
64-
* @param next - A function to call the next handler for this hook.
63+
* @param config The user's config.
64+
* @param next A function to call the next handler for this hook.
6565
* @returns The extended config.
6666
*/
6767
extendUserConfig: (
@@ -72,7 +72,7 @@ export interface ConfigHooks {
7272
/**
7373
* Provide a handler for this hook to validate the user's config.
7474
*
75-
* @param config - The user's config.
75+
* @param config The user's config.
7676
* @returns An array of validation errors.
7777
*/
7878
validateUserConfig: (
@@ -88,8 +88,8 @@ export interface ConfigHooks {
8888
* result is typed as `HardhatConfig`, it may actually be incomplete, as other
8989
* plugins may not have resolved their parts of the config yet.
9090
*
91-
* @param userConfig - The user's config.
92-
* @param next - A function to call the next handler for this hook.
91+
* @param userConfig The user's config.
92+
* @param next A function to call the next handler for this hook.
9393
* @returns The resolved config.
9494
*/
9595
resolveUserConfig: (
@@ -133,9 +133,9 @@ export interface ConfigurationVariableHooks {
133133
* Provide a handler for this hook to customize how to fetch the value
134134
* that a configuration variable represents.
135135
*
136-
* @param context - The hook context.
137-
* @param variable - The configuration variable or string to resolve.
138-
* @param next - A function to call if the handler decides to not handle the
136+
* @param context The hook context.
137+
* @param variable The configuration variable or string to resolve.
138+
* @param next A function to call if the handler decides to not handle the
139139
* resolution of this variable.
140140
*/
141141
fetchValue: (
@@ -159,11 +159,11 @@ export interface UserInterruptionHooks {
159159
* @see UserInterruptionManager#displayMessage to understand when the returned
160160
* promise should be resolved.
161161
*
162-
* @param context - The hook context.
163-
* @param interruptor - A name or description of the module trying to display
162+
* @param context The hook context.
163+
* @param interruptor A name or description of the module trying to display
164164
* the message.
165-
* @param message - The message to display.
166-
* @param next - A function to call if the handler decides to not handle the
165+
* @param message The message to display.
166+
* @param next A function to call if the handler decides to not handle the
167167
* message.
168168
*/
169169
displayMessage: (
@@ -181,12 +181,12 @@ export interface UserInterruptionHooks {
181181
* Provide a handler for this hook to customize how the
182182
* `UserInterruptionManager` requests input from the user.
183183
*
184-
* @param context - The hook context.
185-
* @param interruptor - A name or description of the module trying to request
184+
* @param context The hook context.
185+
* @param interruptor A name or description of the module trying to request
186186
* input form the user.
187-
* @param inputDescription - A description of the input that is being
187+
* @param inputDescription A description of the input that is being
188188
* requested.
189-
* @param next - A function to call if the handler decides to not handle the
189+
* @param next A function to call if the handler decides to not handle the
190190
* input request.
191191
*/
192192
requestInput: (
@@ -207,12 +207,12 @@ export interface UserInterruptionHooks {
207207
* Note that handlers for this hook should take care of to not display the
208208
* user's input in the terminal, and not leak it in any way.
209209
*
210-
* @param context - The hook context.
211-
* @param interruptor - A name or description of the module trying to request
210+
* @param context The hook context.
211+
* @param interruptor A name or description of the module trying to request
212212
* input form the user.
213-
* @param inputDescription - A description of the input that is being
213+
* @param inputDescription A description of the input that is being
214214
* requested.
215-
* @param next - A function to call if the handler decides to not
215+
* @param next A function to call if the handler decides to not
216216
* handle the input request.
217217
*/
218218
requestSecretInput: (
@@ -240,7 +240,7 @@ export interface HardhatRuntimeEnvironmentHooks {
240240
/**
241241
* An interface with utilities to interact with hooks and their handlers.
242242
*
243-
* This interface provides methods fetch and run hook handlers, as well as
243+
* This interface provides methods to fetch and run hook handlers, as well as
244244
* registering and unregistering dynamic ones.
245245
*
246246
* Using this `HookManager` you can run a hook's handlers in a few different
@@ -249,6 +249,7 @@ export interface HardhatRuntimeEnvironmentHooks {
249249
* next one.
250250
* - In order, where all handlers are called in the order that `getHooks`
251251
* returns them.
252+
* - In parallel, where all handlers are called at the same time.
252253
*/
253254
export interface HookManager {
254255
/**
@@ -257,7 +258,7 @@ export interface HookManager {
257258
* The priority is defined like this:
258259
* - Dynamically registered handlers come first, in the reverse order they
259260
* were registered.
260-
* - Plugin handlers come last, in the same reverse of the resolved plugins
261+
* - Plugin handlers come last, in the same reverse of the resolved plugins
261262
* list, as seen in `HardhatConfig#plugins`.
262263
*/
263264
getHandlers<
@@ -295,15 +296,15 @@ export interface HookManager {
295296
*
296297
* For a hook to work with this method, it should look like this:
297298
*
298-
* `(arg1: Type1, ..., argN: TypeN, n ext: (a1: Type1, ..., aN: TypeN) => Promise<ReturnType>) => Promise<ReturnType>`
299+
* `(arg1: Type1, ..., argN: TypeN, next: (a1: Type1, ..., aN: TypeN) => Promise<ReturnType>) => Promise<ReturnType>`
299300
*
300301
* Note that `next` MUST NOT be called more than once in any handler.
301302
*
302-
* @param hookCategoryName - The name of the category of the hook whose
303+
* @param hookCategoryName The name of the category of the hook whose
303304
* handlers should be run.
304-
* @param hookName - The name of the hook whose handlers should be run.
305-
* @param initialParams - The params to pass to the first handler that is run.
306-
* @param defaultHandler - The last handler in the chain. This can be thought
305+
* @param hookName The name of the hook whose handlers should be run.
306+
* @param initialParams The params to pass to the first handler that is run.
307+
* @param defaultImplementation The last handler in the chain. This can be thought
307308
* as the behavior that this execution should have in the absense of any
308309
* handler.
309310
* @returns The result of executing the chained handlers.
@@ -316,17 +317,17 @@ export interface HookManager {
316317
hookCategoryName: HookCategoryNameT,
317318
hookName: HookNameT,
318319
initialParams: InitialChainedHookParams<HookCategoryNameT, HookT>,
319-
defaultHandler: LastParameter<HookT>,
320+
defaultImplementation: LastParameter<HookT>,
320321
): Promise<Awaited<Return<HookT>>>;
321322

322323
/**
323324
* Runs all the handlers for a hook in the same order that `getHandlers`
324325
* returns them.
325326
*
326-
* @param hookCategoryName - The name of the category of the hook whose
327+
* @param hookCategoryName The name of the category of the hook whose
327328
* handlers should be run.
328-
* @param hookName - The name of the hook to run.
329-
* @param params - The params to pass to the hooks.
329+
* @param hookName The name of the hook to run.
330+
* @param params The params to pass to the hooks.
330331
*/
331332
runSequentialHandlers<
332333
HookCategoryNameT extends keyof HardhatHooks,
@@ -341,10 +342,10 @@ export interface HookManager {
341342
/**
342343
* Runs all the handlers for a hook in parallel.
343344
*
344-
* @param hookCategoryName - The name of the category of the hook whose
345+
* @param hookCategoryName The name of the category of the hook whose
345346
* handlers should be run.
346-
* @param hookName - The name of the hook to run.
347-
* @param params - The params to pass to the hooks.
347+
* @param hookName The name of the hook to run.
348+
* @param params The params to pass to the hooks.
348349
*/
349350
runParallelHandlers<
350351
HookCategoryNameT extends keyof HardhatHooks,
@@ -389,7 +390,7 @@ export type InitialChainedHookParams<
389390
: ParametersExceptFirstAndLast<HookT>;
390391

391392
/**
392-
* The intial parameters to run a chain of hooks.
393+
* The initial parameters to run hooks either sequentially or in parallel.
393394
*/
394395
export type InitialHookParams<
395396
HookCategoryNameT extends keyof HardhatHooks,

0 commit comments

Comments
 (0)