Skip to content

Expose Request Typescript interface from core types #933

Description

@saintybalboa

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions