@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
129 lines (69 loc) • 2.01 kB
Markdown
---
lang: en
title: 'API docs: metadata.designtimemethodmetadata'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata
permalink: /doc/en/lb4/apidocs.metadata.designtimemethodmetadata.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/metadata](./metadata.md) > [DesignTimeMethodMetadata](./metadata.designtimemethodmetadata.md)
## DesignTimeMethodMetadata interface
Design time metadata for a method.
**Signature:**
```typescript
export interface DesignTimeMethodMetadata
```
## Example
```ts
class MyController
{
myMethod(x: string, y: number, z: MyClass): boolean {
// ...
return true;
}
}
```
The `myMethod` above has design-time metadata as follows:
```ts
{
type: Function,
parameterTypes: [String, Number, MyClass],
returnType: Boolean
}
```
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[parameterTypes](./metadata.designtimemethodmetadata.parametertypes.md)
</td><td markdown="1">
</td><td markdown="1">
Function\[\]
</td><td markdown="1">
An array of parameter types.
</td></tr>
<tr><td markdown="1">
[returnType](./metadata.designtimemethodmetadata.returntype.md)
</td><td markdown="1">
</td><td markdown="1">
Function \| undefined
</td><td markdown="1">
Return type, may be `undefined` (e.g. for constructors).
</td></tr>
<tr><td markdown="1">
[type](./metadata.designtimemethodmetadata.type.md)
</td><td markdown="1">
</td><td markdown="1">
Function \| undefined
</td><td markdown="1">
Type of the method itself. It is `Function` for methods, `undefined` for the constructor.
</td></tr>
</tbody></table>