@lppedd/di-wise-neo 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,11 +112,23 @@ type Tokens<Value> = [Token<Value>, ...Token<Value>[]];
112
112
  */
113
113
  declare function createType<T>(debugName: string): Type<T>;
114
114
  /**
115
- * Creates a type token with a default {@link Provider} and optional default registration options.
115
+ * Creates a type token with a default {@link ClassProvider} and optional default registration options.
116
+ *
117
+ * Example:
118
+ * ```ts
119
+ * const ISpell = createType<Spell>("Spell", {
120
+ * useClass: DefaultSpell,
121
+ * });
122
+ *
123
+ * container.register(ISpell);
124
+ * ```
125
+ */
126
+ declare function createType<T extends object>(debugName: string, provider: ClassProvider<T>, options?: RegistrationOptions): ProviderType<T>;
127
+ /**
128
+ * Creates a type token with a default {@link FactoryProvider} and optional default registration options.
116
129
  *
117
130
  * Example:
118
131
  * ```ts
119
- * // Notice how we pass in a Provider directly at type creation site
120
132
  * const ISpell = createType<Spell>("Spell", {
121
133
  * useFactory: () => getDefaultSpell(),
122
134
  * });
@@ -124,7 +136,34 @@ declare function createType<T>(debugName: string): Type<T>;
124
136
  * container.register(ISpell);
125
137
  * ```
126
138
  */
127
- declare function createType<T>(debugName: string, provider: Provider<T>, options?: RegistrationOptions): ProviderType<T>;
139
+ declare function createType<T>(debugName: string, provider: FactoryProvider<T>, options?: RegistrationOptions): ProviderType<T>;
140
+ /**
141
+ * Creates a type token with a default {@link ValueProvider} and optional default registration options.
142
+ *
143
+ * Example:
144
+ * ```ts
145
+ * const defaultSpell = getDefaultSpell();
146
+ * const ISpell = createType<Spell>("Spell", {
147
+ * useValue: defaultSpell,
148
+ * });
149
+ *
150
+ * container.register(ISpell);
151
+ * ```
152
+ */
153
+ declare function createType<T>(debugName: string, provider: ValueProvider<T>, options?: RegistrationOptions): ProviderType<T>;
154
+ /**
155
+ * Creates a type token with a default {@link ExistingProvider} and optional default registration options.
156
+ *
157
+ * Example:
158
+ * ```ts
159
+ * const ISpell = createType<Spell>("Spell", {
160
+ * useExisting: IBaseSpell,
161
+ * });
162
+ *
163
+ * container.register(ISpell);
164
+ * ```
165
+ */
166
+ declare function createType<T>(debugName: string, provider: ExistingProvider<T>, options?: RegistrationOptions): ProviderType<T>;
128
167
 
129
168
  interface ClassRef<Instance extends object> {
130
169
  readonly getRefClass: () => Constructor<Instance>;