HydrationScriptOptions
Options of generateHydrationScript and HydrationScript.
Options of generateHydrationScript and HydrationScript.
Import#
ts
import type { HydrationScriptOptions } from "@shadow-js/web/server";
Signature#
ts
interface HydrationScriptOptions {
/**
* CSP nonce for the script. It is written only when it is a plain token (letters, digits, `+`, `/`,
* `=`, `_`, `-`); any other value is ignored and the script gets no nonce.
* @default undefined (no nonce attribute)
*/
readonly nonce?: string;
/**
* Event types to capture before hydration. Only plain lower-case names (`[a-z]+`) are kept; others
* are skipped.
* @default ["click", "input"]
*/
readonly eventNames?: readonly string[];
}
Members#
| Name | Type | Description |
|---|---|---|
nonce? |
readonly nonce?: string |
CSP nonce for the script. It is written only when it is a plain token (letters, digits, +, /, =, _, -); any other value is ignored and the script gets no nonce. |
eventNames? |
readonly eventNames?: readonly string[] |
Event types to capture before hydration. Only plain lower-case names ([a-z]+) are kept; others are skipped. |