Creates a type token with a default ClassProvider and optional default registration options.
Example:
const ISpell = createType<Spell>("Spell", {
useClass: DefaultSpell,
});
container.register(ISpell);
Optionaloptions: RegistrationOptionsCreates a type token with a default FactoryProvider and optional default registration options.
Example:
const ISpell = createType<Spell>("Spell", {
useFactory: () => getDefaultSpell(),
});
container.register(ISpell);
Optionaloptions: RegistrationOptionsCreates a type token with a default ValueProvider and optional default registration options.
Example:
const defaultSpell = getDefaultSpell();
const ISpell = createType<Spell>("Spell", {
useValue: defaultSpell,
});
container.register(ISpell);
Optionaloptions: RegistrationOptionsCreates a type token with a default ExistingProvider and optional default registration options.
Example:
const ISpell = createType<Spell>("Spell", {
useExisting: IBaseSpell,
});
container.register(ISpell);
Optionaloptions: RegistrationOptions
Creates a type token.
Example: