Skip to main content
Version: Next

ContextMiddleware <TCrawlingContext, TCrawlingContextExtension>

Represents a middleware step in the context pipeline.

Index

Properties

Properties

action

action: (context) => Awaitable<TCrawlingContextExtension>

The main middleware function that enhances the context


Type declaration

    • (context): Awaitable<TCrawlingContextExtension>
    • Parameters

      • context: TCrawlingContext

      Returns Awaitable<TCrawlingContextExtension>

optionalcleanup

cleanup?: (context, error) => Awaitable<void>

Optional cleanup function called after the consumer finishes or fails


Type declaration

    • (context, error): Awaitable<void>
    • Parameters

      • context: TCrawlingContext & TCrawlingContextExtension
      • optionalerror: unknown

      Returns Awaitable<void>

Page Options