Skip to content

ServiceKey

Defined in: EngineContext.ts:39

A typed key for service registration and resolution.

Keys are identified by their id string, not by object identity. A package may re-declare an id for the same service contract to avoid an optional runtime dependency; keep an owner comment beside each repeated declaration.

T

new ServiceKey<T>(id, options?): ServiceKey<T>

Defined in: EngineContext.ts:45

string

String identifier used for registration and resolution.

ServiceKeyOptions

ServiceKey<T>

readonly _type: T

Defined in: EngineContext.ts:55

Phantom field to preserve the generic type.


readonly id: string

Defined in: EngineContext.ts:47

String identifier used for registration and resolution.


readonly missingHint: string | undefined

Defined in: EngineContext.ts:43

Appended to the error thrown when the key resolves nowhere.


readonly scope: ServiceScope

Defined in: EngineContext.ts:41

Declared scope (engine or scene). Defaults to "engine".

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.