UNPKG

@loopback/docs

Version:

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

258 lines (117 loc) 3.68 kB
--- lang: en title: 'API docs: context.bindingkey' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context permalink: /doc/en/lb4/apidocs.context.bindingkey.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [BindingKey](./context.bindingkey.md) ## BindingKey class **Signature:** ```typescript export declare class BindingKey<ValueType> ``` ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> [CONFIG\_NAMESPACE](./context.bindingkey.config_namespace.md) </td><td markdown="1"> `static` </td><td markdown="1"> string </td><td markdown="1"> Name space for configuration binding keys </td></tr> <tr><td markdown="1"> [key](./context.bindingkey.key.md) </td><td markdown="1"> `readonly` </td><td markdown="1"> string </td><td markdown="1"> </td></tr> <tr><td markdown="1"> [PROPERTY\_SEPARATOR](./context.bindingkey.property_separator.md) </td><td markdown="1"> `static` `readonly` </td><td markdown="1"> (not declared) </td><td markdown="1"> </td></tr> <tr><td markdown="1"> [propertyPath?](./context.bindingkey.propertypath.md) </td><td markdown="1"> `readonly` </td><td markdown="1"> string \| undefined </td><td markdown="1"> _(Optional)_ </td></tr> </tbody></table> ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> [buildKeyForConfig(key)](./context.bindingkey.buildkeyforconfig.md) </td><td markdown="1"> `static` </td><td markdown="1"> Build a binding key for the configuration of the given binding. The format is `<key>:$config` </td></tr> <tr><td markdown="1"> [create(key, propertyPath)](./context.bindingkey.create.md) </td><td markdown="1"> `static` </td><td markdown="1"> Create a new key for a binding bound to a value of type `ValueType`<!-- -->. </td></tr> <tr><td markdown="1"> [deepProperty(propertyPath)](./context.bindingkey.deepproperty.md) </td><td markdown="1"> </td><td markdown="1"> Get a binding address for retrieving a deep property of the object bound to the current binding key. </td></tr> <tr><td markdown="1"> [generate(namespace)](./context.bindingkey.generate.md) </td><td markdown="1"> `static` </td><td markdown="1"> Generate a universally unique binding key. Please note the format of they generated key is not specified, you must not rely on any specific formatting (e.g. UUID style). </td></tr> <tr><td markdown="1"> [parseKeyWithPath(keyWithPath)](./context.bindingkey.parsekeywithpath.md) </td><td markdown="1"> `static` </td><td markdown="1"> Parse a string containing both the binding key and the path to the deeply nested property to retrieve. </td></tr> <tr><td markdown="1"> [toString()](./context.bindingkey.tostring.md) </td><td markdown="1"> </td><td markdown="1"> </td></tr> <tr><td markdown="1"> [validate(key)](./context.bindingkey.validate.md) </td><td markdown="1"> `static` </td><td markdown="1"> Validate the binding key format. Please note that `#` is reserved. Returns a string representation of the binding key. </td></tr> </tbody></table>