import { Config$ } from "../config" ; import { paths , Path$ } from "../path" ; export interface Context$ { readonly env : NodeJS . ProcessEnv ; config : any ; options : Config$ ; paths : Path$ ; } let haveInit = false ; export default class Context implements Context$ { config : any = { } ; options : Config$ = { } ; paths : Path$ = paths ; constructor ( ) { if ( haveInit ) { throw new Error ( "The context have been init, please inject instead of new Context()" ) ; } else { haveInit = true ; } } get env ( ) : NodeJS . ProcessEnv { return process . env ; } }