Skip to content

Commit 709e8cb

Browse files
committed
Cleanup types
1 parent ceb9c58 commit 709e8cb

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

v-next/core/src/internal/tasks/builders.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
EmptyTaskDefinitionBuilder,
1414
EmptyTaskDefinition,
1515
ExtendTaskArguments,
16+
TaskArguments,
1617
} from "../../types/tasks.js";
1718

1819
import { HardhatError } from "@ignored/hardhat-vnext-errors";
@@ -57,7 +58,7 @@ export class EmptyTaskDefinitionBuilderImplementation
5758
}
5859

5960
export class NewTaskDefinitionBuilderImplementation<
60-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
61+
TaskArgumentsT extends TaskArguments = TaskArguments,
6162
> implements NewTaskDefinitionBuilder<TaskArgumentsT>
6263
{
6364
readonly #id: string[];
@@ -237,7 +238,7 @@ export class NewTaskDefinitionBuilderImplementation<
237238
}
238239

239240
export class TaskOverrideDefinitionBuilderImplementation<
240-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
241+
TaskArgumentsT extends TaskArguments = TaskArguments,
241242
> implements TaskOverrideDefinitionBuilder<TaskArgumentsT>
242243
{
243244
readonly #id: string[];

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

+8-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type {
22
OptionDefinition,
33
ArgumentType,
44
ArgumentTypeToValueType,
5-
ArgumentValue,
65
PositionalArgumentDefinition,
76
} from "./arguments.js";
87
import type { HardhatRuntimeEnvironment } from "./hre.js";
@@ -33,7 +32,7 @@ declare module "./config.js" {
3332
* A type representing the concrete arguments of a task. That is,
3433
* the actual values passed to it.
3534
*/
36-
export type TaskArguments = Record<string, ArgumentValue | ArgumentValue[]>;
35+
export type TaskArguments = Record<string, any>;
3736

3837
/**
3938
* The type of a new task's action function.
@@ -46,7 +45,7 @@ export type TaskArguments = Record<string, ArgumentValue | ArgumentValue[]>;
4645
* it allows inferring the types of the action function's arguments.
4746
*/
4847
export type NewTaskActionFunction<
49-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
48+
TaskArgumentsT extends TaskArguments = TaskArguments,
5049
> = (taskArguments: TaskArgumentsT, hre: HardhatRuntimeEnvironment) => any;
5150

5251
/**
@@ -60,11 +59,11 @@ export type NewTaskActionFunction<
6059
* it allows inferring the types of the action function's arguments.
6160
*/
6261
export type TaskOverrideActionFunction<
63-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
62+
TaskArgumentsT extends TaskArguments = TaskArguments,
6463
> = (
65-
taskArguments: TaskArgumentsT & Record<string, any>,
64+
taskArguments: TaskArgumentsT & TaskArguments,
6665
hre: HardhatRuntimeEnvironment,
67-
runSuper: (taskArguments: Record<string, any>) => Promise<any>,
66+
runSuper: (taskArguments: TaskArguments) => Promise<any>,
6867
) => any;
6968

7069
/**
@@ -135,7 +134,7 @@ export type TaskDefinition =
135134
export type ExtendTaskArguments<
136135
NameT extends string,
137136
TypeT extends ArgumentType,
138-
TaskArgumentsT extends Record<string, any>,
137+
TaskArgumentsT extends TaskArguments,
139138
> = Record<NameT, ArgumentTypeToValueType<TypeT>> & TaskArgumentsT;
140139

141140
/**
@@ -157,7 +156,7 @@ export interface EmptyTaskDefinitionBuilder {
157156
* A builder for creating NewTaskDefinitions.
158157
*/
159158
export interface NewTaskDefinitionBuilder<
160-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
159+
TaskArgumentsT extends TaskArguments = TaskArguments,
161160
> {
162161
/**
163162
* Sets the description of the task.
@@ -274,7 +273,7 @@ export interface NewTaskDefinitionBuilder<
274273
* A builder for overriding existing tasks.
275274
*/
276275
export interface TaskOverrideDefinitionBuilder<
277-
TaskArgumentsT extends Record<string, any> = Record<string, any>,
276+
TaskArgumentsT extends TaskArguments = TaskArguments,
278277
> {
279278
/**
280279
* Sets a new description for the task.

0 commit comments

Comments
 (0)