import { ActionType , ConfigExtender , ConfigurableTaskDefinition , EnvironmentExtender , TaskArguments } from '../../../types' ; import { RedspotContext } from '../../context' ; import * as argumentTypes from '../params/argumentTypes' ; remarks param name param description param action returns export function task < ArgsT extends TaskArguments > ( name , description ? , action ? ) ; remarks param name param action returns export function task < ArgsT extends TaskArguments > ( name , action ) ; export function task < ArgsT extends TaskArguments > ( name , descriptionOrAction ? , action ? ) { const ctx = RedspotContext . getRedspotContext ( ) ; const dsl = ctx . tasksDSL ; if ( descriptionOrAction === undefined ) { return dsl . task ( name ) ; } if ( typeof descriptionOrAction !== 'string' ) { return dsl . task ( name , descriptionOrAction ) ; } return dsl . task ( name , descriptionOrAction , action ) ; } remarks remarks param name param description param action returns export function subtask < ArgsT extends TaskArguments > ( name , description ? , action ? ) ; remarks remarks param name param action returns export function subtask < ArgsT extends TaskArguments > ( name , action ) ; export function subtask < ArgsT extends TaskArguments > ( name , descriptionOrAction ? , action ? ) { const ctx = RedspotContext . getRedspotContext ( ) ; const dsl = ctx . tasksDSL ; if ( descriptionOrAction === undefined ) { return dsl . subtask ( name ) ; } if ( typeof descriptionOrAction !== 'string' ) { return dsl . subtask ( name , descriptionOrAction ) ; } return dsl . subtask ( name , descriptionOrAction , action ) ; } export const internalTask = subtask ; export const types = argumentTypes ; param extender export function extendEnvironment ( extender ) { const ctx = RedspotContext . getRedspotContext ( ) ; const extenderManager = ctx . extendersManager ; extenderManager . add ( extender ) ; } export function extendConfig ( extender ) { const ctx = RedspotContext . getRedspotContext ( ) ; ctx . configExtenders . push ( extender ) ; }