---
title: "Référence d'API — nodefony — kernel-injector"
source: docs/api/core/kernel-injector.md
url: https://nodefony.github.io/nodefony-core/docs/api/core/kernel-injector/
---


[Documentation](../../../) › [Référence d'API](../../) › [`nodefony`](../) › kernel-injector

> Générée depuis les déclarations de types publiées de `nodefony` **10.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`

```ts
class Injector extends Service
```

- `static injectables: Partial<Record<string, ServiceConstructor>>`
- `constructor(kernel: Kernel)`
- `static register(serviceName: string, service: ServiceConstructor): ServiceConstructor`
- `static isRegistered(serviceName: string): boolean`
- `static 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, ou `null` si elle n'a jamais été posée au container (rien à apprendre encore).
- `static getScope(serviceName: string): DIScope`
- `static 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): ServiceConstructor`
- `static inject<T extends Service = Service>(service: ServiceConstructor, ...args: unknown[]): T`
- `instantiate<T extends Service = Service>(constructor: ServiceConstructor, ...args: unknown[]): T`
- `static instantiate<T extends Service = Service>(constructor: ServiceConstructor, ...argsClass: unknown[]): T`
- `static assertNoCaptiveDependency(root: ServiceConstructor): void` — Refuse AU DÉMARRAGE toute dépendance captive atteignable depuis `root` : un singleton du graphe de dépendances déclarées — `root` compris — qui détient un service `request`, directement ou à travers d …
- `reflect<T extends Service = Service>(constructor: ServiceConstructor, ...args: unknown[]): T`

### Interfaces (1)

#### `InjectableOptions`

```ts
interface InjectableOptions
```

- `name?: string`
- `scope?: DIScope`

### Types (1)

#### `DIScope`

```ts
type DIScope = "singleton" | "transient" | "request"
```

Durée de vie d'un service injectable.

---

[← Toutes les références d'API](../../)
