/// /// import { Context } from '../types'; /** * Events start function */ export interface EventFunction { (controller: ReadableStreamDirectController, ctx: Context): any; } /** * Create an events stream */ export declare class Events { fnPull: EventFunction; /** * The underlying source */ constructor(fnPull: EventFunction); /** * Abort function */ fnAbort: EventFunction; /** * Handle on request signal abort */ abort(fn: EventFunction): this; /** * Cancel function */ fnCancel: EventFunction; /** * Handle error */ cancel(fn: EventFunction): this; private createReadableStreamMacro; /** * Create a response sender */ send(): (c: Context) => Response; /** * Create a function that creates a stream */ stream(): (c: Context) => ReadableStream; } /** * Create an event stream */ export declare const events: (fn: EventFunction) => Events;