@useavalon/avalon 0.1.23 → 0.1.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.
- package/dist/mod.d.ts +50 -0
- package/dist/src/build/integration-bundler-plugin.d.ts +25 -0
- package/dist/src/build/integration-config.d.ts +44 -0
- package/dist/src/build/integration-detection-plugin.d.ts +20 -0
- package/dist/src/build/integration-resolver-plugin.d.ts +10 -0
- package/dist/src/build/island-manifest.d.ts +57 -0
- package/dist/src/build/island-types-generator.d.ts +49 -0
- package/dist/src/build/mdx-island-transform.d.ts +23 -0
- package/dist/src/build/mdx-plugin.d.ts +36 -0
- package/dist/src/build/page-island-transform.d.ts +41 -0
- package/dist/src/build/prop-extractors/index.d.ts +8 -0
- package/dist/src/build/prop-extractors/lit.d.ts +11 -0
- package/dist/src/build/prop-extractors/qwik.d.ts +9 -0
- package/dist/src/build/prop-extractors/solid.d.ts +12 -0
- package/dist/src/build/prop-extractors/svelte.d.ts +13 -0
- package/dist/src/build/prop-extractors/vue.d.ts +19 -0
- package/dist/src/build/sidecar-file-manager.d.ts +23 -0
- package/dist/src/build/sidecar-renderer.d.ts +22 -0
- package/dist/src/client/adapters/index.d.ts +15 -0
- package/dist/src/client/components.d.ts +21 -0
- package/dist/src/client/css-hmr-handler.d.ts +94 -0
- package/dist/src/client/framework-adapter.d.ts +225 -0
- package/dist/src/client/hmr-coordinator.d.ts +88 -0
- package/dist/src/client/main.js +1 -1
- package/dist/src/components/Image.d.ts +61 -0
- package/dist/src/components/IslandErrorBoundary.d.ts +37 -0
- package/dist/src/components/IslandErrorBoundary.js +1 -1
- package/dist/src/components/LayoutDataErrorBoundary.d.ts +34 -0
- package/dist/src/components/LayoutDataErrorBoundary.js +1 -1
- package/dist/src/components/LayoutErrorBoundary.d.ts +25 -0
- package/dist/src/components/LayoutErrorBoundary.js +1 -1
- package/dist/src/components/PersistentIsland.d.ts +36 -0
- package/dist/src/components/StreamingErrorBoundary.d.ts +42 -0
- package/dist/src/components/StreamingErrorBoundary.js +1 -1
- package/dist/src/components/StreamingLayout.d.ts +83 -0
- package/dist/src/components/StreamingLayout.js +1 -1
- package/dist/src/core/components/component-analyzer.d.ts +48 -0
- package/dist/src/core/components/component-detection.d.ts +72 -0
- package/dist/src/core/components/enhanced-framework-detector.d.ts +78 -0
- package/dist/src/core/components/framework-registry.d.ts +114 -0
- package/dist/src/core/content/mdx-processor.d.ts +14 -0
- package/dist/src/core/integrations/index.d.ts +6 -0
- package/dist/src/core/integrations/loader.d.ts +35 -0
- package/dist/src/core/integrations/registry.d.ts +51 -0
- package/dist/src/core/islands/island-persistence.d.ts +74 -0
- package/dist/src/core/islands/island-state-serializer.d.ts +53 -0
- package/dist/src/core/islands/persistent-island-context.d.ts +36 -0
- package/dist/src/core/islands/use-persistent-state.d.ts +17 -0
- package/dist/src/core/layout/enhanced-layout-resolver.d.ts +73 -0
- package/dist/src/core/layout/layout-cache-manager.d.ts +66 -0
- package/dist/src/core/layout/layout-composer.d.ts +63 -0
- package/dist/src/core/layout/layout-data-loader.d.ts +146 -0
- package/dist/src/core/layout/layout-discovery.d.ts +51 -0
- package/dist/src/core/layout/layout-matcher.d.ts +77 -0
- package/dist/src/core/layout/layout-types.d.ts +94 -0
- package/dist/src/core/modules/framework-module-resolver.d.ts +85 -0
- package/dist/src/islands/component-analysis.d.ts +38 -0
- package/dist/src/islands/css-utils.d.ts +81 -0
- package/dist/src/islands/discovery/index.d.ts +16 -0
- package/dist/src/islands/discovery/registry.d.ts +141 -0
- package/dist/src/islands/discovery/resolver.d.ts +190 -0
- package/dist/src/islands/discovery/scanner.d.ts +55 -0
- package/dist/src/islands/discovery/types.d.ts +92 -0
- package/dist/src/islands/discovery/validator.d.ts +89 -0
- package/dist/src/islands/discovery/watcher.d.ts +95 -0
- package/dist/src/islands/framework-detection.d.ts +53 -0
- package/dist/src/islands/integration-loader.d.ts +139 -0
- package/dist/src/islands/island.d.ts +55 -0
- package/dist/src/islands/render-cache.d.ts +203 -0
- package/dist/src/islands/types.d.ts +63 -0
- package/dist/src/islands/universal-css-collector.d.ts +41 -0
- package/dist/src/islands/universal-head-collector.d.ts +42 -0
- package/dist/src/layout-system.d.ts +92 -592
- package/dist/src/middleware/discovery.d.ts +70 -0
- package/dist/src/middleware/executor.d.ts +52 -0
- package/dist/src/middleware/index.d.ts +43 -0
- package/dist/src/middleware/types.d.ts +89 -0
- package/dist/src/nitro/build-config.d.ts +163 -0
- package/dist/src/nitro/config.d.ts +268 -0
- package/dist/src/nitro/error-handler.d.ts +151 -0
- package/dist/src/nitro/index.d.ts +15 -0
- package/dist/src/nitro/island-manifest.d.ts +191 -0
- package/dist/src/nitro/middleware-adapter.d.ts +151 -0
- package/dist/src/nitro/renderer.d.ts +342 -0
- package/dist/src/nitro/route-discovery.d.ts +142 -0
- package/dist/src/nitro/types.d.ts +278 -0
- package/dist/src/render/collect-css.d.ts +28 -0
- package/dist/src/render/error-pages.d.ts +14 -0
- package/dist/src/render/isolated-ssr-renderer.d.ts +127 -0
- package/dist/src/render/ssr.d.ts +56 -0
- package/dist/src/schemas/api.d.ts +27 -0
- package/dist/src/schemas/core.d.ts +75 -0
- package/dist/src/schemas/index.d.ts +79 -0
- package/dist/src/schemas/index.js +1 -1
- package/dist/src/schemas/layout.d.ts +282 -0
- package/dist/src/schemas/routing/index.d.ts +181 -0
- package/dist/src/schemas/routing.d.ts +388 -0
- package/dist/src/types/as-island.d.ts +17 -0
- package/dist/src/types/layout.d.ts +177 -0
- package/dist/src/types/routing.d.ts +297 -0
- package/dist/src/types/types.d.ts +6 -0
- package/dist/src/utils/dev-logger.d.ts +84 -0
- package/dist/src/utils/fs.d.ts +41 -0
- package/dist/src/vite-plugin/auto-discover.d.ts +72 -0
- package/dist/src/vite-plugin/config.d.ts +82 -0
- package/dist/src/vite-plugin/errors.d.ts +62 -0
- package/dist/src/vite-plugin/image-optimization.d.ts +36 -0
- package/dist/src/vite-plugin/integration-activator.d.ts +48 -0
- package/dist/src/vite-plugin/island-sidecar-plugin.d.ts +17 -0
- package/dist/src/vite-plugin/module-discovery.d.ts +66 -0
- package/dist/src/vite-plugin/nitro-integration.d.ts +56 -0
- package/dist/src/vite-plugin/plugin.d.ts +51 -0
- package/dist/src/vite-plugin/types.d.ts +281 -0
- package/dist/src/vite-plugin/validation.d.ts +93 -0
- package/package.json +33 -9
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ComponentType } from 'preact/compat';
|
|
3
|
+
/**
|
|
4
|
+
* Route Type Schema - Defines the different types of routes supported
|
|
5
|
+
*/
|
|
6
|
+
export declare const RouteTypeSchema: z.ZodEnum<{
|
|
7
|
+
static: "static";
|
|
8
|
+
index: "index";
|
|
9
|
+
group: "group";
|
|
10
|
+
dynamic: "dynamic";
|
|
11
|
+
"catch-all": "catch-all";
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* File System Route Schema - Represents a discovered route from the file system
|
|
15
|
+
*/
|
|
16
|
+
export declare const FileSystemRouteSchema: z.ZodObject<{
|
|
17
|
+
pattern: z.ZodAny;
|
|
18
|
+
filePath: z.ZodString;
|
|
19
|
+
routeType: z.ZodEnum<{
|
|
20
|
+
static: "static";
|
|
21
|
+
index: "index";
|
|
22
|
+
group: "group";
|
|
23
|
+
dynamic: "dynamic";
|
|
24
|
+
"catch-all": "catch-all";
|
|
25
|
+
}>;
|
|
26
|
+
dynamicSegments: z.ZodArray<z.ZodString>;
|
|
27
|
+
priority: z.ZodNumber;
|
|
28
|
+
isPrivate: z.ZodBoolean;
|
|
29
|
+
routeGroup: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/**
|
|
32
|
+
* Route Page Module Schema - Represents the exports from a page file in routing context
|
|
33
|
+
*/
|
|
34
|
+
export declare const RoutePageModuleSchema: z.ZodObject<{
|
|
35
|
+
default: z.ZodAny;
|
|
36
|
+
layoutConfig: z.ZodOptional<z.ZodAny>;
|
|
37
|
+
generateMetadata: z.ZodOptional<z.ZodAny>;
|
|
38
|
+
loader: z.ZodOptional<z.ZodAny>;
|
|
39
|
+
frontmatter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/**
|
|
42
|
+
* Route Parameters Schema - Parameters extracted from dynamic routes
|
|
43
|
+
*/
|
|
44
|
+
export declare const RouteParamsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
45
|
+
/**
|
|
46
|
+
* Loader Context Schema - Context passed to page loaders
|
|
47
|
+
*/
|
|
48
|
+
export declare const LoaderContextSchema: z.ZodObject<{
|
|
49
|
+
request: z.ZodCustom<Request, Request>;
|
|
50
|
+
url: z.ZodCustom<URL, URL>;
|
|
51
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
52
|
+
query: z.ZodCustom<URLSearchParams, URLSearchParams>;
|
|
53
|
+
state: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
/**
|
|
56
|
+
* Page Props Schema - Props passed to page components
|
|
57
|
+
*/
|
|
58
|
+
export declare const PagePropsSchema: z.ZodObject<{
|
|
59
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
60
|
+
query: z.ZodCustom<URLSearchParams, URLSearchParams>;
|
|
61
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
/**
|
|
64
|
+
* Metadata Schema - SEO and meta information
|
|
65
|
+
*/
|
|
66
|
+
export declare const MetadataSchema: z.ZodObject<{
|
|
67
|
+
title: z.ZodOptional<z.ZodString>;
|
|
68
|
+
description: z.ZodOptional<z.ZodString>;
|
|
69
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
openGraph: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
title: z.ZodOptional<z.ZodString>;
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
74
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
75
|
+
type: z.ZodOptional<z.ZodString>;
|
|
76
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
twitter: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
card: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
summary: "summary";
|
|
81
|
+
summary_large_image: "summary_large_image";
|
|
82
|
+
app: "app";
|
|
83
|
+
player: "player";
|
|
84
|
+
}>>;
|
|
85
|
+
title: z.ZodOptional<z.ZodString>;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
88
|
+
site: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
schema: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
91
|
+
canonical: z.ZodOptional<z.ZodURL>;
|
|
92
|
+
robots: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/**
|
|
95
|
+
* Resolved Metadata Schema - Final merged metadata for a route
|
|
96
|
+
*/
|
|
97
|
+
export declare const ResolvedMetadataSchema: z.ZodObject<{
|
|
98
|
+
title: z.ZodOptional<z.ZodString>;
|
|
99
|
+
description: z.ZodOptional<z.ZodString>;
|
|
100
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
openGraph: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
title: z.ZodOptional<z.ZodString>;
|
|
103
|
+
description: z.ZodOptional<z.ZodString>;
|
|
104
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
105
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
106
|
+
type: z.ZodOptional<z.ZodString>;
|
|
107
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
twitter: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
card: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
summary: "summary";
|
|
112
|
+
summary_large_image: "summary_large_image";
|
|
113
|
+
app: "app";
|
|
114
|
+
player: "player";
|
|
115
|
+
}>>;
|
|
116
|
+
title: z.ZodOptional<z.ZodString>;
|
|
117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
118
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
119
|
+
site: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
schema: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
122
|
+
canonical: z.ZodOptional<z.ZodURL>;
|
|
123
|
+
robots: z.ZodOptional<z.ZodString>;
|
|
124
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
|
+
resolvedAt: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
/**
|
|
128
|
+
* Metadata Chain Schema - Hierarchical metadata from multiple sources
|
|
129
|
+
*/
|
|
130
|
+
export declare const MetadataChainSchema: z.ZodObject<{
|
|
131
|
+
global: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
title: z.ZodOptional<z.ZodString>;
|
|
133
|
+
description: z.ZodOptional<z.ZodString>;
|
|
134
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
|
+
openGraph: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
title: z.ZodOptional<z.ZodString>;
|
|
137
|
+
description: z.ZodOptional<z.ZodString>;
|
|
138
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
139
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
140
|
+
type: z.ZodOptional<z.ZodString>;
|
|
141
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
twitter: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
card: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
summary: "summary";
|
|
146
|
+
summary_large_image: "summary_large_image";
|
|
147
|
+
app: "app";
|
|
148
|
+
player: "player";
|
|
149
|
+
}>>;
|
|
150
|
+
title: z.ZodOptional<z.ZodString>;
|
|
151
|
+
description: z.ZodOptional<z.ZodString>;
|
|
152
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
153
|
+
site: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
schema: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
156
|
+
canonical: z.ZodOptional<z.ZodURL>;
|
|
157
|
+
robots: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
160
|
+
path: z.ZodString;
|
|
161
|
+
metadata: z.ZodObject<{
|
|
162
|
+
title: z.ZodOptional<z.ZodString>;
|
|
163
|
+
description: z.ZodOptional<z.ZodString>;
|
|
164
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
openGraph: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
title: z.ZodOptional<z.ZodString>;
|
|
167
|
+
description: z.ZodOptional<z.ZodString>;
|
|
168
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
169
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
170
|
+
type: z.ZodOptional<z.ZodString>;
|
|
171
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
twitter: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
card: z.ZodOptional<z.ZodEnum<{
|
|
175
|
+
summary: "summary";
|
|
176
|
+
summary_large_image: "summary_large_image";
|
|
177
|
+
app: "app";
|
|
178
|
+
player: "player";
|
|
179
|
+
}>>;
|
|
180
|
+
title: z.ZodOptional<z.ZodString>;
|
|
181
|
+
description: z.ZodOptional<z.ZodString>;
|
|
182
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
183
|
+
site: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
schema: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
186
|
+
canonical: z.ZodOptional<z.ZodURL>;
|
|
187
|
+
robots: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
title: z.ZodOptional<z.ZodString>;
|
|
192
|
+
description: z.ZodOptional<z.ZodString>;
|
|
193
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
|
+
openGraph: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
title: z.ZodOptional<z.ZodString>;
|
|
196
|
+
description: z.ZodOptional<z.ZodString>;
|
|
197
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
198
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
199
|
+
type: z.ZodOptional<z.ZodString>;
|
|
200
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
twitter: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
card: z.ZodOptional<z.ZodEnum<{
|
|
204
|
+
summary: "summary";
|
|
205
|
+
summary_large_image: "summary_large_image";
|
|
206
|
+
app: "app";
|
|
207
|
+
player: "player";
|
|
208
|
+
}>>;
|
|
209
|
+
title: z.ZodOptional<z.ZodString>;
|
|
210
|
+
description: z.ZodOptional<z.ZodString>;
|
|
211
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
212
|
+
site: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
schema: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
215
|
+
canonical: z.ZodOptional<z.ZodURL>;
|
|
216
|
+
robots: z.ZodOptional<z.ZodString>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
/**
|
|
220
|
+
* Route Discovery Options Schema - Configuration for route discovery
|
|
221
|
+
*/
|
|
222
|
+
export declare const RouteDiscoveryOptionsSchema: z.ZodObject<{
|
|
223
|
+
pagesDirectory: z.ZodDefault<z.ZodString>;
|
|
224
|
+
apiDirectory: z.ZodDefault<z.ZodString>;
|
|
225
|
+
extensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
226
|
+
excludeDirectories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
227
|
+
enableWatching: z.ZodDefault<z.ZodBoolean>;
|
|
228
|
+
developmentMode: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
+
quietMode: z.ZodDefault<z.ZodBoolean>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
/**
|
|
232
|
+
* File System Router Configuration Schema
|
|
233
|
+
*/
|
|
234
|
+
export declare const FileSystemRouterConfigSchema: z.ZodObject<{
|
|
235
|
+
discovery: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
pagesDirectory: z.ZodDefault<z.ZodString>;
|
|
237
|
+
apiDirectory: z.ZodDefault<z.ZodString>;
|
|
238
|
+
extensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
239
|
+
excludeDirectories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
240
|
+
enableWatching: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
developmentMode: z.ZodDefault<z.ZodBoolean>;
|
|
242
|
+
quietMode: z.ZodDefault<z.ZodBoolean>;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
245
|
+
fallbackToManual: z.ZodDefault<z.ZodBoolean>;
|
|
246
|
+
enableCaching: z.ZodDefault<z.ZodBoolean>;
|
|
247
|
+
cacheTTL: z.ZodDefault<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
/**
|
|
250
|
+
* Page File Schema - Information about a discovered page file
|
|
251
|
+
*/
|
|
252
|
+
export declare const PageFileSchema: z.ZodObject<{
|
|
253
|
+
filePath: z.ZodString;
|
|
254
|
+
relativePath: z.ZodString;
|
|
255
|
+
extension: z.ZodString;
|
|
256
|
+
isPrivate: z.ZodBoolean;
|
|
257
|
+
routeGroup: z.ZodOptional<z.ZodString>;
|
|
258
|
+
mtime: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
/**
|
|
261
|
+
* Route Handler Schema - Complete route handler information
|
|
262
|
+
*/
|
|
263
|
+
export declare const RouteHandlerSchema: z.ZodObject<{
|
|
264
|
+
pattern: z.ZodAny;
|
|
265
|
+
handler: z.ZodAny;
|
|
266
|
+
metadata: z.ZodObject<{
|
|
267
|
+
filePath: z.ZodString;
|
|
268
|
+
routeType: z.ZodEnum<{
|
|
269
|
+
static: "static";
|
|
270
|
+
index: "index";
|
|
271
|
+
group: "group";
|
|
272
|
+
dynamic: "dynamic";
|
|
273
|
+
"catch-all": "catch-all";
|
|
274
|
+
}>;
|
|
275
|
+
priority: z.ZodNumber;
|
|
276
|
+
dynamicSegments: z.ZodArray<z.ZodString>;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
}, z.core.$strip>;
|
|
279
|
+
/**
|
|
280
|
+
* Route Cache Entry Schema - Cached route information
|
|
281
|
+
*/
|
|
282
|
+
export declare const RouteCacheEntrySchema: z.ZodObject<{
|
|
283
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
284
|
+
pattern: z.ZodAny;
|
|
285
|
+
filePath: z.ZodString;
|
|
286
|
+
routeType: z.ZodEnum<{
|
|
287
|
+
static: "static";
|
|
288
|
+
index: "index";
|
|
289
|
+
group: "group";
|
|
290
|
+
dynamic: "dynamic";
|
|
291
|
+
"catch-all": "catch-all";
|
|
292
|
+
}>;
|
|
293
|
+
dynamicSegments: z.ZodArray<z.ZodString>;
|
|
294
|
+
priority: z.ZodNumber;
|
|
295
|
+
isPrivate: z.ZodBoolean;
|
|
296
|
+
routeGroup: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
timestamp: z.ZodNumber;
|
|
299
|
+
fileMtimes: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
/**
|
|
302
|
+
* File System API Route Schema - Represents an API endpoint route discovered from file system
|
|
303
|
+
*/
|
|
304
|
+
export declare const FileSystemApiRouteSchema: z.ZodObject<{
|
|
305
|
+
pattern: z.ZodAny;
|
|
306
|
+
filePath: z.ZodString;
|
|
307
|
+
methods: z.ZodArray<z.ZodEnum<{
|
|
308
|
+
GET: "GET";
|
|
309
|
+
POST: "POST";
|
|
310
|
+
PUT: "PUT";
|
|
311
|
+
DELETE: "DELETE";
|
|
312
|
+
PATCH: "PATCH";
|
|
313
|
+
HEAD: "HEAD";
|
|
314
|
+
OPTIONS: "OPTIONS";
|
|
315
|
+
}>>;
|
|
316
|
+
priority: z.ZodNumber;
|
|
317
|
+
dynamicSegments: z.ZodArray<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
/**
|
|
320
|
+
* File System API Module Schema - Exports from an API route file
|
|
321
|
+
*/
|
|
322
|
+
export declare const FileSystemApiModuleSchema: z.ZodObject<{
|
|
323
|
+
GET: z.ZodOptional<z.ZodAny>;
|
|
324
|
+
POST: z.ZodOptional<z.ZodAny>;
|
|
325
|
+
PUT: z.ZodOptional<z.ZodAny>;
|
|
326
|
+
DELETE: z.ZodOptional<z.ZodAny>;
|
|
327
|
+
PATCH: z.ZodOptional<z.ZodAny>;
|
|
328
|
+
HEAD: z.ZodOptional<z.ZodAny>;
|
|
329
|
+
OPTIONS: z.ZodOptional<z.ZodAny>;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
export type RouteType = z.infer<typeof RouteTypeSchema>;
|
|
332
|
+
export type FileSystemRoute = z.infer<typeof FileSystemRouteSchema>;
|
|
333
|
+
export type RoutePageModule = z.infer<typeof RoutePageModuleSchema>;
|
|
334
|
+
export type RouteParams = z.infer<typeof RouteParamsSchema>;
|
|
335
|
+
export type LoaderContext = z.infer<typeof LoaderContextSchema>;
|
|
336
|
+
export type PageProps = z.infer<typeof PagePropsSchema>;
|
|
337
|
+
export type Metadata = z.infer<typeof MetadataSchema>;
|
|
338
|
+
export type ResolvedMetadata = z.infer<typeof ResolvedMetadataSchema>;
|
|
339
|
+
export type MetadataChain = z.infer<typeof MetadataChainSchema>;
|
|
340
|
+
export type RouteDiscoveryOptions = z.infer<typeof RouteDiscoveryOptionsSchema>;
|
|
341
|
+
export type FileSystemRouterConfig = z.infer<typeof FileSystemRouterConfigSchema>;
|
|
342
|
+
export type PageFile = z.infer<typeof PageFileSchema>;
|
|
343
|
+
export type RouteHandler = z.infer<typeof RouteHandlerSchema>;
|
|
344
|
+
export type RouteCacheEntry = z.infer<typeof RouteCacheEntrySchema>;
|
|
345
|
+
export type FileSystemApiRoute = z.infer<typeof FileSystemApiRouteSchema>;
|
|
346
|
+
export type FileSystemApiModule = z.infer<typeof FileSystemApiModuleSchema>;
|
|
347
|
+
/**
|
|
348
|
+
* Page Component Type
|
|
349
|
+
*/
|
|
350
|
+
export type PageComponent<P extends PageProps = PageProps> = ComponentType<P>;
|
|
351
|
+
/**
|
|
352
|
+
* Metadata Generator Function Type
|
|
353
|
+
*/
|
|
354
|
+
export type MetadataGenerator = (params: RouteParams) => Promise<Metadata>;
|
|
355
|
+
/**
|
|
356
|
+
* Page Loader Function Type
|
|
357
|
+
*/
|
|
358
|
+
export type PageLoader = (context: LoaderContext) => Promise<unknown>;
|
|
359
|
+
/**
|
|
360
|
+
* Route Handler Function Type
|
|
361
|
+
*/
|
|
362
|
+
export type RouteHandlerFunction = (request: Request, context: LoaderContext) => Promise<Response>;
|
|
363
|
+
/**
|
|
364
|
+
* File System API Handler Function Type
|
|
365
|
+
*/
|
|
366
|
+
export type FileSystemApiHandler = (request: Request, context: LoaderContext) => Promise<Response>;
|
|
367
|
+
/**
|
|
368
|
+
* Type guard for FileSystemRoute
|
|
369
|
+
*/
|
|
370
|
+
export declare function isFileSystemRoute(data: unknown): data is FileSystemRoute;
|
|
371
|
+
/**
|
|
372
|
+
* Type guard for RoutePageModule
|
|
373
|
+
*/
|
|
374
|
+
export declare function isRoutePageModule(data: unknown): data is RoutePageModule;
|
|
375
|
+
/**
|
|
376
|
+
* Type guard for Metadata
|
|
377
|
+
*/
|
|
378
|
+
export declare function isMetadata(data: unknown): data is Metadata;
|
|
379
|
+
/**
|
|
380
|
+
* Type guard for RouteParams
|
|
381
|
+
*/
|
|
382
|
+
export declare function isRouteParams(data: unknown): data is RouteParams;
|
|
383
|
+
/**
|
|
384
|
+
* Type guard for FileSystemApiModule
|
|
385
|
+
*/
|
|
386
|
+
export declare function isFileSystemApiModule(data: unknown): data is FileSystemApiModule;
|
|
387
|
+
export type { ExtractRouteParams, ExtractOptionalParams, RouteParameters, TypedPageComponent, TypedPageComponentWithData, TypedMetadataGenerator, TypedPageLoader, TypedApiHandler, TypedApiModule, HasDynamicSegments, HasCatchAllSegments, HasOptionalSegments, CountDynamicSegments, ValidRoutePattern, ValidRouteExtension, PageComponentProps, } from '../types/routing.ts';
|
|
388
|
+
export { isValidRouteParams, isValidPageProps, isValidRoutePattern, validatePageComponent, createTypedPageComponent, createTypedMetadataGenerator, createTypedPageLoader, createTypedApiHandler, } from '../types/routing.ts';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IslandDirective } from './island-prop.d.ts';
|
|
2
|
+
import type { ComponentType } from 'preact';
|
|
3
|
+
/**
|
|
4
|
+
* Cast a cross-framework component (Vue, Svelte, Lit, Solid) to be usable
|
|
5
|
+
* in Preact JSX with the `island` prop and correct prop types.
|
|
6
|
+
*
|
|
7
|
+
* The Vite transform handles these components at build time — this cast is
|
|
8
|
+
* purely for TypeScript's benefit.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* import _VueCounter from '../islands/VueCounter.vue';
|
|
12
|
+
* const VueCounter = asIsland<{ initialCount?: number }>(_VueCounter);
|
|
13
|
+
* // Now usable as: <VueCounter island={{ condition: 'on:visible' }} initialCount={0} />
|
|
14
|
+
*/
|
|
15
|
+
export declare function asIsland<P extends Record<string, unknown> = Record<string, unknown>>(_component: unknown): ComponentType<P & {
|
|
16
|
+
island?: IslandDirective;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { LayoutContext, LayoutRoute, LayoutHandler, LayoutProps, LayoutDiscoveryOptions, RouteInfo, LayoutRule, LayoutConfig, IslandState, PersistentIslandProps, LayoutErrorInfo, LayoutErrorBoundaryProps, ErrorRecoveryStrategy, StreamingLayoutProps, StreamingComponent, ResolvedLayout, LayoutLoader } from '../schemas/layout.ts';
|
|
2
|
+
import type { ComponentType, ComponentChildren } from 'preact';
|
|
3
|
+
export type { LayoutContext, LayoutData, LayoutRoute, LayoutHandler, LayoutProps, LayoutDiscoveryOptions, RouteInfo, LayoutRule, LayoutConfig, IslandState, PersistentIslandProps, PersistentIslandContext, LayoutErrorInfo, LayoutErrorBoundaryProps, ErrorRecoveryStrategy, StreamingLayoutProps, StreamingComponent, ResolvedLayout, LayoutCache, EnhancedLayoutContext, LayoutLoader, LayoutMatcherFunction, LayoutErrorHandler, LayoutRetryFunction, LayoutFallbackRenderer, IslandStateSaver, IslandStateLoader, IslandStateClearer, StreamingReadyCheck, } from '../schemas/layout.ts';
|
|
4
|
+
export type { ComponentType, ComponentChildren } from 'preact';
|
|
5
|
+
export { LayoutDiscovery } from '../core/layout/layout-discovery.ts';
|
|
6
|
+
export { LayoutDataLoader } from '../core/layout/layout-data-loader.ts';
|
|
7
|
+
export { LayoutMatcher as LayoutMatcherClass } from '../core/layout/layout-matcher.ts';
|
|
8
|
+
export { LayoutComposer } from '../core/layout/layout-composer.ts';
|
|
9
|
+
export { IslandPersistence, defaultIslandPersistence } from '../core/islands/island-persistence.ts';
|
|
10
|
+
export { IslandStateSerializer } from '../core/islands/island-state-serializer.ts';
|
|
11
|
+
export { createPersistentIslandContext, usePersistentIslandContext, PersistentIslandProvider, } from '../core/islands/persistent-island-context.tsx';
|
|
12
|
+
export { PersistentIsland } from '../components/PersistentIsland.tsx';
|
|
13
|
+
export { LayoutErrorBoundary } from '../components/LayoutErrorBoundary.tsx';
|
|
14
|
+
export { LayoutDataErrorBoundary } from '../components/LayoutDataErrorBoundary.tsx';
|
|
15
|
+
export { IslandErrorBoundary, withIslandErrorBoundary } from '../components/IslandErrorBoundary.tsx';
|
|
16
|
+
export { StreamingLayout, StreamingSuspense, withStreaming, useStreamingState, } from '../components/StreamingLayout.tsx';
|
|
17
|
+
export { EnhancedLayoutResolver, createEnhancedLayoutResolver, EnhancedLayoutResolverUtils, type EnhancedLayoutResolverOptions, } from '../core/layout/enhanced-layout-resolver.ts';
|
|
18
|
+
export { LayoutCacheManager, type CacheEntry, type CacheStats, type CacheConfig, } from '../core/layout/layout-cache-manager.ts';
|
|
19
|
+
/**
|
|
20
|
+
* Layout Discovery Interface
|
|
21
|
+
*/
|
|
22
|
+
export interface ILayoutDiscovery {
|
|
23
|
+
discoverLayouts(routePath: string): Promise<LayoutRoute[]>;
|
|
24
|
+
buildLayoutChain(url: URL): Promise<LayoutHandler[]>;
|
|
25
|
+
setWatching(enabled: boolean): void;
|
|
26
|
+
getOptions(): LayoutDiscoveryOptions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Layout Matcher Interface
|
|
30
|
+
*/
|
|
31
|
+
export interface ILayoutMatcher {
|
|
32
|
+
addRule(rule: LayoutRule): void;
|
|
33
|
+
removeRule(rule: LayoutRule): void;
|
|
34
|
+
shouldApplyLayout(layoutPath: string, route: RouteInfo): boolean;
|
|
35
|
+
getRules(): LayoutRule[];
|
|
36
|
+
clearRules(): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Layout Composer Interface
|
|
40
|
+
*/
|
|
41
|
+
export interface ILayoutComposer {
|
|
42
|
+
resolveLayouts(routePath: string, pageModule: PageModule): Promise<LayoutHandler[]>;
|
|
43
|
+
applyConfiguration(layouts: LayoutHandler[], config: LayoutConfig): Promise<LayoutHandler[]>;
|
|
44
|
+
validateLayoutConfig(config: LayoutConfig): {
|
|
45
|
+
valid: boolean;
|
|
46
|
+
errors: string[];
|
|
47
|
+
};
|
|
48
|
+
clearCache(): void;
|
|
49
|
+
getCompositionStats(): {
|
|
50
|
+
customLayoutCacheSize: number;
|
|
51
|
+
discoveryStats: {
|
|
52
|
+
layoutCount: number;
|
|
53
|
+
routeCacheCount: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Island Persistence Interface
|
|
59
|
+
*/
|
|
60
|
+
export interface IIslandPersistence {
|
|
61
|
+
saveState(id: string, state: IslandState): void;
|
|
62
|
+
loadState(id: string): IslandState | null;
|
|
63
|
+
clearState(id: string): void;
|
|
64
|
+
hasState(id: string): boolean;
|
|
65
|
+
getStoredIds(): string[];
|
|
66
|
+
clearAllStates(): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Layout Error Recovery Interface
|
|
70
|
+
*/
|
|
71
|
+
export interface ILayoutErrorRecovery {
|
|
72
|
+
handleLayoutError(error: Error, context: LayoutContext): Promise<Response>;
|
|
73
|
+
registerStrategy(errorType: string, strategy: ErrorRecoveryStrategy): void;
|
|
74
|
+
getStrategy(error: Error): ErrorRecoveryStrategy | null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Layout Streaming Interface
|
|
78
|
+
*/
|
|
79
|
+
export interface ILayoutStreaming {
|
|
80
|
+
renderWithStreaming(layout: LayoutHandler, props: LayoutProps): Promise<ReadableStream>;
|
|
81
|
+
isStreamingSupported(): boolean;
|
|
82
|
+
createStreamingResponse(components: StreamingComponent[]): ReadableStream;
|
|
83
|
+
generateSkeleton(component: StreamingComponent): string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Enhanced Layout Resolver Interface
|
|
87
|
+
*/
|
|
88
|
+
export interface IEnhancedLayoutResolver {
|
|
89
|
+
resolveAndRender(routePath: string, pageModule: PageModule, context: LayoutContext): Promise<ResolvedLayout>;
|
|
90
|
+
getCachedResolution(routePath: string): ResolvedLayout | null;
|
|
91
|
+
clearCache(): void;
|
|
92
|
+
setCaching(enabled: boolean): void;
|
|
93
|
+
}
|
|
94
|
+
export interface ILayoutComponent {
|
|
95
|
+
props: LayoutProps;
|
|
96
|
+
layoutLoader?: LayoutLoader;
|
|
97
|
+
layoutConfig?: LayoutConfig;
|
|
98
|
+
}
|
|
99
|
+
export interface IPersistentIslandComponent {
|
|
100
|
+
props: PersistentIslandProps;
|
|
101
|
+
saveState(): void;
|
|
102
|
+
loadState(): void;
|
|
103
|
+
clearState(): void;
|
|
104
|
+
hasState(): boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface ILayoutErrorBoundaryComponent {
|
|
107
|
+
props: LayoutErrorBoundaryProps;
|
|
108
|
+
handleRetry(): void;
|
|
109
|
+
getErrorState(): {
|
|
110
|
+
hasError: boolean;
|
|
111
|
+
error?: Error;
|
|
112
|
+
};
|
|
113
|
+
resetErrorState(): void;
|
|
114
|
+
}
|
|
115
|
+
export interface IStreamingLayoutComponent {
|
|
116
|
+
props: StreamingLayoutProps;
|
|
117
|
+
isReady(): Promise<boolean>;
|
|
118
|
+
renderFallback(): ComponentChildren;
|
|
119
|
+
getPriority(): number;
|
|
120
|
+
}
|
|
121
|
+
export interface LayoutModule {
|
|
122
|
+
default: ComponentType<LayoutProps>;
|
|
123
|
+
layoutLoader?: LayoutLoader;
|
|
124
|
+
layoutConfig?: LayoutConfig;
|
|
125
|
+
ErrorBoundary?: ComponentType<LayoutErrorBoundaryProps>;
|
|
126
|
+
}
|
|
127
|
+
export interface PageModule {
|
|
128
|
+
default: ComponentType<Record<string, unknown>>;
|
|
129
|
+
layoutConfig?: LayoutConfig;
|
|
130
|
+
frontmatter?: Record<string, unknown>;
|
|
131
|
+
loader?: (ctx: LayoutContext) => Promise<Record<string, unknown>>;
|
|
132
|
+
}
|
|
133
|
+
export interface LayoutResolutionContext {
|
|
134
|
+
route: RouteInfo;
|
|
135
|
+
pageModule: PageModule;
|
|
136
|
+
layoutContext: LayoutContext;
|
|
137
|
+
cachingEnabled: boolean;
|
|
138
|
+
streamingEnabled: boolean;
|
|
139
|
+
developmentMode: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface LayoutPerformanceMetrics {
|
|
142
|
+
discoveryTime: number;
|
|
143
|
+
dataLoadingTime: number;
|
|
144
|
+
renderingTime: number;
|
|
145
|
+
totalTime: number;
|
|
146
|
+
layoutCount: number;
|
|
147
|
+
cacheHit: boolean;
|
|
148
|
+
memoryUsage?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface LayoutDebugInfo {
|
|
151
|
+
resolutionChain: string[];
|
|
152
|
+
appliedRules: LayoutRule[];
|
|
153
|
+
skippedLayouts: string[];
|
|
154
|
+
errors: LayoutErrorInfo[];
|
|
155
|
+
metrics: LayoutPerformanceMetrics;
|
|
156
|
+
cacheInfo: {
|
|
157
|
+
hit: boolean;
|
|
158
|
+
key: string;
|
|
159
|
+
size: number;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export type LayoutEventType = 'layout-discovered' | 'layout-loaded' | 'layout-rendered' | 'layout-error' | 'layout-cached' | 'island-state-saved' | 'island-state-loaded' | 'streaming-started' | 'streaming-completed';
|
|
163
|
+
export interface LayoutEventData {
|
|
164
|
+
type: LayoutEventType;
|
|
165
|
+
timestamp: number;
|
|
166
|
+
layoutPath?: string;
|
|
167
|
+
error?: Error;
|
|
168
|
+
metrics?: LayoutPerformanceMetrics;
|
|
169
|
+
data?: Record<string, unknown>;
|
|
170
|
+
}
|
|
171
|
+
export type LayoutEventHandler = (event: LayoutEventData) => void;
|
|
172
|
+
export interface ILayoutEventEmitter {
|
|
173
|
+
on(event: LayoutEventType, handler: LayoutEventHandler): void;
|
|
174
|
+
off(event: LayoutEventType, handler: LayoutEventHandler): void;
|
|
175
|
+
emit(event: LayoutEventType, data?: Record<string, unknown>): void;
|
|
176
|
+
removeAllListeners(): void;
|
|
177
|
+
}
|