feat(typescript): improve TS definitions for better context support #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to the TypeScript type definitions for
koa-proxies
. These changes were developed by vendoring in our own mono repo at @CloudSoda.Key Changes
StateT
,ContextT
, andResponseBodyT
toKoaProxies
function. This allows users to specify custom state, context, and response body types, aligning more closely with Koa's native typing system.IBaseKoaProxiesOptions
: Modified theIBaseKoaProxiesOptions
interface to accept a genericContextT
type. This change provides better integration with custom Koa contexts.Motivation
Our project's requirements and the limitations encountered with the current TypeScript definitions in
koa-proxies
led us to develop our own custom definitions. The primary motivation was to achieve better type support for custom Koa contexts and to enhance the TypeScript integration for more complex use cases.Impact
koa-proxies
TypeScript definitions should remain unaffected.koa-proxies
, particularly those dealing with complex or custom Koa contexts.We are excited to contribute these improvements back to the
koa-proxies
community and look forward to feedback and suggestions!