Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awilix 10 type exposure #352

Closed
radahh-rest opened this issue Jan 10, 2024 · 1 comment
Closed

Awilix 10 type exposure #352

radahh-rest opened this issue Jan 10, 2024 · 1 comment

Comments

@radahh-rest
Copy link

Awilix 10 through #349 has reduced the export surface, including types. Our code base used the Resolver<T> type to propogate type checks into our abstraction layer.

Minimal example:

export type Dependencies = {
  [K: string]: Resolver<any>;
};

const container: Dependencies = {
  goodStringValue: asValue('test'),
  goodNumberValue: asValue(1),
  goodStringFunction: asFunction(() => 'test'),
  badRegistration: 'chicken',
};

causing Type 'string' is not assignable to type 'Resolver<any>'.ts(2322)

image

Short-term we are cheating with

import type { Resolver } from 'awilix/lib/resolvers.js';

Are we doing it 'wrong'? Is there an alternate type that's exported for us to use?

@jeffijoe
Copy link
Owner

Hey @radahh-rest, I released 10.0.1 (#351) which re-adds back a bunch of them. That was an oversight on my part when I reviewed the PR which trimmed them down, apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants