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

Expose Request Typescript interface from core types #933

Closed
saintybalboa opened this issue Nov 12, 2022 · 2 comments
Closed

Expose Request Typescript interface from core types #933

saintybalboa opened this issue Nov 12, 2022 · 2 comments

Comments

@saintybalboa
Copy link
Contributor

saintybalboa commented Nov 12, 2022

Is your feature request related to a problem? Please describe.

I need to assign a type to function arguments of the middleware object (MiddlewareObj). Digging through the middy codebase I found the Request interface which seems to be what I need but it isn't exported so cannot be used.

Describe the solution you'd like

Export the Request interface so that consumers can assign the type to the middleware functions.

const middlewareObj = {
    before: (request: Request) => {
      ...
    }
}

Describe alternatives you've considered

If there's already a type available for this it might be worth adding this to the docs.

Additional context

N/A

@willfarrell
Copy link
Member

Would you be able to open a PR against the v4 branch to add this in?

@saintybalboa
Copy link
Contributor Author

@willfarrell here's a link to the PR. Let me know if there's anything I've missed / needs updating.

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

No branches or pull requests

2 participants