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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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
Returns
Section titled “Returns”AbortSignal
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”aborted
Section titled “aborted”
readonlyaborted: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).
reason
Section titled “reason”
readonlyreason: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.
Accessors
Section titled “Accessors”onabort
Section titled “onabort”Get Signature
Section titled “Get Signature”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
Returns
Section titled “Returns”any
Set Signature
Section titled “Set Signature”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
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”void
Methods
Section titled “Methods”addEventListener()
Section titled “addEventListener()”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.
Type Parameters
Section titled “Type Parameters”Type extends string
Parameters
Section titled “Parameters”Type
handler
Section titled “handler”EventListenerOrEventListenerObject<Event>
options?
Section titled “options?”boolean | EventTargetAddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”dispatchEvent()
Section titled “dispatchEvent()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”removeEventListener()
Section titled “removeEventListener()”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.
Type Parameters
Section titled “Type Parameters”Type extends string
Parameters
Section titled “Parameters”Type
handler
Section titled “handler”EventListenerOrEventListenerObject<Event>
options?
Section titled “options?”boolean | EventTargetEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EventTarget.removeEventListener
throwIfAborted()
Section titled “throwIfAborted()”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.
Returns
Section titled “Returns”void
abort()
Section titled “abort()”
staticabort(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).
Parameters
Section titled “Parameters”reason?
Section titled “reason?”any
Returns
Section titled “Returns”AbortSignal
staticany(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.
Parameters
Section titled “Parameters”signals
Section titled “signals”AbortSignal[]
Returns
Section titled “Returns”AbortSignal
timeout()
Section titled “timeout()”
statictimeout(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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”AbortSignal