wirestate-core
Framework-agnostic Wirestate APIs for containers, services, lifecycle, messaging, and dependency injection.
Bind
| Name | Description |
|---|---|
| InjectionToken | Typed reference token for dependencies stored in a container. |
| FactoryBindingDescriptor | Describes a token-bound value produced by a factory function. |
| InstanceBindingDescriptor | Describes a token-bound service instance constructed from an injectable class. |
| ValueBindingDescriptor | Describes a token-bound value stored directly in the container. |
| Binding | Binding entry accepted by container registration APIs. |
| BindingDescriptor | Descriptor object that binds a token to a value, class, or factory strategy. |
| BindingScopeValue | Binding lifetime scope name. |
| BindingTypeValue | Binding strategy name. |
| BindingScope | Lifetime scope names accepted by binding descriptors: |
| BindingType | Binding strategy names accepted by binding descriptors. |
Commands
| Name | Description |
|---|---|
| CommandBus | Dispatches commands to the active handler for each command type. |
| CommandDispatchOptions | Per-dispatch options for CommandBus.execute and CommandBus.executeAsync. |
| OnCommandDecorator | Describes the decorator returned by OnCommand. |
| CommandHandler | Handles a dispatched command payload and returns the command result. |
| CommandType | Identifies one imperative message handled by a command handler. |
| CommandUnregister | Removes one command handler registration. |
| OnCommand | Marks an injectable service method as a provision-scoped command handler. |
Container
| Name | Description |
|---|---|
| Container | Dependency injection container for one Wirestate scope. |
| ContainerConfig | Defines one Container scope at construction time. |
| InjectableDecorator | Describes the decorator returned by Injectable. |
| ServiceToken | Token accepted by container lookup and injection APIs. |
| inject | Resolves a dependency from the container currently constructing a service. |
| Injectable | Marks a class as eligible for Wirestate instance bindings. |
| isInjectable | Checks whether a class was directly marked with Injectable. |
| validateContainerConfig | Validates container construction config without creating a container. |
Error
| Name | Description |
|---|---|
| WirestateError | Error type thrown for expected Wirestate API failures. |
| InternalErrorDescriptor | Describes an isolated failure reported through a container error handler. |
| InternalErrorHandler | Handles isolated Wirestate errors for a container. |
| InternalErrorSource | - |
| defaultInternalErrorHandler | Reports isolated Wirestate errors to console.error. |
Events
| Name | Description |
|---|---|
| EventBus | Broadcasts events to every subscriber registered on one container bus. |
| EventEmitOptions | Options for emitting an event. |
| OnEventDecorator | Describes the decorator returned by OnEvent. |
| WireEvent | Event delivered to handlers: its type, optional payload, and optional source. |
| EventHandler | Receives an emitted event from the bus. |
| EventType | Identifies an event for emitting and subscribing. |
| EventUnsubscribe | Removes the event subscription it was returned for. |
| OnEvent | Marks an injectable service method as a provision-scoped event handler. |
General Types
| Name | Description |
|---|---|
| AbstractClass | Abstract class reference that cannot be constructed directly, but can serve as a binding token. |
| Newable | Constructor type for a concrete class Wirestate can instantiate. |
Lifecycle
| Name | Description |
|---|---|
| WireStatus | Lifecycle status for one resolved service instance. |
| LifecycleDecorator | Method decorator returned by the single-method lifecycle hooks: @OnActivation, @OnDeactivation, @OnProvision, and @OnDeprovision. |
| ProvisionId | Numeric ID for one provider provision cycle of a service instance. |
| OnActivation | Runs an instance method after container activation completes. |
| OnDeactivation | Runs an instance method during container deactivation. |
| OnDeprovision | Runs before a framework provider stops exposing the container. |
| OnProvision | Runs when a framework provider exposes the container. |
Plugins
| Name | Description |
|---|---|
| CommandsPlugin | Enables command messaging on a container. |
| EventsPlugin | Enables event messaging on a container. |
| QueriesPlugin | Enables query messaging on a container. |
| WirestatePlugin | A container lifecycle plugin. |
Queries
| Name | Description |
|---|---|
| QueryBus | Dispatches queries to the active handler for each query type. |
| OnQueryDecorator | Describes the decorator returned by OnQuery. |
| QueryDispatchOptions | Per-dispatch options for QueryBus.query and QueryBus.queryAsync. |
| QueryHandler | Answers a dispatched query payload and returns the query result. |
| QueryType | Identifies one read-oriented message handled by a query handler. |
| QueryUnregister | Removes one query handler registration. |
| OnQuery | Marks an injectable service method as a provision-scoped query handler. |