@useavalon/avalon 0.1.23 → 0.1.24
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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{RenderOptionsSchema as t}from"./core.js";import{LayoutContextSchema as n,LayoutDataSchema as r,LayoutHandlerSchema as i,LayoutDiscoveryOptionsSchema as a,LayoutConfigSchema as o,ResolvedLayoutSchema as s}from"./layout.js";import{FileSystemRouteSchema as c,RoutePageModuleSchema as l,RouteDiscoveryOptionsSchema as u,FileSystemRouterConfigSchema as d,MetadataSchema as f,ResolvedMetadataSchema as p}from"./routing.js";export*from"./core.js";export*from"./api.js";export*from"./layout.js";export*from"./routing.js";export class ValidationError extends Error{constructor(e,t){super(e),this.zodError=t,this.name=`ValidationError`}getFormattedErrors(){return this.zodError.issues.map(e=>`${e.path.length>0?`${e.path.join(`.`)}: `:``}${e.message}`)}getErrorMessage(){return this.getFormattedErrors().join(`; `)}}export function createValidationError(e,t){return new ValidationError(e,t)}export function safeValidate(e,t,n=`Validation failed`){let r=e.safeParse(t);return r.success?{success:!0,data:r.data}:{success:!1,error:createValidationError(n,r.error)}}export function validate(e,t,n=`Validation failed`){let r=e.safeParse(t);if(r.success)return r.data;throw createValidationError(n,r.error)}export const validators={renderOptions:e=>validate(t,e,`Invalid render options`),layoutContext:e=>validate(n,e,`Invalid layout context`),layoutData:e=>validate(r,e,`Invalid layout data`),layoutHandler:e=>validate(i,e,`Invalid layout handler`),layoutDiscoveryOptions:e=>validate(a,e,`Invalid layout discovery options`),layoutConfig:e=>validate(o,e,`Invalid layout config`),resolvedLayout:e=>validate(s,e,`Invalid resolved layout`),fileSystemRoute:e=>validate(c,e,`Invalid file system route`),routePageModule:e=>validate(l,e,`Invalid route page module`),routeDiscoveryOptions:e=>validate(u,e,`Invalid route discovery options`),fileSystemRouterConfig:e=>validate(d,e,`Invalid file system router config`),metadata:e=>validate(f,e,`Invalid metadata`),resolvedMetadata:e=>validate(p,e,`Invalid resolved metadata`)};export const safeValidators={renderOptions:e=>safeValidate(t,e,`Invalid render options`),layoutContext:e=>safeValidate(n,e,`Invalid layout context`),layoutData:e=>safeValidate(r,e,`Invalid layout data`),layoutHandler:e=>safeValidate(i,e,`Invalid layout handler`),layoutDiscoveryOptions:e=>safeValidate(a,e,`Invalid layout discovery options`),layoutConfig:e=>safeValidate(o,e,`Invalid layout config`),resolvedLayout:e=>safeValidate(s,e,`Invalid resolved layout`),fileSystemRoute:e=>safeValidate(c,e,`Invalid file system route`),routePageModule:e=>safeValidate(l,e,`Invalid route page module`),routeDiscoveryOptions:e=>safeValidate(u,e,`Invalid route discovery options`),fileSystemRouterConfig:e=>safeValidate(d,e,`Invalid file system router config`),metadata:e=>safeValidate(f,e,`Invalid metadata`),resolvedMetadata:e=>safeValidate(p,e,`Invalid resolved metadata`)};export const devValidators={renderOptionsSoft:(e,t=`unknown`)=>{let n=safeValidators.renderOptions(e);return n.success?!0:(console.warn(`Render options validation warning in ${t}:`,n.error
|
|
1
|
+
import{z as e}from"zod";import{RenderOptionsSchema as t}from"./core.js";import{LayoutContextSchema as n,LayoutDataSchema as r,LayoutHandlerSchema as i,LayoutDiscoveryOptionsSchema as a,LayoutConfigSchema as o,ResolvedLayoutSchema as s}from"./layout.js";import{FileSystemRouteSchema as c,RoutePageModuleSchema as l,RouteDiscoveryOptionsSchema as u,FileSystemRouterConfigSchema as d,MetadataSchema as f,ResolvedMetadataSchema as p}from"./routing.js";export*from"./core.js";export*from"./api.js";export*from"./layout.js";export*from"./routing.js";export class ValidationError extends Error{constructor(e,t){super(e),this.zodError=t,this.name=`ValidationError`}getFormattedErrors(){return this.zodError.issues.map(e=>`${e.path.length>0?`${e.path.join(`.`)}: `:``}${e.message}`)}getErrorMessage(){return this.getFormattedErrors().join(`; `)}}export function createValidationError(e,t){return new ValidationError(e,t)}export function safeValidate(e,t,n=`Validation failed`){let r=e.safeParse(t);return r.success?{success:!0,data:r.data}:{success:!1,error:createValidationError(n,r.error)}}export function validate(e,t,n=`Validation failed`){let r=e.safeParse(t);if(r.success)return r.data;throw createValidationError(n,r.error)}export const validators={renderOptions:e=>validate(t,e,`Invalid render options`),layoutContext:e=>validate(n,e,`Invalid layout context`),layoutData:e=>validate(r,e,`Invalid layout data`),layoutHandler:e=>validate(i,e,`Invalid layout handler`),layoutDiscoveryOptions:e=>validate(a,e,`Invalid layout discovery options`),layoutConfig:e=>validate(o,e,`Invalid layout config`),resolvedLayout:e=>validate(s,e,`Invalid resolved layout`),fileSystemRoute:e=>validate(c,e,`Invalid file system route`),routePageModule:e=>validate(l,e,`Invalid route page module`),routeDiscoveryOptions:e=>validate(u,e,`Invalid route discovery options`),fileSystemRouterConfig:e=>validate(d,e,`Invalid file system router config`),metadata:e=>validate(f,e,`Invalid metadata`),resolvedMetadata:e=>validate(p,e,`Invalid resolved metadata`)};export const safeValidators={renderOptions:e=>safeValidate(t,e,`Invalid render options`),layoutContext:e=>safeValidate(n,e,`Invalid layout context`),layoutData:e=>safeValidate(r,e,`Invalid layout data`),layoutHandler:e=>safeValidate(i,e,`Invalid layout handler`),layoutDiscoveryOptions:e=>safeValidate(a,e,`Invalid layout discovery options`),layoutConfig:e=>safeValidate(o,e,`Invalid layout config`),resolvedLayout:e=>safeValidate(s,e,`Invalid resolved layout`),fileSystemRoute:e=>safeValidate(c,e,`Invalid file system route`),routePageModule:e=>safeValidate(l,e,`Invalid route page module`),routeDiscoveryOptions:e=>safeValidate(u,e,`Invalid route discovery options`),fileSystemRouterConfig:e=>safeValidate(d,e,`Invalid file system router config`),metadata:e=>safeValidate(f,e,`Invalid metadata`),resolvedMetadata:e=>safeValidate(p,e,`Invalid resolved metadata`)};export const devValidators={renderOptionsSoft:(e,t=`unknown`)=>{let n=safeValidators.renderOptions(e);return n.success?!0:(console.warn(`Render options validation warning in ${t}:`,n.error?.getErrorMessage?.()??`unknown error`),!1)}};export function isValidRenderOptions(e){return safeValidators.renderOptions(e).success}export function isValidFileSystemRoute(e){return safeValidators.fileSystemRoute(e).success}export function isValidRoutePageModule(e){return safeValidators.routePageModule(e).success}export function isValidRouteDiscoveryOptions(e){return safeValidators.routeDiscoveryOptions(e).success}export function isValidFileSystemRouterConfig(e){return safeValidators.fileSystemRouterConfig(e).success}export function isValidMetadata(e){return safeValidators.metadata(e).success}export function isValidResolvedMetadata(e){return safeValidators.resolvedMetadata(e).success}export function validateBatch(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))try{n[i]=validate(a,t[i],`Invalid ${String(i)}`)}catch(e){e instanceof ValidationError?r.push(`${String(i)}: ${e.getErrorMessage()}`):r.push(`${String(i)}: Unknown validation error`)}if(r.length>0)throw Error(`Batch validation failed: ${r.join(`; `)}`);return n}export function safeValidateBatch(t,n){try{return{success:!0,data:validateBatch(t,n)}}catch(t){return{success:!1,error:t instanceof ValidationError?t:createValidationError(`Batch validation failed`,new e.ZodError([{code:`custom`,message:String(t),path:[]}]))}}}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ComponentChildren } from 'preact';
|
|
3
|
+
/**
|
|
4
|
+
* Layout Context Schema - Contains request information and state for layout processing
|
|
5
|
+
*/
|
|
6
|
+
export declare const LayoutContextSchema: z.ZodObject<{
|
|
7
|
+
request: z.ZodCustom<Request, Request>;
|
|
8
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
9
|
+
query: z.ZodCustom<URLSearchParams, URLSearchParams>;
|
|
10
|
+
state: z.ZodCustom<Map<string, unknown>, Map<string, unknown>>;
|
|
11
|
+
middlewareContext: z.ZodOptional<z.ZodAny>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
/**
|
|
14
|
+
* Layout Data Schema - Flexible data structure for layout loaders
|
|
15
|
+
*/
|
|
16
|
+
export declare const LayoutDataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Layout Route Schema - Represents a discovered layout file with routing information
|
|
19
|
+
*/
|
|
20
|
+
export declare const LayoutRouteSchema: z.ZodObject<{
|
|
21
|
+
pattern: z.ZodCustom<URLPattern, URLPattern>;
|
|
22
|
+
layoutPath: z.ZodString;
|
|
23
|
+
priority: z.ZodNumber;
|
|
24
|
+
type: z.ZodEnum<{
|
|
25
|
+
root: "root";
|
|
26
|
+
nested: "nested";
|
|
27
|
+
}>;
|
|
28
|
+
depth: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
/**
|
|
31
|
+
* Layout Handler Schema - Complete layout information including component and loader
|
|
32
|
+
*/
|
|
33
|
+
export declare const LayoutHandlerSchema: z.ZodObject<{
|
|
34
|
+
component: z.ZodAny;
|
|
35
|
+
loader: z.ZodOptional<z.ZodAny>;
|
|
36
|
+
path: z.ZodString;
|
|
37
|
+
priority: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
/**
|
|
40
|
+
* Layout Props Schema - Props passed to layout components
|
|
41
|
+
*/
|
|
42
|
+
export declare const LayoutPropsSchema: z.ZodObject<{
|
|
43
|
+
children: z.ZodAny;
|
|
44
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
45
|
+
frontmatter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
46
|
+
route: z.ZodObject<{
|
|
47
|
+
path: z.ZodString;
|
|
48
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
49
|
+
query: z.ZodCustom<URLSearchParams, URLSearchParams>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
/**
|
|
53
|
+
* Layout Discovery Options Schema
|
|
54
|
+
*/
|
|
55
|
+
export declare const LayoutDiscoveryOptionsSchema: z.ZodObject<{
|
|
56
|
+
baseDirectory: z.ZodString;
|
|
57
|
+
filePattern: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
58
|
+
excludeDirectories: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
59
|
+
enableWatching: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
60
|
+
developmentMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Route Info Schema - Information about the current route for conditional rendering
|
|
64
|
+
*/
|
|
65
|
+
export declare const RouteInfoSchema: z.ZodObject<{
|
|
66
|
+
path: z.ZodString;
|
|
67
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
68
|
+
method: z.ZodString;
|
|
69
|
+
headers: z.ZodCustom<Headers, Headers>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
/**
|
|
72
|
+
* Layout Rule Schema - Rules for conditional layout rendering
|
|
73
|
+
*/
|
|
74
|
+
export declare const LayoutRuleSchema: z.ZodObject<{
|
|
75
|
+
matches: z.ZodAny;
|
|
76
|
+
apply: z.ZodBoolean;
|
|
77
|
+
priority: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
/**
|
|
80
|
+
* Layout Config Schema - Page-level layout composition control
|
|
81
|
+
*/
|
|
82
|
+
export declare const LayoutConfigSchema: z.ZodObject<{
|
|
83
|
+
skipLayouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
replaceLayout: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
onlyLayouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
customLayout: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
/**
|
|
89
|
+
* Island State Schema - State data for persistent islands
|
|
90
|
+
*/
|
|
91
|
+
export declare const IslandStateSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Persistent Island Props Schema
|
|
94
|
+
*/
|
|
95
|
+
export declare const PersistentIslandPropsSchema: z.ZodObject<{
|
|
96
|
+
persistentId: z.ZodString;
|
|
97
|
+
children: z.ZodAny;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
/**
|
|
100
|
+
* Persistent Island Context Schema
|
|
101
|
+
*/
|
|
102
|
+
export declare const PersistentIslandContextSchema: z.ZodObject<{
|
|
103
|
+
saveState: z.ZodAny;
|
|
104
|
+
loadState: z.ZodAny;
|
|
105
|
+
clearState: z.ZodAny;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
/**
|
|
108
|
+
* Layout Error Info Schema
|
|
109
|
+
*/
|
|
110
|
+
export declare const LayoutErrorInfoSchema: z.ZodObject<{
|
|
111
|
+
layoutPath: z.ZodString;
|
|
112
|
+
errorType: z.ZodEnum<{
|
|
113
|
+
island: "island";
|
|
114
|
+
component: "component";
|
|
115
|
+
loader: "loader";
|
|
116
|
+
rendering: "rendering";
|
|
117
|
+
}>;
|
|
118
|
+
timestamp: z.ZodNumber;
|
|
119
|
+
componentStack: z.ZodOptional<z.ZodString>;
|
|
120
|
+
errorBoundary: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
/**
|
|
123
|
+
* Layout Error Boundary Props Schema
|
|
124
|
+
*/
|
|
125
|
+
export declare const LayoutErrorBoundaryPropsSchema: z.ZodObject<{
|
|
126
|
+
children: z.ZodAny;
|
|
127
|
+
fallback: z.ZodAny;
|
|
128
|
+
onError: z.ZodOptional<z.ZodAny>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
/**
|
|
131
|
+
* Error Recovery Strategy Schema
|
|
132
|
+
*/
|
|
133
|
+
export declare const ErrorRecoveryStrategySchema: z.ZodObject<{
|
|
134
|
+
type: z.ZodEnum<{
|
|
135
|
+
redirect: "redirect";
|
|
136
|
+
skip: "skip";
|
|
137
|
+
fallback: "fallback";
|
|
138
|
+
retry: "retry";
|
|
139
|
+
}>;
|
|
140
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
fallbackComponent: z.ZodOptional<z.ZodAny>;
|
|
142
|
+
redirectUrl: z.ZodOptional<z.ZodURL>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
/**
|
|
145
|
+
* Streaming Layout Props Schema
|
|
146
|
+
*/
|
|
147
|
+
export declare const StreamingLayoutPropsSchema: z.ZodObject<{
|
|
148
|
+
children: z.ZodAny;
|
|
149
|
+
fallback: z.ZodOptional<z.ZodAny>;
|
|
150
|
+
priority: z.ZodDefault<z.ZodEnum<{
|
|
151
|
+
high: "high";
|
|
152
|
+
medium: "medium";
|
|
153
|
+
low: "low";
|
|
154
|
+
}>>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
/**
|
|
157
|
+
* Streaming Component Schema
|
|
158
|
+
*/
|
|
159
|
+
export declare const StreamingComponentSchema: z.ZodObject<{
|
|
160
|
+
component: z.ZodAny;
|
|
161
|
+
fallback: z.ZodAny;
|
|
162
|
+
priority: z.ZodNumber;
|
|
163
|
+
isReady: z.ZodAny;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
/**
|
|
166
|
+
* Resolved Layout Schema - Complete layout resolution result
|
|
167
|
+
*/
|
|
168
|
+
export declare const ResolvedLayoutSchema: z.ZodObject<{
|
|
169
|
+
handlers: z.ZodArray<z.ZodObject<{
|
|
170
|
+
component: z.ZodAny;
|
|
171
|
+
loader: z.ZodOptional<z.ZodAny>;
|
|
172
|
+
path: z.ZodString;
|
|
173
|
+
priority: z.ZodNumber;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
dataLoaders: z.ZodArray<z.ZodAny>;
|
|
176
|
+
errorBoundaries: z.ZodArray<z.ZodAny>;
|
|
177
|
+
streamingComponents: z.ZodArray<z.ZodObject<{
|
|
178
|
+
component: z.ZodAny;
|
|
179
|
+
fallback: z.ZodAny;
|
|
180
|
+
priority: z.ZodNumber;
|
|
181
|
+
isReady: z.ZodAny;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
metadata: z.ZodObject<{
|
|
184
|
+
totalLayouts: z.ZodNumber;
|
|
185
|
+
resolutionTime: z.ZodNumber;
|
|
186
|
+
cacheHit: z.ZodBoolean;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
/**
|
|
190
|
+
* Layout Cache Schema
|
|
191
|
+
*/
|
|
192
|
+
export declare const LayoutCacheSchema: z.ZodObject<{
|
|
193
|
+
resolved: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
194
|
+
handlers: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
195
|
+
data: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
196
|
+
ttl: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
/**
|
|
199
|
+
* Enhanced Layout Context Schema - Extended context with layout-specific information
|
|
200
|
+
*/
|
|
201
|
+
export declare const EnhancedLayoutContextSchema: z.ZodObject<{
|
|
202
|
+
request: z.ZodCustom<Request, Request>;
|
|
203
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
204
|
+
query: z.ZodCustom<URLSearchParams, URLSearchParams>;
|
|
205
|
+
state: z.ZodCustom<Map<string, unknown>, Map<string, unknown>>;
|
|
206
|
+
middlewareContext: z.ZodOptional<z.ZodAny>;
|
|
207
|
+
layouts: z.ZodArray<z.ZodObject<{
|
|
208
|
+
component: z.ZodAny;
|
|
209
|
+
loader: z.ZodOptional<z.ZodAny>;
|
|
210
|
+
path: z.ZodString;
|
|
211
|
+
priority: z.ZodNumber;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
parentData: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
214
|
+
islandStates: z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>;
|
|
215
|
+
streamingEnabled: z.ZodBoolean;
|
|
216
|
+
errorBoundaries: z.ZodArray<z.ZodAny>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
export type LayoutContext = z.infer<typeof LayoutContextSchema>;
|
|
219
|
+
export type LayoutData = z.infer<typeof LayoutDataSchema>;
|
|
220
|
+
export type LayoutRoute = z.infer<typeof LayoutRouteSchema>;
|
|
221
|
+
export type LayoutHandler = z.infer<typeof LayoutHandlerSchema>;
|
|
222
|
+
export type LayoutProps = z.infer<typeof LayoutPropsSchema>;
|
|
223
|
+
export type LayoutDiscoveryOptions = z.infer<typeof LayoutDiscoveryOptionsSchema>;
|
|
224
|
+
export type RouteInfo = z.infer<typeof RouteInfoSchema>;
|
|
225
|
+
export type LayoutRule = z.infer<typeof LayoutRuleSchema>;
|
|
226
|
+
export type LayoutConfig = z.infer<typeof LayoutConfigSchema>;
|
|
227
|
+
export type IslandState = z.infer<typeof IslandStateSchema>;
|
|
228
|
+
export type PersistentIslandProps = z.infer<typeof PersistentIslandPropsSchema>;
|
|
229
|
+
export type PersistentIslandContext = z.infer<typeof PersistentIslandContextSchema>;
|
|
230
|
+
export type LayoutErrorInfo = z.infer<typeof LayoutErrorInfoSchema>;
|
|
231
|
+
export type LayoutErrorBoundaryProps = z.infer<typeof LayoutErrorBoundaryPropsSchema>;
|
|
232
|
+
export type ErrorRecoveryStrategy = z.infer<typeof ErrorRecoveryStrategySchema>;
|
|
233
|
+
export type StreamingLayoutProps = z.infer<typeof StreamingLayoutPropsSchema>;
|
|
234
|
+
export type StreamingComponent = z.infer<typeof StreamingComponentSchema>;
|
|
235
|
+
export type ResolvedLayout = z.infer<typeof ResolvedLayoutSchema>;
|
|
236
|
+
export type LayoutCache = z.infer<typeof LayoutCacheSchema>;
|
|
237
|
+
export type EnhancedLayoutContext = z.infer<typeof EnhancedLayoutContextSchema>;
|
|
238
|
+
/**
|
|
239
|
+
* Layout Loader Function Type
|
|
240
|
+
* Loads data for a specific layout component
|
|
241
|
+
*/
|
|
242
|
+
export type LayoutLoader = (ctx: LayoutContext) => Promise<LayoutData>;
|
|
243
|
+
/**
|
|
244
|
+
* Layout Matcher Function Type
|
|
245
|
+
* Determines if a layout should be applied based on route information and optional layout path
|
|
246
|
+
*/
|
|
247
|
+
export type LayoutMatcherFunction = (route: RouteInfo, layoutPath?: string) => boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Layout Error Handler Function Type
|
|
250
|
+
* Handles errors that occur during layout processing
|
|
251
|
+
*/
|
|
252
|
+
export type LayoutErrorHandler = (error: Error, errorInfo: LayoutErrorInfo) => void;
|
|
253
|
+
/**
|
|
254
|
+
* Layout Retry Function Type
|
|
255
|
+
* Function to retry failed layout operations
|
|
256
|
+
*/
|
|
257
|
+
export type LayoutRetryFunction = () => void;
|
|
258
|
+
/**
|
|
259
|
+
* Layout Fallback Renderer Function Type
|
|
260
|
+
* Renders fallback UI when layout errors occur
|
|
261
|
+
*/
|
|
262
|
+
export type LayoutFallbackRenderer = (error: Error, retry: LayoutRetryFunction) => ComponentChildren;
|
|
263
|
+
/**
|
|
264
|
+
* Island State Saver Function Type
|
|
265
|
+
* Saves island state to persistence layer
|
|
266
|
+
*/
|
|
267
|
+
export type IslandStateSaver = (state: IslandState) => void;
|
|
268
|
+
/**
|
|
269
|
+
* Island State Loader Function Type
|
|
270
|
+
* Loads island state from persistence layer
|
|
271
|
+
*/
|
|
272
|
+
export type IslandStateLoader = () => IslandState | null;
|
|
273
|
+
/**
|
|
274
|
+
* Island State Clearer Function Type
|
|
275
|
+
* Clears island state from persistence layer
|
|
276
|
+
*/
|
|
277
|
+
export type IslandStateClearer = () => void;
|
|
278
|
+
/**
|
|
279
|
+
* Streaming Component Ready Check Function Type
|
|
280
|
+
* Checks if a streaming component is ready to render
|
|
281
|
+
*/
|
|
282
|
+
export type StreamingReadyCheck = () => Promise<boolean>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export * from '../routing.ts';
|
|
2
|
+
export declare const routingValidators: {
|
|
3
|
+
readonly fileSystemRoute: (data: unknown) => {
|
|
4
|
+
pattern: any;
|
|
5
|
+
filePath: string;
|
|
6
|
+
routeType: "static" | "index" | "group" | "dynamic" | "catch-all";
|
|
7
|
+
dynamicSegments: string[];
|
|
8
|
+
priority: number;
|
|
9
|
+
isPrivate: boolean;
|
|
10
|
+
routeGroup?: string;
|
|
11
|
+
};
|
|
12
|
+
readonly routePageModule: (data: unknown) => {
|
|
13
|
+
default: any;
|
|
14
|
+
layoutConfig?: any;
|
|
15
|
+
generateMetadata?: any;
|
|
16
|
+
loader?: any;
|
|
17
|
+
frontmatter?: Record<string, any>;
|
|
18
|
+
};
|
|
19
|
+
readonly routeDiscoveryOptions: (data: unknown) => {
|
|
20
|
+
pagesDirectory: string;
|
|
21
|
+
apiDirectory: string;
|
|
22
|
+
extensions: string[];
|
|
23
|
+
excludeDirectories: string[];
|
|
24
|
+
enableWatching: boolean;
|
|
25
|
+
developmentMode: boolean;
|
|
26
|
+
quietMode: boolean;
|
|
27
|
+
};
|
|
28
|
+
readonly fileSystemRouterConfig: (data: unknown) => {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
fallbackToManual: boolean;
|
|
31
|
+
enableCaching: boolean;
|
|
32
|
+
cacheTTL: number;
|
|
33
|
+
discovery?: {
|
|
34
|
+
pagesDirectory: string;
|
|
35
|
+
apiDirectory: string;
|
|
36
|
+
extensions: string[];
|
|
37
|
+
excludeDirectories: string[];
|
|
38
|
+
enableWatching: boolean;
|
|
39
|
+
developmentMode: boolean;
|
|
40
|
+
quietMode: boolean;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly metadata: (data: unknown) => {
|
|
44
|
+
title?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
keywords?: string[];
|
|
47
|
+
openGraph?: {
|
|
48
|
+
title?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
image?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
type?: string;
|
|
53
|
+
siteName?: string;
|
|
54
|
+
};
|
|
55
|
+
twitter?: {
|
|
56
|
+
card?: "summary" | "summary_large_image" | "app" | "player";
|
|
57
|
+
title?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
image?: string;
|
|
60
|
+
site?: string;
|
|
61
|
+
};
|
|
62
|
+
schema?: Record<string, unknown>[];
|
|
63
|
+
canonical?: string;
|
|
64
|
+
robots?: string;
|
|
65
|
+
};
|
|
66
|
+
readonly resolvedMetadata: (data: unknown) => {
|
|
67
|
+
title?: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
keywords?: string[];
|
|
70
|
+
openGraph?: {
|
|
71
|
+
title?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
image?: string;
|
|
74
|
+
url?: string;
|
|
75
|
+
type?: string;
|
|
76
|
+
siteName?: string;
|
|
77
|
+
};
|
|
78
|
+
twitter?: {
|
|
79
|
+
card?: "summary" | "summary_large_image" | "app" | "player";
|
|
80
|
+
title?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
image?: string;
|
|
83
|
+
site?: string;
|
|
84
|
+
};
|
|
85
|
+
schema?: Record<string, unknown>[];
|
|
86
|
+
canonical?: string;
|
|
87
|
+
robots?: string;
|
|
88
|
+
sources?: string[];
|
|
89
|
+
resolvedAt?: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export declare const safeRoutingValidators: {
|
|
93
|
+
readonly fileSystemRoute: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
94
|
+
pattern: any;
|
|
95
|
+
filePath: string;
|
|
96
|
+
routeType: "static" | "index" | "group" | "dynamic" | "catch-all";
|
|
97
|
+
dynamicSegments: string[];
|
|
98
|
+
priority: number;
|
|
99
|
+
isPrivate: boolean;
|
|
100
|
+
routeGroup?: string;
|
|
101
|
+
}>;
|
|
102
|
+
readonly routePageModule: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
103
|
+
default: any;
|
|
104
|
+
layoutConfig?: any;
|
|
105
|
+
generateMetadata?: any;
|
|
106
|
+
loader?: any;
|
|
107
|
+
frontmatter?: Record<string, any>;
|
|
108
|
+
}>;
|
|
109
|
+
readonly routeDiscoveryOptions: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
110
|
+
pagesDirectory: string;
|
|
111
|
+
apiDirectory: string;
|
|
112
|
+
extensions: string[];
|
|
113
|
+
excludeDirectories: string[];
|
|
114
|
+
enableWatching: boolean;
|
|
115
|
+
developmentMode: boolean;
|
|
116
|
+
quietMode: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
readonly fileSystemRouterConfig: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
fallbackToManual: boolean;
|
|
121
|
+
enableCaching: boolean;
|
|
122
|
+
cacheTTL: number;
|
|
123
|
+
discovery?: {
|
|
124
|
+
pagesDirectory: string;
|
|
125
|
+
apiDirectory: string;
|
|
126
|
+
extensions: string[];
|
|
127
|
+
excludeDirectories: string[];
|
|
128
|
+
enableWatching: boolean;
|
|
129
|
+
developmentMode: boolean;
|
|
130
|
+
quietMode: boolean;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
133
|
+
readonly metadata: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
134
|
+
title?: string;
|
|
135
|
+
description?: string;
|
|
136
|
+
keywords?: string[];
|
|
137
|
+
openGraph?: {
|
|
138
|
+
title?: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
image?: string;
|
|
141
|
+
url?: string;
|
|
142
|
+
type?: string;
|
|
143
|
+
siteName?: string;
|
|
144
|
+
};
|
|
145
|
+
twitter?: {
|
|
146
|
+
card?: "summary" | "summary_large_image" | "app" | "player";
|
|
147
|
+
title?: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
image?: string;
|
|
150
|
+
site?: string;
|
|
151
|
+
};
|
|
152
|
+
schema?: Record<string, unknown>[];
|
|
153
|
+
canonical?: string;
|
|
154
|
+
robots?: string;
|
|
155
|
+
}>;
|
|
156
|
+
readonly resolvedMetadata: (data: unknown) => import("../index.ts").ValidationResult<{
|
|
157
|
+
title?: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
keywords?: string[];
|
|
160
|
+
openGraph?: {
|
|
161
|
+
title?: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
image?: string;
|
|
164
|
+
url?: string;
|
|
165
|
+
type?: string;
|
|
166
|
+
siteName?: string;
|
|
167
|
+
};
|
|
168
|
+
twitter?: {
|
|
169
|
+
card?: "summary" | "summary_large_image" | "app" | "player";
|
|
170
|
+
title?: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
image?: string;
|
|
173
|
+
site?: string;
|
|
174
|
+
};
|
|
175
|
+
schema?: Record<string, unknown>[];
|
|
176
|
+
canonical?: string;
|
|
177
|
+
robots?: string;
|
|
178
|
+
sources?: string[];
|
|
179
|
+
resolvedAt?: number;
|
|
180
|
+
}>;
|
|
181
|
+
};
|