ServiceDefinition
interface exported by @mwillbanks/tuil-core.
interface
Public interface exported by @mwillbanks/tuil-core.
export interface ServiceDefinition<
TId extends string = string,
TValue = unknown,
> {
readonly id: TId;
readonly create: (context: ServiceFactoryContext) => TValue | Promise<TValue>;
readonly dispose?: (value: TValue) => void | Promise<void>;
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
id | TId | Yes | The id member uses the TId contract. | — |
create | (context: ServiceFactoryContext) => TValue | Promise<TValue> | Yes | The create member uses the (context: ServiceFactoryContext) => TValue | Promise<TValue> contract. | ServiceFactoryContext |
dispose | ((value: TValue) => void | Promise<void>) | undefined | No | The dispose member uses the ((value: TValue) => void | Promise<void>) | undefined contract. | — |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
Source
View the secondary source reference