Page Contents

Home > @loopback/metadata > DesignTimeMethodMetadata

DesignTimeMethodMetadata interface

Design time metadata for a method.

Signature:

export interface DesignTimeMethodMetadata 

Example

class MyController
{
  myMethod(x: string, y: number, z: MyClass): boolean {
    // ...
    return true;
  }
}

The myMethod above has design-time metadata as follows:

{
  type: Function,
  parameterTypes: [String, Number, MyClass],
  returnType: Boolean
}

Properties

Property Modifiers Type Description
[parameterTypes](/doc/en/lb4/apidocs.metadata.designtimemethodmetadata.parametertypes.html) Function\[\] An array of parameter types.
[returnType](/doc/en/lb4/apidocs.metadata.designtimemethodmetadata.returntype.html) Function \| undefined Return type, may be `undefined` (e.g. for constructors).
[type](/doc/en/lb4/apidocs.metadata.designtimemethodmetadata.type.html) Function \| undefined Type of the method itself. It is `Function` for methods, `undefined` for the constructor.