FunctionEventHandler<K, P>: ((event, context) => Promise<FunctionEventHandlers[K]["response"]> | FunctionEventHandlers[K]["response"])

Event handler type that needs to be exported as handler from your function. e.g. const handler: FunctionEventHandler = (event, context) => { ... }

This type can also be used to construct helper functions for specific events e.g. `const queryHandler: FunctionEventHandler<'graphql.query'> = (event, context) => { ... }

Type Parameters

  • K extends FunctionEventType = FunctionEventType
  • P extends Record<string, any> = Record<string, any>

Type declaration

    • (event, context): Promise<FunctionEventHandlers[K]["response"]> | FunctionEventHandlers[K]["response"]
    • Parameters

      Returns Promise<FunctionEventHandlers[K]["response"]> | FunctionEventHandlers[K]["response"]

Generated using TypeDoc