[]previous and next page

ServerFnInfo

A server function found in a module.

A server function found in a module.

Import#

ts
import type { ServerFnInfo } from "@shadow-js/dusk/vite";

Signature#

ts
interface ServerFnInfo {
  /** Name of the export that holds it (`default` for the default export). */
  readonly exportName: string;
  /** Stable id: see {@link fnId}. */
  readonly id: string;
  readonly method: "GET" | "POST";
  /** Whether the function also accepts HTML form posts. */
  readonly form: boolean;
  /** Whether the browser stub may send this call in a batch (default true). */
  readonly batch: boolean;
  /** Whether the response carries the refreshed loader data of the current route. */
  readonly singleFlight: boolean;
  /** Whether an AsyncIterable is delivered as typed SSE items. */
  readonly stream?: true;
  /** How it was written. */
  readonly origin: "serverFn" | "directive-file" | "directive-function";
  /** 1-based line of the definition. */
  readonly line: number;
}

Members#

Name Type Description
exportName readonly exportName: string Name of the export that holds it (default for the default export).
id readonly id: string Stable id: see fnId.
method readonly method: "GET" | "POST"
form readonly form: boolean Whether the function also accepts HTML form posts.
batch readonly batch: boolean Whether the browser stub may send this call in a batch (default true).
singleFlight readonly singleFlight: boolean Whether the response carries the refreshed loader data of the current route.
stream? readonly stream?: true Whether an AsyncIterable is delivered as typed SSE items.
origin readonly origin: "serverFn" | "directive-file" | "directive-function" How it was written.
line readonly line: number 1-based line of the definition.