tuil
ReferencePackages@mwillbanks/tuil-coreAPI

ServiceDefinition

interface exported by @mwillbanks/tuil-core.

View rawEdit

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

MemberTypeRequiredDescriptionRelated types
idTIdYesThe id member uses the TId contract.
create(context: ServiceFactoryContext) => TValue | Promise<TValue>YesThe create member uses the (context: ServiceFactoryContext) => TValue | Promise<TValue> contract.ServiceFactoryContext
dispose((value: TValue) => void | Promise<void>) | undefinedNoThe 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.

Source

View the secondary source reference

Package

@mwillbanks/tuil-core

On this page