UNPKG

@loopback/docs

Version:
2,255 lines (1,475 loc) 105 kB
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/code-themes/sl-theme.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">docs.strongloop.com</a> </div> <div id="modules"></div> </div> <div class="row"> <div class="col-lg-3 column scroll-spy-target"> <ul class="nav nav-pills nav-stacked"> <div id="versions"></div> <li class="depth-3"> <a href="#ClassDecoratorFactory">Class: ClassDecoratorFactory</a> </li> <li class="depth-4"> <a href="#116">create</a> </li> <li class="depth-4"> <a href="#118">createDecorator</a> </li> <li class="depth-3"> <a href="#DecoratorFactory">Class: DecoratorFactory</a> </li> <li class="depth-4"> <a href="#87">constructor</a> </li> <li class="depth-4"> <a href="#108">create</a> </li> <li class="depth-4"> <a href="#105">getTarget</a> </li> <li class="depth-4"> <a href="#101">withTarget</a> </li> <li class="depth-4"> <a href="#110">cloneDeep</a> </li> <li class="depth-4"> <a href="#97">getNumberOfParameters</a> </li> <li class="depth-4"> <a href="#92">getTargetName</a> </li> <li class="depth-3"> <a href="#MethodDecoratorFactory">Class: MethodDecoratorFactory</a> </li> <li class="depth-4"> <a href="#196">create</a> </li> <li class="depth-4"> <a href="#198">createDecorator</a> </li> <li class="depth-3"> <a href="#MethodParameterDecoratorFactory">Class: MethodParameterDecoratorFactory</a> </li> <li class="depth-4"> <a href="#279">create</a> </li> <li class="depth-4"> <a href="#281">createDecorator</a> </li> <li class="depth-3"> <a href="#ParameterDecoratorFactory">Class: ParameterDecoratorFactory</a> </li> <li class="depth-4"> <a href="#238">create</a> </li> <li class="depth-4"> <a href="#240">createDecorator</a> </li> <li class="depth-3"> <a href="#PropertyDecoratorFactory">Class: PropertyDecoratorFactory</a> </li> <li class="depth-4"> <a href="#156">create</a> </li> <li class="depth-4"> <a href="#158">createDecorator</a> </li> <li class="depth-3"> <a href="#DecoratorOptions">Interface: DecoratorOptions</a> </li> <li class="depth-3"> <a href="#MetadataMap">Interface: MetadataMap</a> </li> <li class="depth-3"> <a href="#DecoratorType">Type alias: DecoratorType</a> </li> <li class="depth-3"> <a href="#MetadataInspector">Class: MetadataInspector</a> </li> <li class="depth-4"> <a href="#337">defineMetadata</a> </li> <li class="depth-4"> <a href="#344">getAllMethodMetadata</a> </li> <li class="depth-4"> <a href="#370">getAllParameterMetadata</a> </li> <li class="depth-4"> <a href="#357">getAllPropertyMetadata</a> </li> <li class="depth-4"> <a href="#331">getClassMetadata</a> </li> <li class="depth-4"> <a href="#389">getDesignTypeForMethod</a> </li> <li class="depth-4"> <a href="#385">getDesignTypeForProperty</a> </li> <li class="depth-4"> <a href="#350">getMethodMetadata</a> </li> <li class="depth-4"> <a href="#377">getParameterMetadata</a> </li> <li class="depth-4"> <a href="#363">getPropertyMetadata</a> </li> <li class="depth-3"> <a href="#DesignTimeMethodMetadata">Interface: DesignTimeMethodMetadata</a> </li> <li class="depth-3"> <a href="#InspectionOptions">Interface: InspectionOptions</a> </li> <li class="depth-3"> <a href="#NamespacedReflect">Class: NamespacedReflect</a> </li> <li class="depth-4"> <a href="#3">constructor</a> </li> <li class="depth-4"> <a href="#45">decorate</a> </li> <li class="depth-4"> <a href="#6">defineMetadata</a> </li> <li class="depth-4"> <a href="#32">deleteMetadata</a> </li> <li class="depth-4"> <a href="#12">getMetadata</a> </li> <li class="depth-4"> <a href="#37">getMetadataKeys</a> </li> <li class="depth-4"> <a href="#17">getOwnMetadata</a> </li> <li class="depth-4"> <a href="#41">getOwnMetadataKeys</a> </li> <li class="depth-4"> <a href="#22">hasMetadata</a> </li> <li class="depth-4"> <a href="#27">hasOwnMetadata</a> </li> <li class="depth-4"> <a href="#61">metadata</a> </li> </ul> </div> <div class="col-lg-9 col-lg-offset-3 column" data-spy="scroll" data-target=".scroll-spy-target" data-offset="0"> <div class="readability"> <section class="code-doc "> <a name="ClassDecoratorFactory"></a> <h3 class="code-ref">Class: classdecoratorfactory = new ClassDecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Factory for class decorators</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="116"></a> <h4 class="code-ref">create() : ClassDecorator</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="118"></a> <h4 class="code-ref">createDecorator(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a class decorator function</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata object from the decorator function</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Options for the decorator</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="DecoratorFactory"></a> <h3 class="code-ref">Class: decoratorfactory = new DecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Base factory class for decorator functions</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">TARGET</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A constant to reference the target of a decoration</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="87"></a> <h4 class="code-ref">constructor(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : DecoratorFactory</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Construct a new class decorator factory</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Metadata key</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Metadata object from the decorator function</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Options for the decorator. Default to <code>{allowInheritance: true}</code> if not provided</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="108"></a> <h4 class="code-ref">create() : D</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a decorator function of the given type. Each sub class MUST implement this method.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="105"></a> <h4 class="code-ref">getTarget(spec: T) : any</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Get the optional decoration target of a given spec</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata spec</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="101"></a> <h4 class="code-ref">withTarget(spec: T, target: <a href="#Object">Object</a>) : T</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Set a reference to the target class or prototype for a given spec if it&#39;s an object</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata spec</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Target of the decoration. It is a class or the prototype of a class.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="110"></a> <h4 class="code-ref">cloneDeep(val: <a href="#Readonly">Readonly</a>) : V</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">val</strong> </td> <td class="code-arg-types"> <code><a href="#Readonly">Readonly</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Base factory class for decorator functions</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="97"></a> <h4 class="code-ref">getNumberOfParameters(target: <a href="#Object">Object</a>, member: undefined) : number</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Get the number of parameters for a given constructor or method</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Class or the prototype</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">member</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Method name</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="92"></a> <h4 class="code-ref">getTargetName(target: <a href="#Object">Object</a>, member: undefined, descriptorOrIndex: undefined) : string</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p><p>Get the qualified name of a decoration target. For example:</p></p> <pre><code>class MyClass MyClass<span class="hljs-selector-class">.constructor</span>[<span class="hljs-number">0</span>] <span class="hljs-comment">// First parameter of the constructor</span> MyClass<span class="hljs-selector-class">.myStaticProperty</span> MyClass.myStaticMethod() MyClass<span class="hljs-selector-class">.myStaticMethod</span>[<span class="hljs-number">0</span>] <span class="hljs-comment">// First parameter of the myStaticMethod</span> MyClass<span class="hljs-selector-class">.prototype</span><span class="hljs-selector-class">.myProperty</span> MyClass<span class="hljs-selector-class">.prototype</span><span class="hljs-selector-class">.myMethod</span>() MyClass<span class="hljs-selector-class">.prototype</span><span class="hljs-selector-class">.myMethod</span>[<span class="hljs-number">1</span>] <span class="hljs-comment">// Second parameter of myMethod</span> </code></pre></p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Class or prototype of a class</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">member</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Optional property/method name</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">descriptorOrIndex</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Optional method descriptor or parameter index</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="MethodDecoratorFactory"></a> <h3 class="code-ref">Class: methoddecoratorfactory = new MethodDecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Factory for method decorators</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="196"></a> <h4 class="code-ref">create() : MethodDecorator</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="198"></a> <h4 class="code-ref">createDecorator(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a method decorator function</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata object from the decorator function</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Options for the decorator</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="MethodParameterDecoratorFactory"></a> <h3 class="code-ref">Class: methodparameterdecoratorfactory = new MethodParameterDecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Factory for method level parameter decorator. For example, the following code uses <code>@param</code> to declare two parameters for <code>greet()</code>.</p> <pre><code class="lang-ts"><span class="hljs-keyword">class</span> MyController { <span class="hljs-meta">@param</span>(<span class="hljs-string">'name'</span>) <span class="hljs-comment">// Parameter 0</span> <span class="hljs-meta">@param</span>(<span class="hljs-string">'msg'</span>) <span class="hljs-comment">// Parameter 1</span> greet() {} } </code></pre> </p> <p></p> </div> </section> <section class="code-doc "> <a name="279"></a> <h4 class="code-ref">create() : MethodDecorator</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="281"></a> <h4 class="code-ref">createDecorator(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a method decorator function</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata object from the decorator function</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Options for the decorator</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="ParameterDecoratorFactory"></a> <h3 class="code-ref">Class: parameterdecoratorfactory = new ParameterDecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Factory for parameter decorators</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="238"></a> <h4 class="code-ref">create() : ParameterDecorator</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="240"></a> <h4 class="code-ref">createDecorator(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a parameter decorator function</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata object from the decorator function</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Options for the decorator</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="PropertyDecoratorFactory"></a> <h3 class="code-ref">Class: propertydecoratorfactory = new PropertyDecoratorFactory()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Factory for property decorators</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="156"></a> <h4 class="code-ref">create() : PropertyDecorator</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="158"></a> <h4 class="code-ref">createDecorator(key: string, spec: T, options: <a href="#DecoratorOptions">DecoratorOptions</a>) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Create a property decorator function</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata object from the decorator function</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#DecoratorOptions">DecoratorOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Options for the decorator</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="DecoratorOptions"></a> <h3 class="code-ref">Interface: DecoratorOptions</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Options for a decorator</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">allowInheritance</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Controls if inherited metadata will be honored. Default to <code>true</code>.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">cloneInputSpec</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Controls if the value of <code>spec</code> argument will be cloned. Sometimes we use shared spec for the decoration, but the decorator function might need to mutate the object. Cloning the input spec makes it safe to use the same spec (<code>template</code>) to decorate different members.</p> </p> <p><p>Default to <code>true</code>.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="MetadataMap"></a> <h3 class="code-ref">Interface: MetadataMap</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>An object mapping keys to corresponding metadata</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="MetadataInspector"></a> <h3 class="code-ref">Class: metadatainspector = new MetadataInspector()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Inspector for metadata applied by decorators</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">DesignTimeReflector</strong> </td> <td class="code-arg-types"> <code><a href="#NamespacedReflect">NamespacedReflect</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Expose the reflector for TypeScript design-time metadata</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">Reflector</strong> </td> <td class="code-arg-types"> <code><a href="#NamespacedReflect">NamespacedReflect</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Expose Reflector, which is a wrapper of <code>Reflect</code> and it uses <code>loopback</code> as the namespace prefix for all metadata keys</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="337"></a> <h4 class="code-ref">defineMetadata(key: string, value: T, target: <a href="#Object">Object</a>, member: undefined) : void</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Define metadata for the given target</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">value</strong> </td> <td class="code-arg-types"> <code>T</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata value</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Target for the metadata</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">member</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Optional property or method name</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="344"></a> <h4 class="code-ref">getAllMethodMetadata(key: string, target: <a href="#Object">Object</a>, options: <a href="#InspectionOptions">InspectionOptions</a>) : <a href="#MetadataMap">MetadataMap</a> | undefined</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Get the metadata associated with the given key for all methods of the target class or prototype</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Metadata key</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Class for static methods or prototype for instance methods</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong cl