import NodeVisitor from '~/ast/NodeVisitor' ; import { Compiler , CompilerConfig , PluginPhase } from '~/compiler' ; import { YaksokRoot } from '../ast' ; export default abstract class Plugin extends NodeVisitor { compiler : Compiler | null = null ; abstract phase : PluginPhase ; async run ( astRoot , config ) ; async run ( astRoot , config ) ; async run ( astRoot , config ) { await this . init ( ) ; if ( astRoot != null ) { await this . visit ( astRoot ) ; } return null ; } }