import Maker from './maker' ; import { BalmEnvObject , BalmEntry , Configuration , InputOptions , OutputOptions , BuildOptions , TransformOptions , RenameOptions , HookOptions , SpriteOptions , ReplaceOptions , TemplateOption } from '@balm-core/index' ; class BaseHooks { get env ( ) : BalmEnvObject { return BalmJS . config . env ; } html ( input , output ) { Maker . generate ( 'html' , [ input , output ] ) ; } css ( input , output ) { Maker . generate ( 'postcss' , [ input , output ] ) ; } sass ( input , output , options ? ) { Maker . generate ( 'sass' , [ input , output , options ] ) ; } less ( input , output , options ? ) { Maker . generate ( 'less' , [ input , output , options ] ) ; } url ( input , output ) { Maker . generate ( 'url' , [ input , output ] ) ; } js ( ) { BalmJS . logger . warn ( 'balm api' , '`mix.js` is deprecated, please use `mix.webpack`/`mix.rollup`/`mix.esbuild` instead.' ) ; } webpack ( input , output , options ? , fn ? ) { Maker . generate ( 'webpack' , [ input , output , options , fn ] ) ; } esbuild ( input , output , options ? ) { Maker . generate ( 'esbuild' , [ input , output , options ] ) ; } rollup ( input , output ) { Maker . generate ( 'rollup' , [ input , output ] ) ; } jsmin ( input , output , options ? ) { Maker . generate ( 'jsmin' , [ input , output , options ] ) ; } copy ( input , output , options ? ) { Maker . generate ( 'copy' , [ input , output , options ] ) ; } remove ( paths ) { Maker . generate ( 'remove' , [ paths ] ) ; } version ( input , output , assetsOptions ? ) { Maker . generate ( 'version' , [ input , output , assetsOptions ] ) ; } serve ( handler ) { Maker . generate ( 'serve' , [ handler ] ) ; } } class BalmHooks extends BaseHooks { sprite ( input , output , spriteOptions ? ) { Maker . generate ( 'sprite' , [ input , output , spriteOptions ] ) ; } replace ( input , output , options ) { Maker . generate ( 'replace' , [ input , output , options ] ) ; } publish ( input , output , renameOptions ? ) { Maker . generate ( 'publish' , [ input , output , renameOptions ] ) ; } zip ( input = '' , output = '' , filename = 'archive.zip' ) { Maker . generate ( 'zip' , [ input , output , filename ] ) ; } ftp ( localFiles , options ? ) { Maker . generate ( 'ftp' , [ localFiles , options ] ) ; } generateSW ( pwaOptions ) { Maker . generate ( 'pwa' , [ 'generateSW' , pwaOptions ] ) ; } injectManifest ( pwaOptions ) { Maker . generate ( 'pwa' , [ 'injectManifest' , pwaOptions ] ) ; } modernizr ( ) { Maker . generate ( 'modernizr' ) ; } } export default BalmHooks ;