import { IFunctionParameter } from '@/application/Parser/Script/Compiler/Function/Parameter/IFunctionParameter' ; import { IFunctionParameterCollection } from '@/application/Parser/Script/Compiler/Function/Parameter/IFunctionParameterCollection' ; import { FunctionParameterStub } from './FunctionParameterStub' ; export class FunctionParameterCollectionStub implements IFunctionParameterCollection { private parameters = new Array < IFunctionParameter > ( ) ; public addParameter ( parameter ) { this . parameters . push ( parameter ) ; } public get all ( ) : readonly IFunctionParameter [ ] { return this . parameters ; } public withParameterName ( parameterName , isOptional = true ) { const parameter = new FunctionParameterStub ( ) . withName ( parameterName ) . withOptionality ( isOptional ) ; this . addParameter ( parameter ) ; return this ; } public withParameterNames ( parameterNames , isOptional = true ) { for ( const parameterName of parameterNames ) { this . withParameterName ( parameterName , isOptional ) ; } return this ; } }