@loopback/docs
Version:
Documentation for LoopBack 4
50 lines (37 loc) • 3.44 kB
Markdown
---
lang: en
title: 'API docs: context.resolutionsession'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.resolutionsession.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ResolutionSession](./context.resolutionsession.md)
## ResolutionSession class
Object to keep states for a session to resolve bindings and their dependencies within a context
<b>Signature:</b>
```typescript
export declare class ResolutionSession
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [bindingStack](./context.resolutionsession.bindingstack.md) | | <code>Readonly<Binding>[]</code> | Getter for bindings on the stack |
| [currentBinding](./context.resolutionsession.currentbinding.md) | | <code>Readonly<Binding> | undefined</code> | Getter for the current binding |
| [currentInjection](./context.resolutionsession.currentinjection.md) | | <code>Readonly<Injection> | undefined</code> | Getter for the current injection |
| [injectionStack](./context.resolutionsession.injectionstack.md) | | <code>Readonly<Injection>[]</code> | Getter for injections on the stack |
| [stack](./context.resolutionsession.stack.md) | | <code>ResolutionElement[]</code> | A stack of bindings for the current resolution session. It's used to track the path of dependency resolution and detect circular dependencies. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [describeInjection(injection)](./context.resolutionsession.describeinjection.md) | <code>static</code> | Describe the injection for debugging purpose |
| [fork(session)](./context.resolutionsession.fork.md) | <code>static</code> | Fork the current session so that a new one with the same stack can be used in parallel or future resolutions, such as multiple method arguments, multiple properties, or a getter function |
| [getBindingPath()](./context.resolutionsession.getbindingpath.md) | | Get the binding path as <code>bindingA --> bindingB --> bindingC</code>. |
| [getInjectionPath()](./context.resolutionsession.getinjectionpath.md) | | Get the injection path as <code>injectionA --> injectionB --> injectionC</code>. |
| [getResolutionPath()](./context.resolutionsession.getresolutionpath.md) | | Get the resolution path including bindings and injections, for example: <code>bindingA --> @ClassA[0] --> bindingB --> @ClassB.prototype.prop1 --> bindingC</code>. |
| [popBinding()](./context.resolutionsession.popbinding.md) | | Exit the resolution of a binding |
| [popInjection()](./context.resolutionsession.popinjection.md) | | Pop the last injection |
| [pushBinding(binding)](./context.resolutionsession.pushbinding.md) | | Enter the resolution of the given binding. If |
| [pushInjection(injection)](./context.resolutionsession.pushinjection.md) | | Push the injection onto the session |
| [runWithBinding(action, binding, session)](./context.resolutionsession.runwithbinding.md) | <code>static</code> | Run the given action with the given binding and session |
| [runWithInjection(action, injection, session)](./context.resolutionsession.runwithinjection.md) | <code>static</code> | Run the given action with the given injection and session |