@loopback/docs
Version:
Documentation for LoopBack 4
1,417 lines • 551 kB
JSON
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "7.7.8",
"schemaVersion": 1003,
"oldestForwardsCompatibleVersion": 1001
},
"kind": "Package",
"canonicalReference": "@loopback/context!",
"docComment": "",
"name": "@loopback/context",
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "@loopback/context!",
"name": "",
"members": [
{
"kind": "Variable",
"canonicalReference": "@loopback/context!ANY_TAG_VALUE:var",
"docComment": "/**\n * A symbol that can be used to match binding tags by name regardless of the value.\n *\n * @example\n *\n * The following code matches bindings with tag `{controller: 'A'}` or `{controller: 'controller'}`. But if the tag name 'controller' does not exist for a binding, the binding will NOT be included.\n * ```ts\n * ctx.findByTag({controller: ANY_TAG_VALUE})\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "ANY_TAG_VALUE: "
},
{
"kind": "Content",
"text": "unique symbol"
}
],
"releaseTag": "Public",
"name": "ANY_TAG_VALUE",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!asBindingTemplate:function(1)",
"docComment": "/**\n * Convert binding scope and tags as a template function\n *\n * @param scopeAndTags - Binding scope and tags\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function asBindingTemplate(scopeAndTags: "
},
{
"kind": "Reference",
"text": "BindingScopeAndTags",
"canonicalReference": "@loopback/context!BindingScopeAndTags:type"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "BindingTemplate",
"canonicalReference": "@loopback/context!BindingTemplate:type"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "scopeAndTags",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "asBindingTemplate"
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!asClassOrProvider:function(1)",
"docComment": "/**\n * A factory function to create a template function to bind the target class as a class or `Provider`.\n *\n * @param target - Target class, which can be an implementation of `Provider`\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function asClassOrProvider(target: "
},
{
"kind": "Reference",
"text": "Constructor",
"canonicalReference": "@loopback/context!Constructor:type"
},
{
"kind": "Content",
"text": "<unknown>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "BindingTemplate",
"canonicalReference": "@loopback/context!BindingTemplate:type"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "target",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "asClassOrProvider"
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!asGlobalInterceptor:function(1)",
"docComment": "/**\n * The `BindingTemplate` function to configure a binding as a global interceptor by tagging it with `ContextTags.INTERCEPTOR`\n *\n * @param group - Group for ordering the interceptor\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function asGlobalInterceptor(group?: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "BindingTemplate",
"canonicalReference": "@loopback/context!BindingTemplate:type"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "group",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "asGlobalInterceptor"
},
{
"kind": "TypeAlias",
"canonicalReference": "@loopback/context!AsInterceptedFunction:type",
"docComment": "/**\n * The intercepted variant of a function to return `ValueOrPromise<T>`. If `T` is not a function, the type is `T`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type AsInterceptedFunction<T> = "
},
{
"kind": "Content",
"text": "T extends (...args: "
},
{
"kind": "Reference",
"text": "InvocationArgs",
"canonicalReference": "@loopback/context!InvocationArgs:type"
},
{
"kind": "Content",
"text": ") => infer R ? (...args: "
},
{
"kind": "Reference",
"text": "InvocationArgs",
"canonicalReference": "@loopback/context!InvocationArgs:type"
},
{
"kind": "Content",
"text": ") => "
},
{
"kind": "Reference",
"text": "AsValueOrPromise",
"canonicalReference": "@loopback/context!AsValueOrPromise:type"
},
{
"kind": "Content",
"text": "<R> : T"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "AsInterceptedFunction",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"typeTokenRange": {
"startIndex": 1,
"endIndex": 8
}
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!asProvider:function(1)",
"docComment": "/**\n * A factory function to create a template function to bind the target class as a `Provider`.\n *\n * @param target - Target provider class\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function asProvider(target: "
},
{
"kind": "Reference",
"text": "Constructor",
"canonicalReference": "@loopback/context!Constructor:type"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<unknown>>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "BindingTemplate",
"canonicalReference": "@loopback/context!BindingTemplate:type"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "target",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
}
],
"name": "asProvider"
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!asResolutionOptions:function(1)",
"docComment": "/**\n * Normalize ResolutionOptionsOrSession to ResolutionOptions\n *\n * @param optionsOrSession - resolution options or session\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function asResolutionOptions(optionsOrSession?: "
},
{
"kind": "Reference",
"text": "ResolutionOptionsOrSession",
"canonicalReference": "@loopback/context!ResolutionOptionsOrSession:type"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "ResolutionOptions",
"canonicalReference": "@loopback/context!ResolutionOptions:interface"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "optionsOrSession",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "asResolutionOptions"
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!assertTargetType:function(1)",
"docComment": "/**\n * Assert the target type inspected from TypeScript for injection to be the expected type. If the types don't match, an error is thrown.\n *\n * @param injection - Injection information\n *\n * @param expectedType - Expected type\n *\n * @param expectedTypeName - Name of the expected type to be used in the error\n *\n * @returns The name of the target\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function assertTargetType(injection: "
},
{
"kind": "Reference",
"text": "Readonly",
"canonicalReference": "!Readonly:type"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Injection",
"canonicalReference": "@loopback/context!Injection:interface"
},
{
"kind": "Content",
"text": ">"
},
{
"kind": "Content",
"text": ", expectedType: "
},
{
"kind": "Reference",
"text": "Function",
"canonicalReference": "!Function:interface"
},
{
"kind": "Content",
"text": ", expectedTypeName?: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 10,
"endIndex": 11
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "injection",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
},
{
"parameterName": "expectedType",
"parameterTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
}
},
{
"parameterName": "expectedTypeName",
"parameterTypeTokenRange": {
"startIndex": 8,
"endIndex": 9
}
}
],
"name": "assertTargetType"
},
{
"kind": "TypeAlias",
"canonicalReference": "@loopback/context!AsValueOrPromise:type",
"docComment": "/**\n * Create the Promise type for `T`. If `T` extends `Promise`, the type is `T`, otherwise the type is `ValueOrPromise<T>`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type AsValueOrPromise<T> = "
},
{
"kind": "Content",
"text": "T extends "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<unknown> ? T : "
},
{
"kind": "Reference",
"text": "ValueOrPromise",
"canonicalReference": "@loopback/context!ValueOrPromise:type"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "AsValueOrPromise",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"typeTokenRange": {
"startIndex": 1,
"endIndex": 6
}
},
{
"kind": "TypeAlias",
"canonicalReference": "@loopback/context!AsyncProxy:type",
"docComment": "/**\n * The proxy type for `T`. The return type for any method of `T` with original return type `R` becomes `ValueOrPromise<R>` if `R` does not extend `Promise`. Property types stay untouched.\n *\n * @example\n * ```ts\n * class MyController {\n * name: string;\n *\n * greet(name: string): string {\n * return `Hello, ${name}`;\n * }\n *\n * async hello(name: string) {\n * return `Hello, ${name}`;\n * }\n * }\n * ```\n *\n * `AsyncProxy<MyController>` will be:\n * ```ts\n * {\n * name: string; // the same as MyController\n * greet(name: string): ValueOrPromise<string>; // the return type becomes `ValueOrPromise<string>`\n * hello(name: string): Promise<string>; // the same as MyController\n * }\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type AsyncProxy<T> = "
},
{
"kind": "Content",
"text": "{\n [P in keyof T]: "
},
{
"kind": "Reference",
"text": "AsInterceptedFunction",
"canonicalReference": "@loopback/context!AsInterceptedFunction:type"
},
{
"kind": "Content",
"text": "<T[P]>;\n}"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "AsyncProxy",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"typeTokenRange": {
"startIndex": 1,
"endIndex": 4
}
},
{
"kind": "Function",
"canonicalReference": "@loopback/context!bind:function(1)",
"docComment": "/**\n * Decorate a class with binding configuration\n *\n * @param specs - A list of binding scope/tags or template functions to configure the binding\n *\n * @example\n * ```ts\n * @bind((binding) => {binding.inScope(BindingScope.SINGLETON).tag('controller')}\n * )\n * export class MyController {\n * }\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function bind(...specs: "
},
{
"kind": "Reference",
"text": "BindingSpec",
"canonicalReference": "@loopback/context!BindingSpec:type"
},
{
"kind": "Content",
"text": "[]"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "ClassDecorator",
"canonicalReference": "!ClassDecorator:type"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "specs",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "bind"
},
{
"kind": "Namespace",
"canonicalReference": "@loopback/context!bind:namespace",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare namespace bind "
}
],
"releaseTag": "Public",
"name": "bind",
"members": [
{
"kind": "Function",
"canonicalReference": "@loopback/context!bind.provider:function(1)",
"docComment": "/**\n * `@bind.provider` to denote a provider class\n *\n * A list of binding scope/tags or template functions to configure the binding\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "function provider(...specs: "
},
{
"kind": "Reference",
"text": "BindingSpec",
"canonicalReference": "@loopback/context!BindingSpec:type"
},
{
"kind": "Content",
"text": "[]"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(target: "
},
{
"kind": "Reference",
"text": "Constructor",
"canonicalReference": "@loopback/context!Constructor:type"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<unknown>>) => void"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 9
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "specs",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "provider"
}
]
},
{
"kind": "Variable",
"canonicalReference": "@loopback/context!BINDING_METADATA_KEY:var",
"docComment": "/**\n * Metadata key for binding metadata\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "BINDING_METADATA_KEY: "
},
{
"kind": "Reference",
"text": "MetadataAccessor",
"canonicalReference": "@loopback/metadata!MetadataAccessor:class"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "BindingMetadata",
"canonicalReference": "@loopback/context!BindingMetadata:type"
},
{
"kind": "Content",
"text": ", "
},
{
"kind": "Reference",
"text": "ClassDecorator",
"canonicalReference": "!ClassDecorator:type"
},
{
"kind": "Content",
"text": ">"
}
],
"releaseTag": "Public",
"name": "BINDING_METADATA_KEY",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 7
}
},
{
"kind": "Class",
"canonicalReference": "@loopback/context!Binding:class",
"docComment": "/**\n * Binding represents an entry in the `Context`. Each binding has a key and a corresponding value getter.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare class Binding<T = "
},
{
"kind": "Reference",
"text": "BoundValue",
"canonicalReference": "@loopback/context!BoundValue:type"
},
{
"kind": "Content",
"text": "> extends "
},
{
"kind": "Reference",
"text": "EventEmitter",
"canonicalReference": "!internal.EventEmitter:class"
},
{
"kind": "Content",
"text": " "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "Binding",
"members": [
{
"kind": "Constructor",
"canonicalReference": "@loopback/context!Binding:constructor(1)",
"docComment": "/**\n * Constructs a new instance of the `Binding` class\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "constructor(key: "
},
{
"kind": "Reference",
"text": "BindingAddress",
"canonicalReference": "@loopback/context!BindingAddress:type"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ", isLocked?: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ");"
}
],
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
},
{
"parameterName": "isLocked",
"parameterTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
}
}
]
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#apply:member(1)",
"docComment": "/**\n * Apply one or more template functions to set up the binding with scope, tags, and other attributes as a group.\n *\n * @param templateFns - One or more functions to configure the binding\n *\n * @example\n * ```ts\n * const serverTemplate = (binding: Binding) =>\n * binding.inScope(BindingScope.SINGLETON).tag('server');\n *\n * const serverBinding = new Binding<RestServer>('servers.RestServer1');\n * serverBinding.apply(serverTemplate);\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "apply(...templateFns: "
},
{
"kind": "Reference",
"text": "BindingTemplate",
"canonicalReference": "@loopback/context!BindingTemplate:type"
},
{
"kind": "Content",
"text": "<T>[]"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "this"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "templateFns",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "apply"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#applyDefaultScope:member(1)",
"docComment": "/**\n * Apply default scope to the binding. It only changes the scope if it's not set yet\n *\n * @param scope - Default binding scope\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "applyDefaultScope(scope: "
},
{
"kind": "Reference",
"text": "BindingScope",
"canonicalReference": "@loopback/context!BindingScope:enum"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "this"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "scope",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "applyDefaultScope"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding.bind:member(1)",
"docComment": "/**\n * A static method to create a binding so that we can do `Binding.bind('foo').to('bar');` as `new Binding('foo').to('bar')` is not easy to read.\n *\n * @param key - Binding key\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "static bind<T = "
},
{
"kind": "Content",
"text": "unknown"
},
{
"kind": "Content",
"text": ">(key: "
},
{
"kind": "Reference",
"text": "BindingAddress",
"canonicalReference": "@loopback/context!BindingAddress:type"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": true,
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 8
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "bind"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding.configure:member(1)",
"docComment": "/**\n * Create a configuration binding for the given key\n *\n * @param key - Key for the binding to be configured\n *\n * @typeParam - T Generic type for the configuration value (not the binding to be configured)\n *\n * @example\n * ```ts\n * const configBinding = Binding.configure('servers.RestServer.server1')\n * .to({port: 3000});\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "static configure<T = "
},
{
"kind": "Content",
"text": "unknown"
},
{
"kind": "Content",
"text": ">(key: "
},
{
"kind": "Reference",
"text": "BindingAddress",
"canonicalReference": "@loopback/context!BindingAddress:type"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": true,
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "configure"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#getValue:member(1)",
"docComment": "/**\n * This is an internal function optimized for performance. Users should use `@inject(key)` or `ctx.get(key)` instead.\n *\n * Get the value bound to this key. Depending on `isSync`, this function returns either: - the bound value - a promise of the bound value\n *\n * Consumers wishing to consume sync values directly should use `isPromiseLike` to check the type of the returned value to decide how to handle it.\n *\n * @param ctx - Context for the resolution\n *\n * @param session - Optional session for binding and dependency resolution\n *\n * @example\n * ```\n * const result = binding.getValue(ctx);\n * if (isPromiseLike(result)) {\n * result.then(doSomething)\n * } else {\n * doSomething(result);\n * }\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "getValue(ctx: "
},
{
"kind": "Reference",
"text": "Context",
"canonicalReference": "@loopback/context!Context:class"
},
{
"kind": "Content",
"text": ", session?: "
},
{
"kind": "Reference",
"text": "ResolutionSession",
"canonicalReference": "@loopback/context!ResolutionSession:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "ValueOrPromise",
"canonicalReference": "@loopback/context!ValueOrPromise:type"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "ctx",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "session",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"name": "getValue"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#getValue:member(2)",
"docComment": "/**\n * Returns a value or promise for this binding in the given context. The resolved value can be `undefined` if `optional` is set to `true` in `options`.\n *\n * @param ctx - Context for the resolution\n *\n * @param options - Optional options for binding and dependency resolution\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "getValue(ctx: "
},
{
"kind": "Reference",
"text": "Context",
"canonicalReference": "@loopback/context!Context:class"
},
{
"kind": "Content",
"text": ", options?: "
},
{
"kind": "Reference",
"text": "ResolutionOptions",
"canonicalReference": "@loopback/context!ResolutionOptions:interface"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "ValueOrPromise",
"canonicalReference": "@loopback/context!ValueOrPromise:type"
},
{
"kind": "Content",
"text": "<T | undefined>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "ctx",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "options",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"name": "getValue"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#inScope:member(1)",
"docComment": "/**\n * Set the binding scope\n *\n * @param scope - Binding scope\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "inScope(scope: "
},
{
"kind": "Reference",
"text": "BindingScope",
"canonicalReference": "@loopback/context!BindingScope:enum"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "this"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "scope",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "inScope"
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#inspect:member(1)",
"docComment": "/**\n * Inspect the binding to return a json representation of the binding information\n *\n * @param options - Options to control what information should be included\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "inspect(options?: "
},
{
"kind": "Reference",
"text": "BindingInspectOptions",
"canonicalReference": "@loopback/context!BindingInspectOptions:interface"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "JSONObject",
"canonicalReference": "@loopback/context!JSONObject:interface"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "options",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "inspect"
},
{
"kind": "Property",
"canonicalReference": "@loopback/context!Binding#isLocked:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "isLocked: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "isLocked",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
},
{
"kind": "Property",
"canonicalReference": "@loopback/context!Binding#key:member",
"docComment": "/**\n * Key of the binding\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "readonly key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "key",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#lock:member(1)",
"docComment": "/**\n * Lock the binding so that it cannot be rebound\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "lock(): "
},
{
"kind": "Content",
"text": "this"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [],
"name": "lock"
},
{
"kind": "Property",
"canonicalReference": "@loopback/context!Binding#providerConstructor:member",
"docComment": "/**\n * For bindings bound via `toProvider()`, this property contains the constructor function of the provider class\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "get providerConstructor(): "
},
{
"kind": "Reference",
"text": "Constructor",
"canonicalReference": "@loopback/context!Constructor:type"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<T>> | undefined"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "providerConstructor",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
},
"isStatic": false
},
{
"kind": "Property",
"canonicalReference": "@loopback/context!Binding#scope:member",
"docComment": "/**\n * Scope of the binding to control how the value is cached/shared\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "get scope(): "
},
{
"kind": "Reference",
"text": "BindingScope",
"canonicalReference": "@loopback/context!BindingScope:enum"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "scope",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
},
{
"kind": "Method",
"canonicalReference": "@loopback/context!Binding#tag:member(1)",
"docComment": "/**\n * Tag the binding with names or name/value objects. A tag has a name and an optional value. If not supplied, the tag name is used as the value.\n *\n * @param tags - A list of names or name/value objects. Each parameter can be in one of the following forms: - string: A tag name without value - string[]: A