Skip to content

Commit

Permalink
fix(contrib/es): stop double-wrapping generic TInstance
Browse files Browse the repository at this point in the history
Change the types to stop expecting the options to be
of type ServiceOptions<Constructable<Constructable<T>>,
as most users don't want to wrap constructables twice
(lame, right).
  • Loading branch information
freshgum-bubbles committed Aug 12, 2024
1 parent 788399b commit b69ceb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/contrib/es/es-service.decorator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function ESService<TInstance = unknown, TClass extends Constructable<TIns
* @returns A decorator which is then used upon a class.
*/
export function ESService<TInstance = unknown, TClass extends Constructable<TInstance> = Constructable<TInstance>>(
options: Omit<ServiceOptions<TClass>, 'dependencies'>,
options: Omit<ServiceOptions<TInstance>, 'dependencies'>,
dependencies: AnyServiceDependency[]
): ESClassDecorator<TClass>;

Expand Down Expand Up @@ -118,11 +118,11 @@ export function ESService<TInstance = unknown, TClass extends Constructable<TIns
* @returns A decorator which is then used upon a class.
*/
export function ESService<TInstance = unknown, TClass extends Constructable<TInstance> = Constructable<TInstance>>(
options: ServiceOptionsWithDependencies<Constructable<unknown>>
options: ServiceOptionsWithDependencies<TInstance>
): ESClassDecorator<TClass>;

export function ESService<TInstance = unknown, TClass extends Constructable<TInstance> = Constructable<TInstance>>(
optionsOrDependencies: Omit<ServiceOptions<TClass>, 'dependencies'> | ServiceOptions<TClass> | AnyServiceDependency[],
optionsOrDependencies: Omit<ServiceOptions<TInstance>, 'dependencies'> | ServiceOptions<TInstance> | AnyServiceDependency[],
maybeDependencies?: AnyServiceDependency[]
): ESClassDecorator<TClass> {
return (target: TClass, context: ClassDecoratorContext) => {
Expand Down

0 comments on commit b69ceb1

Please sign in to comment.