-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merge context type declarations for wrappers #70
Comments
that's ok for me. but maybe call the namespace just also see:
|
agreed, that makes sense
since this isn't something a client would wrap, would there be anywhere other than the Admin codebase that we could an index signature of
these seem like wrappers, I can open PRs to add their types |
added in #71 |
Right now using universal in Typescript means you need to manually set
main()
's parameter types. This is expected, not much we can do about it, but the pain point is when you're using wrappers that extend the context.This works great:
This doesn't:
Ignoring the last line which has its own type errors, the context doesn't "know" about the logger wrapper. Workaround could be to import each context and make a custom interface merging them, but that would be repeated every time it's used.
The
context
APIs seem pretty useful to expose, so I'm proposing a namespace that would be exposed, allowing wrapper functions to extend the context as they need.Assuming
@adobe/helix-universal-logger
adds an extension to the namespace like this:TS clients could then use:
wdyt @tripodsan @trieloff ?
The text was updated successfully, but these errors were encountered: