Options
All
  • Public
  • Public/Protected
  • All
Menu

Netlify Edge Handlers API

Index

Type aliases

FetchErrorCode

FetchErrorCode: "illegal-target" | "invalid-url" | "other" | "redirect-encountered" | "redirect-follow-not-allowed" | "redirect-loop-encountered"

A programmatic representation of the error that occured while performing the fetch.

HeadersInit

HeadersInit: Record<string, string> | [string, string][] | Headers

Data to initialize a header map.

HttpBody

HttpBody: string | ArrayBuffer | ArrayBufferView | ReadableStream

Represents a request body.

Method

Method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"

Represents a HTTP method.

ReadableStreamBYOBReadResult

ReadableStreamBYOBReadResult<T>: { done: boolean; value: T }

A result returned by ReadableStreamBYOBReader.read.

Type parameters

  • T: ArrayBufferView

Type declaration

  • done: boolean
  • value: T

ReadableStreamDefaultReadResult

ReadableStreamDefaultReadResult<T>: { done: false; value: T } | { done: true; value: undefined }

A result returned by ReadableStreamDefaultReader.read.

Type parameters

  • T

RedirectPolicy

RedirectPolicy: "follow" | "manual" | "error"

Specifies what to do in case of a redirect.

Redirects can either be followed automatically or not, or the fetch request can be set to fail if a redirect is encountered. Default is follow.

TransformerFlushCallback

TransformerFlushCallback<O>: (controller: TransformStreamDefaultController<O>) => void | PromiseLike<void>

Type parameters

  • O

Type declaration

TransformerStartCallback

TransformerStartCallback<O>: (controller: TransformStreamDefaultController<O>) => void | PromiseLike<void>

Type parameters

  • O

Type declaration

TransformerTransformCallback

TransformerTransformCallback<I, O>: (chunk: I, controller: TransformStreamDefaultController<O>) => void | PromiseLike<void>

Type parameters

  • I

  • O

Type declaration

UnderlyingByteSourcePullCallback

UnderlyingByteSourcePullCallback: (controller: ReadableByteStreamController) => void | PromiseLike<void>

Type declaration

UnderlyingByteSourceStartCallback

UnderlyingByteSourceStartCallback: (controller: ReadableByteStreamController) => void | PromiseLike<void>

Type declaration

UnderlyingSinkAbortCallback

UnderlyingSinkAbortCallback: (reason: any) => void | PromiseLike<void>

Type declaration

    • (reason: any): void | PromiseLike<void>
    • Parameters

      • reason: any

      Returns void | PromiseLike<void>

UnderlyingSinkCloseCallback

UnderlyingSinkCloseCallback: () => void | PromiseLike<void>

Type declaration

    • (): void | PromiseLike<void>
    • Returns void | PromiseLike<void>

UnderlyingSinkStartCallback

UnderlyingSinkStartCallback: (controller: WritableStreamDefaultController) => void | PromiseLike<void>

Type declaration

UnderlyingSinkWriteCallback

UnderlyingSinkWriteCallback<W>: (chunk: W, controller: WritableStreamDefaultController) => void | PromiseLike<void>

Type parameters

  • W

Type declaration

UnderlyingSourceCancelCallback

UnderlyingSourceCancelCallback: (reason: any) => void | PromiseLike<void>

Type declaration

    • (reason: any): void | PromiseLike<void>
    • Parameters

      • reason: any

      Returns void | PromiseLike<void>

UnderlyingSourcePullCallback

UnderlyingSourcePullCallback<R>: (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>

Type parameters

  • R

Type declaration

UnderlyingSourceStartCallback

UnderlyingSourceStartCallback<R>: (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>

Type parameters

  • R

Type declaration

Variables

Const console

console: { assert: any; debug: any; error: any; info: any; log: any; warn: any } = ...

A global console to log messages to.

Type declaration

  • assert: function
    • assert(condition: boolean, ...args: unknown[]): void
    • Logs a log line if the given condition is false.

      Parameters

      • condition: boolean

        the condition to check before logging

      • Rest ...args: unknown[]

        the log line to log

      Returns void

  • debug: function
    • debug(...args: unknown[]): void
    • Logs debug information.

      Parameters

      • Rest ...args: unknown[]

      Returns void

  • error: function
    • error(...args: unknown[]): void
    • Logs an error.

      Parameters

      • Rest ...args: unknown[]

      Returns void

  • info: function
    • info(...args: unknown[]): void
    • Logs a line.

      Parameters

      • Rest ...args: unknown[]

      Returns void

  • log: function
    • log(...args: unknown[]): void
    • Logs a line.

      Parameters

      • Rest ...args: unknown[]

      Returns void

  • warn: function
    • warn(...args: unknown[]): void
    • Logs a warning.

      Parameters

      • Rest ...args: unknown[]

      Returns void

Functions

Const fetch

  • Asynchronously fetches the given HTTP resource.

    Parameters

    • resource: string | Request | Stringfiable

      The resource to fetch. This can either be a URL or an instance of the Request class.

    • Optional init: RequestInit

      Request parameters overriding what is specified in the given Request, if any.

    Returns Promise<Response>

    Returns a promise that resolves to the HTTP response.

Generated using TypeDoc