UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

97 lines (48 loc) 1.68 kB
--- lang: en title: 'API docs: metadata.methodparameterdecoratorfactory.createdecorator' 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.methodparameterdecoratorfactory.createdecorator.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [MethodParameterDecoratorFactory](./metadata.methodparameterdecoratorfactory.md) &gt; [createDecorator](./metadata.methodparameterdecoratorfactory.createdecorator.md) ## MethodParameterDecoratorFactory.createDecorator() method Create a method decorator function **Signature:** ```typescript static createDecorator<S>(key: MetadataKey<S, MethodDecorator>, spec: S, options?: DecoratorOptions): MethodDecorator; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> key </td><td markdown="1"> [MetadataKey](./metadata.metadatakey.md)<!-- -->&lt;S, MethodDecorator&gt; </td><td markdown="1"> Metadata key </td></tr> <tr><td markdown="1"> spec </td><td markdown="1"> S </td><td markdown="1"> Metadata object from the decorator function </td></tr> <tr><td markdown="1"> options </td><td markdown="1"> [DecoratorOptions](./metadata.decoratoroptions.md) </td><td markdown="1"> _(Optional)_ Options for the decorator </td></tr> </tbody></table> **Returns:** MethodDecorator