import { interfaces } from "../interfaces/interfaces" ; import { id } from "../utils/id" ; class Request implements interfaces . Request { public id : number ; public serviceIdentifier : interfaces . ServiceIdentifier ; public parentContext : interfaces . Context ; public parentRequest : interfaces . Request | null ; public bindings : interfaces . Binding < unknown > [ ] ; public childRequests : interfaces . Request [ ] ; public target : interfaces . Target ; public requestScope : interfaces . RequestScope | null ; public constructor ( serviceIdentifier , parentContext , parentRequest , bindings , target ) { this . id = id ( ) ; this . serviceIdentifier = serviceIdentifier ; this . parentContext = parentContext ; this . parentRequest = parentRequest ; this . target = target ; this . childRequests = [ ] ; this . bindings = ( Array . isArray ( bindings ) ? bindings : [ bindings ] ) ; this . requestScope = parentRequest === null ? new Map ( ) : null ; } public addChildRequest ( serviceIdentifier , bindings , target ) { const child = new Request ( serviceIdentifier , this . parentContext , this , bindings , target ) ; this . childRequests . push ( child ) ; return child ; } } export { Request } ;