@nomiclabs/buidler > SimpleTaskDefinition

# Class: SimpleTaskDefinition

# Hierarchy

SimpleTaskDefinition

# Implements

# Index

# Constructors

# Properties

# Accessors

# Methods


# Constructors

# constructor

new SimpleTaskDefinition(name: string, isInternal?: boolean): SimpleTaskDefinition

Defined in internal/core/tasks/task-definitions.ts:32

Parameters:

Name Type Default value Description
name string - The task's name.
Default value isInternal boolean false `true` if the task is internal, `false` otherwise.

Returns: SimpleTaskDefinition


# Properties

# action

● action: ActionType<TaskArguments>

Implementation of TaskDefinition.action

Defined in internal/core/tasks/task-definitions.ts:27


# isInternal

● isInternal: boolean

Implementation of TaskDefinition.isInternal

Defined in internal/core/tasks/task-definitions.ts:44


# name

● name: string

Implementation of TaskDefinition.name

Defined in internal/core/tasks/task-definitions.ts:43


# paramDefinitions

● paramDefinitions: ParamDefinitionsMap

Implementation of TaskDefinition.paramDefinitions

Defined in internal/core/tasks/task-definitions.ts:25


# positionalParamDefinitions

● positionalParamDefinitions: Array<ParamDefinition<any>> = []

Implementation of TaskDefinition.positionalParamDefinitions

Defined in internal/core/tasks/task-definitions.ts:26


# Accessors

# description

description:

Implementation of TaskDefinition.description

Defined in internal/core/tasks/task-definitions.ts:22


# Methods

# addFlag

addFlag(name: string, description: undefined | string): this

Implementation of TaskDefinition.addFlag

Defined in internal/core/tasks/task-definitions.ts:174

Parameters:

Name Type Description
name string the parameter's name.
Optional description undefined | string the parameter's description.

Returns: this


# addOptionalParam

addOptionalParam<T>(name: string, description: undefined | string, defaultValue: T, type: types.ArgumentType<T>): this

Implementation of TaskDefinition.addOptionalParam

Defined in internal/core/tasks/task-definitions.ts:155

Type parameters:

# T

Parameters:

Name Type Description
name string the parameter's name.
Optional description undefined | string the parameter's description.
Optional defaultValue T a default value.
Optional type types.ArgumentType<T> param's type.

Returns: this


# addOptionalPositionalParam

addOptionalPositionalParam<T>(name: string, description: undefined | string, defaultValue: T, type: types.ArgumentType<T>): this

Implementation of TaskDefinition.addOptionalPositionalParam

Defined in internal/core/tasks/task-definitions.ts:278

Type parameters:

# T

Parameters:

Name Type Description
name string the parameter's name.
Optional description undefined | string the parameter's description.
Optional defaultValue T a default value.
Optional type types.ArgumentType<T> param's type.

Returns: this


# addOptionalVariadicPositionalParam

addOptionalVariadicPositionalParam<T>(name: string, description: undefined | string, defaultValue: T[] | T, type: types.ArgumentType<T>): this

Defined in internal/core/tasks/task-definitions.ts:374

Type parameters:

# T

Parameters:

Name Type Description
name string the parameter's name.
Optional description undefined | string the parameter's description.
Optional defaultValue T[] | T a default value.
Optional type types.ArgumentType<T> param's type.

Returns: this


# addParam

addParam<T>(name: string, description: undefined | string, defaultValue: T, type: types.ArgumentType<T>, isOptional?: boolean): this

Defined in internal/core/tasks/task-definitions.ts:87

Type parameters:

# T

Parameters:

Name Type Default value Description
name string - The parameter's name.
Optional description undefined | string - The parameter's description.
Optional defaultValue T - A default value. This must be `undefined` if `isOptional` is `true`.
Optional type types.ArgumentType<T> - The param's `ArgumentType`. It will parse and validate the user's input.
Default value isOptional boolean defaultValue !== undefined `true` if the parameter is optional. It's default value is `true` if `defaultValue` is not `undefined`.

Returns: this


# addPositionalParam

addPositionalParam<T>(name: string, description: undefined | string, defaultValue: T, type: types.ArgumentType<T>, isOptional?: boolean): this

Defined in internal/core/tasks/task-definitions.ts:206

Type parameters:

# T

Parameters:

Name Type Default value Description
name string - The parameter's name.
Optional description undefined | string - The parameter's description.
Optional defaultValue T - A default value. This must be `undefined` if `isOptional` is `true`.
Optional type types.ArgumentType<T> - The param's `ArgumentType`. It will parse and validate the user's input.
Default value isOptional boolean defaultValue !== undefined `true` if the parameter is optional. It's default value is `true` if `defaultValue` is not `undefined`.

Returns: this


# addVariadicPositionalParam

addVariadicPositionalParam<T>(name: string, description: undefined | string, defaultValue: T[] | T, type: types.ArgumentType<T>, isOptional?: boolean): this

Defined in internal/core/tasks/task-definitions.ts:297

Type parameters:

# T

Parameters:

Name Type Default value Description
name string - The parameter's name.
Optional description undefined | string - The parameter's description.
Optional defaultValue T[] | T - A default value. This must be `undefined` if `isOptional` is `true`.
Optional type types.ArgumentType<T> - The param's `ArgumentType`. It will parse and validate the user's input.
Default value isOptional boolean defaultValue !== undefined `true` if the parameter is optional. It's default value is `true` if `defaultValue` is not `undefined`.

Returns: this


# setAction

setAction<ArgsT>(action: ActionType<ArgsT>): this

Implementation of TaskDefinition.setAction

Defined in internal/core/tasks/task-definitions.ts:69

Type parameters:

# ArgsT : TaskArguments

Parameters:

Name Type Description
action ActionType<ArgsT> The action.

Returns: this


# setDescription

setDescription(description: string): this

Implementation of TaskDefinition.setDescription

Defined in internal/core/tasks/task-definitions.ts:60

Parameters:

Name Type Description
description string The description.

Returns: this