Page Contents

Home > @loopback/core

core package



Class Description
Application Application is the container for various types of artifacts, such as components, servers, controllers, repositories, datasources, connectors, and models.
LifeCycleObserverRegistry A context-based registry for life cycle observers


Function Description
addExtension(context, extensionPointName, extensionClass, options) Register an extension for the given extension point to the context
asLifeCycleObserver(binding) A BindingTemplate function to configure the binding as life cycle observer by tagging it with CoreTags.LIFE_CYCLE_OBSERVER.
extensionFilter(extensionPointName) A factory function to create binding filter for extensions of a named extension point
extensionFor(extensionPointName) A factory function to create binding template for extensions of the given extension point
extensionPoint(name, specs) Decorate a class as a named extension point. If the decoration is not present, the name of the class will be used.
extensions(extensionPointName) Shortcut to inject extensions for the given extension point.
isLifeCycleObserver(obj) Test if an object implements LifeCycleObserver
isLifeCycleObserverClass(ctor) Test if a class implements LifeCycleObserver
lifeCycleObserver(group, specs) Sugar decorator to mark a class as life cycle observer
lifeCycleObserverFilter(binding) Find all life cycle observer bindings. By default, a binding tagged with CoreTags.LIFE_CYCLE_OBSERVER. It’s used as BindingFilter.
mountComponent(app, component) Mount a component to an Application.


Interface Description
ApplicationConfig Configuration for application
ApplicationMetadata Type description for package.json
ClassMap A map of classes to be bound to a context
Component A component declares a set of artifacts so that they cane be contributed to an application as a group
LifeCycleObserver Observers to handle life cycle start/stop events
ProviderMap A map of provider classes to be bound to a context
Server Defines the requirements to implement a Server for LoopBack applications: start() : Promise stop() : Promise It is recommended that each Server implementation creates its own child Context, which inherits from the parent Application context. This way, any Server-specific bindings will remain local to the Server instance, and will avoid polluting its parent module scope.


Namespace Description
CoreBindings Namespace for core binding keys


Variable Description

Type Aliases

Type Alias Description
JSONPrimitive Type definition for JSON
LifeCycleObserverGroup A group of life cycle observers