import { getUserFunctionUsage } from "../../vscodeIntegration/signatureFormatting" ; import { ExpressionType } from "./ExpressionType" ; import { FunctionBehaviors , IFunctionMetadata , IFunctionParameterMetadata } from "./IFunctionMetadata" ; import { UserFunctionDefinition } from "./UserFunctionDefinition" ; /**
 * This class represents information about a user-defined function (name, arguments, return type, etc)
 */ export class UserFunctionMetadata implements IFunctionMetadata { constructor ( public readonly fullName , public readonly unqualifiedName , public readonly usage , public readonly description , public readonly parameters , public readonly returnType , public readonly returnValueMembers ) { this . minimumArguments = this . maximumArguments = parameters . length ; } public readonly minimumArguments : number ; public readonly maximumArguments : number ; public static fromDefinition ( func ) { return new UserFunctionMetadata ( func . fullName , func . nameValue . unquotedValue , getUserFunctionUsage ( func , true ) , "User-defined function" , func . parameterDefinitions . map ( pd => < IFunctionParameterMetadata > { name : pd . nameValue . unquotedValue , type : pd . validType } ) , func . output && func . output . validOutputType , [ ] ) ; } public hasBehavior ( behavior ) { return false ; } }