@vertz/ui-server 0.2.23 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,6 +82,22 @@ interface BunDevServerOptions {
82
82
  * @default false
83
83
  */
84
84
  watchDeps?: boolean | string[];
85
+ /**
86
+ * Resolve theme from request for SSR. Returns the value for `data-theme`
87
+ * on the `<html>` tag and patches any `data-theme` attributes in the SSR body.
88
+ * Use this to read a theme cookie and eliminate dark→light flash on reload.
89
+ */
90
+ themeFromRequest?: (request: Request) => string | null | undefined;
91
+ /**
92
+ * Called when the SSR module fails to recover from a broken state and a
93
+ * process restart is needed. Bun's ESM module cache retains failed imports
94
+ * process-wide — the only way to clear it is to restart the process.
95
+ *
96
+ * The dev server calls stop() before invoking this callback.
97
+ * Typically, the callback calls `process.exit(75)` and a supervisor
98
+ * script restarts the process.
99
+ */
100
+ onRestartNeeded?: () => void;
85
101
  }
86
102
  interface ErrorDetail {
87
103
  message: string;
@@ -157,11 +173,13 @@ interface SSRPageHtmlOptions {
157
173
  headTags?: string;
158
174
  /** Pre-built session + access set script tags for SSR injection. */
159
175
  sessionScript?: string;
176
+ /** Theme value for `data-theme` attribute on `<html>`. */
177
+ htmlDataTheme?: string;
160
178
  }
161
179
  /**
162
180
  * Generate a full SSR HTML page with the given content, CSS, SSR data, and script tag.
163
181
  */
164
- declare function generateSSRPageHtml({ title, css, bodyHtml, ssrData, scriptTag, editor, headTags, sessionScript }: SSRPageHtmlOptions): string;
182
+ declare function generateSSRPageHtml({ title, css, bodyHtml, ssrData, scriptTag, editor, headTags, sessionScript, htmlDataTheme }: SSRPageHtmlOptions): string;
165
183
  interface FetchInterceptorOptions {
166
184
  apiHandler: (req: Request) => Promise<Response>;
167
185
  origin: string;