Référence d'API — nodefony — kernel-injector
stable
Documentation › Référence d’API › nodefony › kernel-injector
Générée depuis les déclarations de types publiées de
nodefony10.0.0-beta.5 : exactement ce que reçoit une application qui l’installe. Cette page n’existe dans aucun dépôt — pour la corriger, on corrige le TSDoc du code.
nodefony#
import { … } from "nodefony" — 3 symboles.
Classes (1)#
Injector#
class Injector extends Service
static injectables: Partial<Record<string, ServiceConstructor>>constructor(kernel: Kernel)static register(serviceName: string, service: ServiceConstructor): ServiceConstructorstatic isRegistered(serviceName: string): booleanstatic rememberContainerKey(service: ServiceConstructor, containerKey: string): void— Mémorise la clé sous laquelle une classe de service vit RÉELLEMENT dans le container — apprise au moment où l’instance y est posée.static containerKeyOf(service: ServiceConstructor): string | null— Clé container connue d’une classe de service, ounullsi elle n’a jamais été posée au container (rien à apprendre encore).static getScope(serviceName: string): DIScopestatic dependencyNamesOf(service: ServiceConstructor): string[]— Noms des services dont un constructeur dépend : ceux déclarés par@Inject("nom"), dans l’ordre des paramètres.static scopeOf(service: ServiceConstructor): DIScope— Portée DÉCLARÉE d’une classe par@injectable({ scope })—"singleton"si elle n’en déclare aucune.static get(serviceName: string): ServiceConstructorstatic inject<T extends Service = Service>(service: ServiceConstructor, ...args: unknown[]): Tinstantiate<T extends Service = Service>(constructor: ServiceConstructor, ...args: unknown[]): Tstatic instantiate<T extends Service = Service>(constructor: ServiceConstructor, ...argsClass: unknown[]): Tstatic assertNoCaptiveDependency(root: ServiceConstructor): void— Refuse AU DÉMARRAGE toute dépendance captive atteignable depuisroot: un singleton du graphe de dépendances déclarées —rootcompris — qui détient un servicerequest, directement ou à travers d …reflect<T extends Service = Service>(constructor: ServiceConstructor, ...args: unknown[]): T
Interfaces (1)#
InjectableOptions#
interface InjectableOptions
name?: stringscope?: DIScope
Types (1)#
DIScope#
type DIScope = "singleton" | "transient" | "request"
Durée de vie d’un service injectable.