import './config' ; import './utilities' ; import './plugins' ; import registerTasks from './tasks' ; import { setConfig , setTask } from './bootstrap' ; import loading from './utilities/loading' ; import { DeepPartial , BalmConfig } from '@balm-core/index' ; class Balm { #config : BalmConfig ; constructor ( ) { BalmJS . loading = false ; loading . succeed ( ) ; this . #config = BalmJS . config ; } get config ( ) : DeepPartial < BalmConfig > { return this . #config ; } set config ( value ) { this . #config = setConfig ( value ) ; BalmJS . config = this . #config ; } set beforeTask ( name ) { BalmJS . beforeTask = setTask ( name ) ; } set afterTask ( name ) { BalmJS . afterTask = setTask ( name ) ; } go ( recipe = NOOP ) { if ( BalmJS . utils . isFunction ( recipe ) ) { registerTasks ( recipe ) ; } else { BalmJS . logger . error ( 'initialization' , 'BalmJS API: `balm.go(function(mix) {});`' ) ; } } reset ( ) { BalmJS . tasks = new Map ( ) ; BalmJS . recipes = [ ] ; BalmJS . recipeIndex = 0 ; BalmJS . beforeTask = undefined ; BalmJS . afterTask = undefined ; BalmJS . config . useDefaults = true ; } } export default Balm ;