@nestjs-ssr/react 0.3.2 → 0.3.4
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.
- package/README.md +2 -2
- package/dist/cli/init.js +5 -5
- package/dist/cli/init.mjs +5 -5
- package/dist/index.js +54 -46
- package/dist/index.mjs +24 -16
- package/dist/render/index.js +41 -34
- package/dist/render/index.mjs +23 -15
- package/dist/templates/entry-client.tsx +48 -25
- package/dist/templates/entry-server.tsx +18 -0
- package/etc/react.api.md +250 -262
- package/package.json +1 -1
- package/src/templates/entry-client.tsx +48 -25
- package/src/templates/entry-server.tsx +18 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="@nestjs-ssr/react/global" />
|
|
2
|
+
|
|
2
3
|
import React, { StrictMode } from 'react';
|
|
3
4
|
import { hydrateRoot } from 'react-dom/client';
|
|
4
5
|
import {
|
|
@@ -10,6 +11,15 @@ const componentName = window.__COMPONENT_NAME__;
|
|
|
10
11
|
const initialProps = window.__INITIAL_STATE__ || {};
|
|
11
12
|
const renderContext = window.__CONTEXT__ || {};
|
|
12
13
|
|
|
14
|
+
// Auto-discover root layout using Vite's glob import (must match server-side discovery)
|
|
15
|
+
// @ts-ignore - Vite-specific API
|
|
16
|
+
const layoutModules = import.meta.glob('@/views/layout.tsx', {
|
|
17
|
+
eager: true,
|
|
18
|
+
}) as Record<string, { default: React.ComponentType<any> }>;
|
|
19
|
+
|
|
20
|
+
const layoutPath = Object.keys(layoutModules)[0];
|
|
21
|
+
const RootLayout = layoutPath ? layoutModules[layoutPath].default : null;
|
|
22
|
+
|
|
13
23
|
// Auto-import all view components using Vite's glob feature
|
|
14
24
|
// Exclude entry-client.tsx and entry-server.tsx from the glob
|
|
15
25
|
// @ts-ignore - Vite-specific API
|
|
@@ -111,40 +121,53 @@ function hasLayout(
|
|
|
111
121
|
function composeWithLayout(
|
|
112
122
|
ViewComponent: React.ComponentType<any>,
|
|
113
123
|
props: any,
|
|
124
|
+
context?: any,
|
|
125
|
+
layouts: Array<{ layout: React.ComponentType<any>; props?: any }> = [],
|
|
114
126
|
): React.ReactElement {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
while (hasLayout(currentComponent)) {
|
|
130
|
-
layoutChain.push({
|
|
131
|
-
Layout: currentComponent.layout,
|
|
132
|
-
layoutProps: currentComponent.layoutProps || {},
|
|
133
|
-
});
|
|
134
|
-
currentComponent = currentComponent.layout;
|
|
127
|
+
// Start with the page component
|
|
128
|
+
let result = <ViewComponent {...props} />;
|
|
129
|
+
|
|
130
|
+
// If no layouts passed, check if component has its own layout chain
|
|
131
|
+
if (layouts.length === 0 && hasLayout(ViewComponent)) {
|
|
132
|
+
let currentComponent: any = ViewComponent;
|
|
133
|
+
while (hasLayout(currentComponent)) {
|
|
134
|
+
layouts.push({
|
|
135
|
+
layout: currentComponent.layout,
|
|
136
|
+
props: currentComponent.layoutProps || {},
|
|
137
|
+
});
|
|
138
|
+
currentComponent = currentComponent.layout;
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
|
|
137
|
-
// Wrap
|
|
138
|
-
|
|
139
|
-
for (const { Layout, layoutProps } of
|
|
140
|
-
|
|
142
|
+
// Wrap with each layout in the chain
|
|
143
|
+
// Must match server-side wrapping with data-layout and data-outlet attributes
|
|
144
|
+
for (const { layout: Layout, props: layoutProps } of layouts) {
|
|
145
|
+
const layoutName = Layout.displayName || Layout.name || 'Layout';
|
|
146
|
+
result = (
|
|
147
|
+
<div data-layout={layoutName}>
|
|
148
|
+
<Layout context={context} layoutProps={layoutProps}>
|
|
149
|
+
<div data-outlet={layoutName}>{result}</div>
|
|
150
|
+
</Layout>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
141
153
|
}
|
|
142
154
|
|
|
143
155
|
return result;
|
|
144
156
|
}
|
|
145
157
|
|
|
158
|
+
// Build layouts array - use RootLayout if it exists (matching server behavior)
|
|
159
|
+
const layouts: Array<{ layout: React.ComponentType<any>; props?: any }> = [];
|
|
160
|
+
if (RootLayout) {
|
|
161
|
+
layouts.push({ layout: RootLayout, props: {} });
|
|
162
|
+
}
|
|
163
|
+
|
|
146
164
|
// Compose the component with its layout (if any)
|
|
147
|
-
const composedElement = composeWithLayout(
|
|
165
|
+
const composedElement = composeWithLayout(
|
|
166
|
+
ViewComponent,
|
|
167
|
+
initialProps,
|
|
168
|
+
renderContext,
|
|
169
|
+
layouts,
|
|
170
|
+
);
|
|
148
171
|
|
|
149
172
|
// Wrap with providers to make context and navigation state available via hooks
|
|
150
173
|
const wrappedElement = (
|
|
@@ -2,6 +2,24 @@ import React from 'react';
|
|
|
2
2
|
import { renderToString, renderToPipeableStream } from 'react-dom/server';
|
|
3
3
|
import { PageContextProvider } from '@nestjs-ssr/react/client';
|
|
4
4
|
|
|
5
|
+
// Auto-discover root layout using Vite's glob import
|
|
6
|
+
// This eagerly loads layout if it exists, null otherwise
|
|
7
|
+
// @ts-ignore - Vite-specific API
|
|
8
|
+
const layoutModules = import.meta.glob('@/views/layout.tsx', {
|
|
9
|
+
eager: true,
|
|
10
|
+
}) as Record<string, { default: React.ComponentType<any> }>;
|
|
11
|
+
|
|
12
|
+
const layoutPath = Object.keys(layoutModules)[0];
|
|
13
|
+
const RootLayout = layoutPath ? layoutModules[layoutPath].default : null;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the root layout component.
|
|
17
|
+
* Used by RenderService in production when dynamic import isn't available.
|
|
18
|
+
*/
|
|
19
|
+
export function getRootLayout(): React.ComponentType<any> | null {
|
|
20
|
+
return RootLayout;
|
|
21
|
+
}
|
|
22
|
+
|
|
5
23
|
/**
|
|
6
24
|
* Compose a component with its layouts from the interceptor.
|
|
7
25
|
* Layouts are passed from the RenderInterceptor based on decorators.
|
package/etc/react.api.md
CHANGED
|
@@ -1,262 +1,250 @@
|
|
|
1
|
-
## API Report File for "@nestjs-ssr/react"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// @public
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// @public
|
|
83
|
-
export interface
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// @public
|
|
212
|
-
export
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
// @public
|
|
253
|
-
export function useParams(): Record<string, string>;
|
|
254
|
-
|
|
255
|
-
// @public
|
|
256
|
-
export function useQuery(): Record<string, string | string[]>;
|
|
257
|
-
|
|
258
|
-
// @public
|
|
259
|
-
export function useUserAgent(): string | undefined;
|
|
260
|
-
|
|
261
|
-
// (No @packageDocumentation comment for this package)
|
|
262
|
-
```
|
|
1
|
+
## API Report File for "@nestjs-ssr/react"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { CallHandler } from '@nestjs/common';
|
|
8
|
+
import { ComponentType } from 'react';
|
|
9
|
+
import { DynamicModule } from '@nestjs/common';
|
|
10
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
11
|
+
import { NestInterceptor } from '@nestjs/common';
|
|
12
|
+
import { Observable } from 'rxjs';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
14
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
+
import { ReactNode } from 'react';
|
|
16
|
+
import { Reflector } from '@nestjs/core';
|
|
17
|
+
import { Response as Response_2 } from 'express';
|
|
18
|
+
import { ViteDevServer } from 'vite';
|
|
19
|
+
|
|
20
|
+
// @public
|
|
21
|
+
export function createSSRHooks<T extends RenderContext = RenderContext>(): {
|
|
22
|
+
usePageContext: () => T;
|
|
23
|
+
useParams: () => Record<string, string>;
|
|
24
|
+
useQuery: () => Record<string, string | string[]>;
|
|
25
|
+
useRequest: () => T;
|
|
26
|
+
useHeaders: () => Record<string, string>;
|
|
27
|
+
useHeader: (name: string) => string | undefined;
|
|
28
|
+
useCookies: () => Record<string, string>;
|
|
29
|
+
useCookie: (name: string) => string | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Warning: (ae-forgotten-export) The symbol "ErrorPageDevelopmentProps" needs to be exported by the entry point index.d.ts
|
|
33
|
+
//
|
|
34
|
+
// @public
|
|
35
|
+
export function ErrorPageDevelopment({ error, viewPath, phase, }: ErrorPageDevelopmentProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
// @public
|
|
38
|
+
export function ErrorPageProduction(): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
// @public
|
|
41
|
+
export interface HeadData {
|
|
42
|
+
bodyAttributes?: Record<string, string>;
|
|
43
|
+
canonical?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
htmlAttributes?: Record<string, string>;
|
|
46
|
+
jsonLd?: Array<Record<string, any>>;
|
|
47
|
+
keywords?: string;
|
|
48
|
+
links?: Array<{
|
|
49
|
+
rel: string;
|
|
50
|
+
href: string;
|
|
51
|
+
as?: string;
|
|
52
|
+
type?: string;
|
|
53
|
+
crossorigin?: string;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}>;
|
|
56
|
+
meta?: Array<{
|
|
57
|
+
name?: string;
|
|
58
|
+
property?: string;
|
|
59
|
+
content: string;
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
}>;
|
|
62
|
+
ogDescription?: string;
|
|
63
|
+
ogImage?: string;
|
|
64
|
+
ogTitle?: string;
|
|
65
|
+
scripts?: Array<{
|
|
66
|
+
src?: string;
|
|
67
|
+
async?: boolean;
|
|
68
|
+
defer?: boolean;
|
|
69
|
+
type?: string;
|
|
70
|
+
innerHTML?: string;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}>;
|
|
73
|
+
title?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// @public
|
|
77
|
+
export function Layout(layout: LayoutComponent<any>, options?: LayoutDecoratorOptions): ClassDecorator;
|
|
78
|
+
|
|
79
|
+
// @public
|
|
80
|
+
export type LayoutComponent<TProps = {}> = ComponentType<LayoutProps<TProps>>;
|
|
81
|
+
|
|
82
|
+
// @public
|
|
83
|
+
export interface LayoutDecoratorOptions {
|
|
84
|
+
props?: Record<string, any>;
|
|
85
|
+
skipRoot?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// @public
|
|
89
|
+
export interface LayoutProps<TProps = {}> {
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
context?: RenderContext;
|
|
92
|
+
head?: HeadData;
|
|
93
|
+
layoutProps?: TProps;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// @public
|
|
97
|
+
export interface PageComponentWithLayout<TPageProps = {}, TLayoutProps = {}> {
|
|
98
|
+
(props: TPageProps): ReactNode;
|
|
99
|
+
layout?: LayoutComponent<TLayoutProps>;
|
|
100
|
+
layoutProps?: TLayoutProps;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// @public
|
|
104
|
+
export function PageContextProvider({ context: initialContext, children, isSegment, }: {
|
|
105
|
+
context: RenderContext;
|
|
106
|
+
children: React_2.ReactNode;
|
|
107
|
+
isSegment?: boolean;
|
|
108
|
+
}): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
// @public
|
|
111
|
+
export type PageProps<TProps = {}> = TProps & {
|
|
112
|
+
head?: HeadData;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// Warning: (ae-forgotten-export) The symbol "RenderReturnType" needs to be exported by the entry point index.d.ts
|
|
116
|
+
// Warning: (ae-forgotten-export) The symbol "ExtractComponentData" needs to be exported by the entry point index.d.ts
|
|
117
|
+
//
|
|
118
|
+
// @public
|
|
119
|
+
export function Render<T extends React_2.ComponentType<any>>(component: T, options?: RenderOptions): <TMethod extends (...args: any[]) => RenderReturnType<ExtractComponentData<T>> | Promise<RenderReturnType<ExtractComponentData<T>>>>(target: any, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<TMethod>) => TypedPropertyDescriptor<TMethod> | void;
|
|
120
|
+
|
|
121
|
+
// @public
|
|
122
|
+
export interface RenderConfig {
|
|
123
|
+
allowedCookies?: string[];
|
|
124
|
+
allowedHeaders?: string[];
|
|
125
|
+
defaultHead?: HeadData;
|
|
126
|
+
// Warning: (ae-forgotten-export) The symbol "ErrorPageDevelopmentProps$1" needs to be exported by the entry point index.d.ts
|
|
127
|
+
errorPageDevelopment?: ComponentType<ErrorPageDevelopmentProps$1>;
|
|
128
|
+
errorPageProduction?: ComponentType;
|
|
129
|
+
mode?: SSRMode;
|
|
130
|
+
template?: string;
|
|
131
|
+
timeout?: number;
|
|
132
|
+
// Warning: (ae-forgotten-export) The symbol "ViteConfig" needs to be exported by the entry point index.d.ts
|
|
133
|
+
vite?: ViteConfig;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// @public
|
|
137
|
+
export interface RenderContext {
|
|
138
|
+
// (undocumented)
|
|
139
|
+
method: string;
|
|
140
|
+
// (undocumented)
|
|
141
|
+
params: Record<string, string>;
|
|
142
|
+
// (undocumented)
|
|
143
|
+
path: string;
|
|
144
|
+
// (undocumented)
|
|
145
|
+
query: Record<string, string | string[]>;
|
|
146
|
+
// (undocumented)
|
|
147
|
+
url: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// @public (undocumented)
|
|
151
|
+
export class RenderInterceptor implements NestInterceptor {
|
|
152
|
+
constructor(reflector: Reflector, renderService: RenderService, allowedHeaders?: string[] | undefined, allowedCookies?: string[] | undefined);
|
|
153
|
+
// (undocumented)
|
|
154
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// @public (undocumented)
|
|
158
|
+
export class RenderModule {
|
|
159
|
+
static forRoot(config?: RenderConfig): DynamicModule;
|
|
160
|
+
static forRootAsync(options: {
|
|
161
|
+
imports?: any[];
|
|
162
|
+
inject?: any[];
|
|
163
|
+
useFactory: (...args: any[]) => Promise<RenderConfig> | RenderConfig;
|
|
164
|
+
}): DynamicModule;
|
|
165
|
+
// @deprecated (undocumented)
|
|
166
|
+
static register(config?: RenderConfig): DynamicModule;
|
|
167
|
+
// @deprecated (undocumented)
|
|
168
|
+
static registerAsync(options: {
|
|
169
|
+
imports?: any[];
|
|
170
|
+
inject?: any[];
|
|
171
|
+
useFactory: (...args: any[]) => Promise<RenderConfig> | RenderConfig;
|
|
172
|
+
}): DynamicModule;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// @public
|
|
176
|
+
export interface RenderOptions {
|
|
177
|
+
layout?: LayoutComponent<any> | false | null;
|
|
178
|
+
layoutProps?: Record<string, any>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// @public
|
|
182
|
+
export interface RenderResponse<T = any> {
|
|
183
|
+
head?: HeadData;
|
|
184
|
+
layoutProps?: Record<string, any>;
|
|
185
|
+
props: T;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// @public
|
|
189
|
+
export class RenderService {
|
|
190
|
+
// Warning: (ae-forgotten-export) The symbol "StringRenderer" needs to be exported by the entry point index.d.ts
|
|
191
|
+
// Warning: (ae-forgotten-export) The symbol "StreamRenderer" needs to be exported by the entry point index.d.ts
|
|
192
|
+
constructor(stringRenderer: StringRenderer, streamRenderer: StreamRenderer, ssrMode?: SSRMode, defaultHead?: HeadData | undefined, customTemplate?: string);
|
|
193
|
+
getRootLayout(): Promise<any | null>;
|
|
194
|
+
render(viewComponent: any, data?: any, res?: Response_2, head?: HeadData): Promise<string | void>;
|
|
195
|
+
// Warning: (ae-forgotten-export) The symbol "SegmentResponse" needs to be exported by the entry point index.d.ts
|
|
196
|
+
renderSegment(viewComponent: any, data: any, swapTarget: string, head?: HeadData): Promise<SegmentResponse>;
|
|
197
|
+
// (undocumented)
|
|
198
|
+
setViteServer(vite: ViteDevServer): void;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// @public
|
|
202
|
+
export type SSRMode = 'string' | 'stream';
|
|
203
|
+
|
|
204
|
+
// @public
|
|
205
|
+
export class StreamingErrorHandler {
|
|
206
|
+
constructor(errorPageDevelopment?: ComponentType<ErrorPageDevelopmentProps$1> | undefined, errorPageProduction?: ComponentType | undefined);
|
|
207
|
+
handleShellError(error: Error, res: Response_2, viewPath: string, isDevelopment: boolean): void;
|
|
208
|
+
handleStreamError(error: Error, viewPath: string): void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// @public
|
|
212
|
+
export class TemplateParserService {
|
|
213
|
+
buildHeadTags(head?: HeadData): string;
|
|
214
|
+
buildInlineScripts(data: any, context: any, componentName: string, layouts?: Array<{
|
|
215
|
+
layout: any;
|
|
216
|
+
props?: any;
|
|
217
|
+
}>): string;
|
|
218
|
+
getClientScriptTag(isDevelopment: boolean, manifest?: any): string;
|
|
219
|
+
getStylesheetTags(isDevelopment: boolean, manifest?: any): string;
|
|
220
|
+
// Warning: (ae-forgotten-export) The symbol "TemplateParts" needs to be exported by the entry point index.d.ts
|
|
221
|
+
parseTemplate(html: string): TemplateParts;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// @public (undocumented)
|
|
225
|
+
export const useCookie: (name: string) => string | undefined;
|
|
226
|
+
|
|
227
|
+
// @public (undocumented)
|
|
228
|
+
export const useCookies: () => Record<string, string>;
|
|
229
|
+
|
|
230
|
+
// @public (undocumented)
|
|
231
|
+
export const useHeader: (name: string) => string | undefined;
|
|
232
|
+
|
|
233
|
+
// @public (undocumented)
|
|
234
|
+
export const useHeaders: () => Record<string, string>;
|
|
235
|
+
|
|
236
|
+
// @public (undocumented)
|
|
237
|
+
export const usePageContext: () => RenderContext;
|
|
238
|
+
|
|
239
|
+
// @public (undocumented)
|
|
240
|
+
export const useParams: () => Record<string, string>;
|
|
241
|
+
|
|
242
|
+
// @public (undocumented)
|
|
243
|
+
export const useQuery: () => Record<string, string | string[]>;
|
|
244
|
+
|
|
245
|
+
// @public (undocumented)
|
|
246
|
+
export const useRequest: () => RenderContext;
|
|
247
|
+
|
|
248
|
+
// (No @packageDocumentation comment for this package)
|
|
249
|
+
|
|
250
|
+
```
|