import { IPlugin } from "./i-plugin" ; import { AppletType } from "../type/applet-type" ; author CaMnter
  abstract class BasePlugin implements IPlugin { protected readonly _target : AppletType ; protected readonly _expect : AppletType ; protected _result : string | undefined ; private _plugins : Array < IPlugin > = [ ] ; protected constructor ( target , expect ) { if ( ! target ) { throw new Error ( `BasePlugin # constructor #「target」error: ${ target }` ) ; } if ( ! expect ) { throw new Error ( `BasePlugin # constructor #「expect」error: ${ expect }` ) ; } this . _target = target ; this . _expect = expect ; } abstract run ( code ) ; public get plugins ( ) : Array < IPlugin > { return this . _plugins ; } public set plugins ( value ) { this . _plugins = value ; } get target ( ) : AppletType { return this . _target ; } get expect ( ) : AppletType { return this . _expect ; } get result ( ) : string | undefined { return this . _result ; } } export default BasePlugin ;