Skip to content

AbortSignal

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:937

The AbortSignal interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object.

MDN Reference

new AbortSignal(): AbortSignal

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:872

AbortSignal

EventTarget.constructor

readonly aborted: boolean

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:961

The aborted read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).

MDN Reference


readonly reason: any

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:967

The reason read-only property returns a JavaScript value that indicates the abort reason.

MDN Reference

get onabort(): any

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:969

any

set onabort(value): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:971

any

void

addEventListener<Type>(type, handler, options?): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:878

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

Type extends string

Type

EventListenerOrEventListenerObject<Event>

boolean | EventTargetAddEventListenerOptions

void

EventTarget.addEventListener


dispatchEvent(event): boolean

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:898

The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

MDN Reference

Event

boolean

EventTarget.dispatchEvent


removeEventListener<Type>(type, handler, options?): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:888

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

MDN Reference

Type extends string

Type

EventListenerOrEventListenerObject<Event>

boolean | EventTargetEventListenerOptions

void

EventTarget.removeEventListener


throwIfAborted(): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:977

The throwIfAborted() method throws the signal’s abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.

MDN Reference

void


static abort(reason?): AbortSignal

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:943

The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).

MDN Reference

any

AbortSignal


static any(signals): AbortSignal

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:955

The AbortSignal.any() static method takes an iterable of abort signals and returns an AbortSignal.

MDN Reference

AbortSignal[]

AbortSignal


static timeout(delay): AbortSignal

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:949

The AbortSignal.timeout() static method returns an AbortSignal that will automatically abort after a specified time.

MDN Reference

number

AbortSignal