OptionalconfigOptional validation schema for runtime config validation. When provided, resource config will be validated when .with() is called.
OptionalcontextCreate a private, mutable context shared between init and dispose.
OptionaldependenciesStatic or lazy dependency map. Receives config when provided.
OptionaldisposeClean-up function for the resource. This is called when the resource is no longer needed.
The value of the resource (undefined if no init method)
The configuration it received
The dependencies it needed
Promise
Stable identifier.
OptionalinitInitialize and return the resource value. Called once during boot.
OptionalmetaMiddleware applied around init/dispose.
Return an optional dependency wrapper for this resource.
Safe overrides to swap behavior while preserving identities. See README: Overrides.
Register other registerables (resources/tasks/middleware/events). Accepts a
static array or a function of config to support dynamic wiring.
OptionalresultOptional validation schema for the resource's resolved value.
When provided, the value will be validated immediately after init resolves,
without considering middleware.
This is optional and used from an index resource to get the correct caller. This is the reason we allow it here as well.