@stacksjs/stx 0.2.155 → 0.2.156

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.
Files changed (240) hide show
  1. package/dist/a11y.d.ts +87 -46
  2. package/dist/animation.d.ts +96 -42
  3. package/dist/appearance-bootstrap.d.ts +49 -15
  4. package/dist/asset-roots.d.ts +32 -0
  5. package/dist/asset-roots.js +7 -0
  6. package/dist/assets.d.ts +9 -7
  7. package/dist/async-components.d.ts +78 -56
  8. package/dist/auth.d.ts +3 -0
  9. package/dist/build-externalize.d.ts +40 -0
  10. package/dist/build-externalize.js +63 -0
  11. package/dist/build-id.d.ts +22 -22
  12. package/dist/build-message.d.ts +73 -2
  13. package/dist/build-message.js +47 -8
  14. package/dist/builtins/attrs.d.ts +14 -0
  15. package/dist/builtins/drawer.d.ts +22 -0
  16. package/dist/builtins/icon.d.ts +16 -2
  17. package/dist/builtins/index.d.ts +5 -15
  18. package/dist/builtins/modal.d.ts +24 -0
  19. package/dist/builtins/safe-image.d.ts +42 -0
  20. package/dist/builtins/stx-image.d.ts +27 -0
  21. package/dist/builtins/stx-link.d.ts +9 -0
  22. package/dist/builtins/stx-loading-indicator.d.ts +11 -0
  23. package/dist/builtins/suspense.d.ts +28 -0
  24. package/dist/builtins/toast.d.ts +17 -0
  25. package/dist/builtins/transition-group.d.ts +25 -0
  26. package/dist/caching.d.ts +12 -15
  27. package/dist/cli.js +1798 -908
  28. package/dist/client/directive.d.ts +7 -0
  29. package/dist/client/index.d.ts +0 -1
  30. package/dist/client-script-bundler.d.ts +63 -5
  31. package/dist/client-script-bundler.js +30 -2
  32. package/dist/client-script.d.ts +102 -47
  33. package/dist/client-script.js +15 -3
  34. package/dist/codemod.d.ts +56 -0
  35. package/dist/codemod.js +192 -0
  36. package/dist/color-mode-boot.d.ts +83 -65
  37. package/dist/component-client-factories.d.ts +1 -6
  38. package/dist/component-processing.d.ts +58 -49
  39. package/dist/component-processing.js +1 -1
  40. package/dist/component-registry.d.ts +94 -31
  41. package/dist/component-renderer.d.ts +18 -0
  42. package/dist/composable-loader.d.ts +24 -0
  43. package/dist/composable-loader.js +12 -9
  44. package/dist/composables/index.d.ts +7 -0
  45. package/dist/composables/index.js +1 -0
  46. package/dist/composables/use-fetch.js +30 -2
  47. package/dist/composables/use-form.d.ts +91 -0
  48. package/dist/composables/use-form.js +112 -0
  49. package/dist/composables.d.ts +64 -60
  50. package/dist/computed.d.ts +86 -92
  51. package/dist/conditionals.d.ts +24 -8
  52. package/dist/conditionals.js +16 -0
  53. package/dist/config.d.ts +34 -21
  54. package/dist/config.js +35 -14
  55. package/dist/craft.js +1476 -768
  56. package/dist/crosswind-config.d.ts +58 -0
  57. package/dist/crosswind-config.js +40 -0
  58. package/dist/csp.d.ts +107 -41
  59. package/dist/defer.d.ts +24 -0
  60. package/dist/dev-server/crosswind.d.ts +35 -26
  61. package/dist/dev-server/crosswind.js +2 -18
  62. package/dist/dev-server/serve-app.js +4 -3
  63. package/dist/dev-server/terminal-colors.d.ts +32 -32
  64. package/dist/directive-api.d.ts +86 -43
  65. package/dist/document-shell.d.ts +54 -41
  66. package/dist/dynamic-components.d.ts +9 -0
  67. package/dist/error-boundaries.d.ts +47 -41
  68. package/dist/error-handling.d.ts +1 -1
  69. package/dist/errors/codes.d.ts +51 -43
  70. package/dist/errors/formatter.d.ts +58 -38
  71. package/dist/errors/index.d.ts +5 -61
  72. package/dist/errors/logger.d.ts +114 -40
  73. package/dist/errors/sanitizer.d.ts +53 -23
  74. package/dist/errors/types.d.ts +44 -31
  75. package/dist/events.d.ts +86 -25
  76. package/dist/expressions.d.ts +50 -42
  77. package/dist/forms-validation.d.ts +138 -123
  78. package/dist/forms-validation.js +1 -90
  79. package/dist/forms.d.ts +120 -66
  80. package/dist/forms.js +31 -11
  81. package/dist/fragment-container.d.ts +57 -0
  82. package/dist/fragment-container.js +109 -0
  83. package/dist/framework-composables.d.ts +32 -0
  84. package/dist/head.d.ts +156 -114
  85. package/dist/heatmap.d.ts +152 -72
  86. package/dist/html-masking.d.ts +40 -34
  87. package/dist/hydration-runtime.d.ts +20 -24
  88. package/dist/i18n.d.ts +93 -32
  89. package/dist/image-optimization/auto-sibling.d.ts +32 -4
  90. package/dist/includes.d.ts +69 -7
  91. package/dist/index.d.ts +66 -0
  92. package/dist/index.js +23 -0
  93. package/dist/internal-markdown.d.ts +12 -8
  94. package/dist/island-chunking.d.ts +30 -13
  95. package/dist/keep-alive.d.ts +72 -52
  96. package/dist/layout-types.d.ts +45 -0
  97. package/dist/layout-types.js +56 -0
  98. package/dist/lazy-module.d.ts +10 -0
  99. package/dist/loops.d.ts +66 -0
  100. package/dist/loops.js +47 -6
  101. package/dist/markdown.d.ts +0 -1
  102. package/dist/media/image/component.d.ts +25 -9
  103. package/dist/media/image/directive.d.ts +15 -1
  104. package/dist/media/image/placeholder.d.ts +20 -9
  105. package/dist/media/image/processor/cache.d.ts +40 -18
  106. package/dist/media/image/processor/index.d.ts +1 -10
  107. package/dist/media/image/processor/optimizer.d.ts +12 -1
  108. package/dist/media/image/processor/responsive.d.ts +16 -6
  109. package/dist/media/image/srcset.d.ts +47 -50
  110. package/dist/media/shared/cache.d.ts +51 -31
  111. package/dist/media/shared/hash.d.ts +7 -0
  112. package/dist/media/types.d.ts +1235 -754
  113. package/dist/media/video/directive.d.ts +15 -1
  114. package/dist/media/video/index.d.ts +39 -17
  115. package/dist/media/video/processor/cache.d.ts +42 -19
  116. package/dist/media/video/processor/index.d.ts +1 -18
  117. package/dist/media/video/processor/streaming.d.ts +17 -10
  118. package/dist/media/video/processor/thumbnail.d.ts +21 -15
  119. package/dist/media/video/processor/transcoder.d.ts +11 -1
  120. package/dist/method-spoofing.d.ts +7 -0
  121. package/dist/middleware.d.ts +60 -0
  122. package/dist/owned-routes.d.ts +42 -0
  123. package/dist/owned-routes.js +26 -0
  124. package/dist/page-meta.d.ts +38 -0
  125. package/dist/page-meta.js +16 -0
  126. package/dist/parser/directive-parser.d.ts +57 -45
  127. package/dist/parser/expression-parser.d.ts +33 -35
  128. package/dist/parser/index.d.ts +4 -39
  129. package/dist/parser/tokenizer.d.ts +61 -49
  130. package/dist/partial-hydration.d.ts +82 -50
  131. package/dist/performance-utils.d.ts +217 -124
  132. package/dist/placeholder.d.ts +18 -9
  133. package/dist/plugin-system.d.ts +264 -115
  134. package/dist/process.d.ts +11 -6
  135. package/dist/process.js +21 -4
  136. package/dist/production-builder.js +7 -0
  137. package/dist/prop-sentinels.d.ts +11 -11
  138. package/dist/public-env.d.ts +14 -0
  139. package/dist/pwa/directives.d.ts +12 -3
  140. package/dist/pwa/inject.d.ts +10 -0
  141. package/dist/pwa/precache.d.ts +22 -16
  142. package/dist/pwa/service-worker.d.ts +12 -0
  143. package/dist/pwa.js +1318 -610
  144. package/dist/reactive-bindings.d.ts +34 -11
  145. package/dist/reactive.d.ts +58 -30
  146. package/dist/reactive.js +56 -31
  147. package/dist/render.js +1 -0
  148. package/dist/route-middleware.d.ts +2 -35
  149. package/dist/route-types.d.ts +134 -0
  150. package/dist/route-types.js +24 -0
  151. package/dist/router.d.ts +5 -7
  152. package/dist/routes.d.ts +1 -3
  153. package/dist/runtime-globals.d.ts +147 -24
  154. package/dist/runtime-globals.js +16 -1
  155. package/dist/runtime-injection.d.ts +8 -0
  156. package/dist/runtime-injection.js +33 -24
  157. package/dist/script-emit.d.ts +30 -0
  158. package/dist/script-json.d.ts +36 -0
  159. package/dist/script-json.js +6 -0
  160. package/dist/script-validation.d.ts +21 -4
  161. package/dist/seo.d.ts +118 -47
  162. package/dist/server-bindings.d.ts +21 -0
  163. package/dist/sfc-template.d.ts +8 -8
  164. package/dist/signal-processing.d.ts +35 -15
  165. package/dist/signals-api.d.ts +117 -58
  166. package/dist/signals-api.js +7 -4
  167. package/dist/signals.d.ts +24 -17
  168. package/dist/signals.js +765 -60
  169. package/dist/site-builder/build.js +8 -0
  170. package/dist/site-url.d.ts +46 -0
  171. package/dist/site-url.js +70 -0
  172. package/dist/slots.d.ts +86 -20
  173. package/dist/source-signature.d.ts +45 -0
  174. package/dist/source-signature.js +20 -0
  175. package/dist/ssg.d.ts +285 -142
  176. package/dist/ssg.js +1268 -556
  177. package/dist/state-dir.d.ts +4 -4
  178. package/dist/state-management.d.ts +0 -12
  179. package/dist/state-management.js +8 -25
  180. package/dist/store-imports.d.ts +23 -0
  181. package/dist/store-imports.js +3 -0
  182. package/dist/store-loader.d.ts +10 -0
  183. package/dist/store-loader.js +10 -9
  184. package/dist/story/analytics.d.ts +138 -60
  185. package/dist/story/bookmarks.d.ts +87 -34
  186. package/dist/story/cli.d.ts +123 -69
  187. package/dist/story/collect/scanner.d.ts +4 -0
  188. package/dist/story/collect/tree.d.ts +8 -1
  189. package/dist/story/commands/build.d.ts +11 -6
  190. package/dist/story/commands/dev.d.ts +15 -8
  191. package/dist/story/commands/preview.d.ts +13 -7
  192. package/dist/story/config-watcher.d.ts +20 -13
  193. package/dist/story/config.d.ts +11 -8
  194. package/dist/story/context.d.ts +14 -8
  195. package/dist/story/hmr.d.ts +24 -26
  196. package/dist/story/hot-swap.d.ts +34 -23
  197. package/dist/story/keyboard-shortcuts.d.ts +23 -18
  198. package/dist/story/output.d.ts +46 -44
  199. package/dist/story/performance.d.ts +107 -45
  200. package/dist/story/presets.d.ts +107 -41
  201. package/dist/story/renderer.d.ts +41 -27
  202. package/dist/story/search.d.ts +23 -12
  203. package/dist/story/server.d.ts +21 -11
  204. package/dist/story/setup.d.ts +23 -15
  205. package/dist/story/testing.d.ts +65 -40
  206. package/dist/story/types.d.ts +262 -160
  207. package/dist/streaming.d.ts +119 -57
  208. package/dist/stx-virtual-ts.d.ts +165 -0
  209. package/dist/stx-virtual-ts.js +372 -0
  210. package/dist/stx.d.ts +78 -1
  211. package/dist/style-scoping.d.ts +17 -4
  212. package/dist/suspense.d.ts +67 -52
  213. package/dist/teleport.d.ts +22 -0
  214. package/dist/template-tag-balance.d.ts +22 -6
  215. package/dist/transitions.d.ts +66 -55
  216. package/dist/typecheck.d.ts +77 -0
  217. package/dist/typecheck.js +156 -0
  218. package/dist/types/component-types.d.ts +187 -122
  219. package/dist/types/config-types.d.ts +758 -297
  220. package/dist/types/context-types.d.ts +46 -24
  221. package/dist/types/csp-types.d.ts +70 -66
  222. package/dist/types/directive-types.d.ts +211 -155
  223. package/dist/types/index.d.ts +6 -109
  224. package/dist/types/pwa-types.d.ts +273 -148
  225. package/dist/types.d.ts +0 -1
  226. package/dist/typescript-templates.d.ts +11 -0
  227. package/dist/unresolved-identifiers.d.ts +24 -22
  228. package/dist/unresolved-identifiers.js +2 -0
  229. package/dist/utils.d.ts +24 -21
  230. package/dist/validator.d.ts +28 -26
  231. package/dist/variable-extractor.d.ts +48 -13
  232. package/dist/variable-extractor.js +27 -4
  233. package/dist/view-composers.d.ts +80 -81
  234. package/dist/virtual-scrolling.d.ts +101 -81
  235. package/dist/vue-template.d.ts +23 -0
  236. package/dist/web-components/css-scoping.d.ts +21 -11
  237. package/dist/web-components.d.ts +81 -58
  238. package/dist/x-element.d.ts +0 -1
  239. package/package.json +5 -5
  240. package/stx.d.ts +78 -1
@@ -1,221 +1,349 @@
1
+ /**
2
+ * Configuration Types for stx
3
+ */
1
4
  import type { ColorModeBootConfig } from '../color-mode-boot';
5
+ import type { CustomDirective, Middleware } from './directive-types';
2
6
  import type { ComponentConfig, DocGeneratorConfig, WebComponentConfig } from './component-types';
7
+ import type { PwaConfig } from './pwa-types';
3
8
  import type { CspConfig } from './csp-types';
4
- import type { CustomDirective, Middleware } from './directive-types';
5
9
  import type { HeatmapConfig } from '../heatmap';
6
10
  import type { MediaConfig } from '../media/types';
7
- import type { MiddlewareMode } from '../route-middleware';
8
- import type { PwaConfig } from './pwa-types';
9
11
  /**
10
12
  * Internationalization (i18n) configuration
11
13
  */
12
- export declare interface I18nConfig {
13
- defaultLocale: string
14
- locale: string
15
- translationsDir: string
16
- format: 'json' | 'yaml' | 'yml' | 'js'
17
- fallbackToKey: boolean
18
- cache: boolean
14
+ export interface I18nConfig {
15
+ /** Default locale to use when translation is not found */
16
+ defaultLocale: string;
17
+ /** Current locale */
18
+ locale: string;
19
+ /** Path to directory containing translation files */
20
+ translationsDir: string;
21
+ /** Format of translation files (json, yaml, yml, or js) */
22
+ format: 'json' | 'yaml' | 'yml' | 'js';
23
+ /** Whether to fallback to the key when translation is not found */
24
+ fallbackToKey: boolean;
25
+ /** Cache translations in memory */
26
+ cache: boolean;
19
27
  }
20
28
  /**
21
29
  * Streaming configuration
22
30
  */
23
- export declare interface StreamingConfig {
24
- enabled: boolean
25
- bufferSize: number
26
- strategy: 'auto' | 'manual' | 'sections'
27
- timeout: number
31
+ export interface StreamingConfig {
32
+ /** Enable streaming support */
33
+ enabled: boolean;
34
+ /** Buffer size for stream chunks in bytes */
35
+ bufferSize: number;
36
+ /** Strategy for chunking the output */
37
+ strategy: 'auto' | 'manual' | 'sections';
38
+ /** Default timeout for stream rendering in milliseconds */
39
+ timeout: number;
28
40
  }
29
41
  /**
30
42
  * Stream renderer for progressive loading
31
43
  */
32
- export declare interface StreamRenderer {
33
- renderShell: (data?: Record<string, unknown>) => Promise<string>
34
- renderSection: (section: string, data?: Record<string, unknown>) => Promise<string>
35
- getSections: () => string[]
36
- getTemplate: () => string
44
+ export interface StreamRenderer {
45
+ /** Render the shell of the page (initial HTML) */
46
+ renderShell: (data?: Record<string, unknown>) => Promise<string>;
47
+ /** Render a specific section of the template */
48
+ renderSection: (section: string, data?: Record<string, unknown>) => Promise<string>;
49
+ /** Get the list of sections defined in the template */
50
+ getSections: () => string[];
51
+ /** Get the full template content */
52
+ getTemplate: () => string;
37
53
  }
38
54
  /**
39
55
  * Hydration configuration
40
56
  */
41
- export declare interface HydrationConfig {
42
- enabled: boolean
43
- mode: 'progressive' | 'islands'
44
- clientEntry: string
45
- autoMarkers: boolean
46
- preload: 'none' | 'eager' | 'lazy'
57
+ export interface HydrationConfig {
58
+ /** Enable partial hydration */
59
+ enabled: boolean;
60
+ /** Hydration mode */
61
+ mode: 'progressive' | 'islands';
62
+ /** Path to client-side hydration entry point */
63
+ clientEntry: string;
64
+ /** Auto-generate hydration markers */
65
+ autoMarkers: boolean;
66
+ /** Preload strategy for hydration code */
67
+ preload: 'none' | 'eager' | 'lazy';
47
68
  }
48
69
  /**
49
70
  * Island definition for partial hydration
50
71
  */
51
- export declare interface Island {
52
- id: string
53
- component: string
54
- props?: Record<string, unknown>
55
- priority?: 'eager' | 'lazy'
56
- shadowDOM?: boolean
72
+ export interface Island {
73
+ /** Island unique identifier */
74
+ id: string;
75
+ /** Client component to hydrate with (path or name) */
76
+ component: string;
77
+ /** Initial props for the island */
78
+ props?: Record<string, unknown>;
79
+ /** Load priority (eager or lazy) */
80
+ priority?: 'eager' | 'lazy';
81
+ /** Whether to use shadow DOM */
82
+ shadowDOM?: boolean;
57
83
  }
58
84
  /**
59
85
  * Accessibility configuration
60
86
  */
61
- export declare interface A11yConfig {
62
- enabled: boolean
63
- addSrOnlyStyles: boolean
64
- level: 'AA' | 'AAA'
65
- ignoreChecks?: string[]
66
- autoFix: boolean
87
+ export interface A11yConfig {
88
+ /** Enable accessibility checks */
89
+ enabled: boolean;
90
+ /** Automatically add screen reader styles */
91
+ addSrOnlyStyles: boolean;
92
+ /** Level of accessibility checking to enforce */
93
+ level: 'AA' | 'AAA';
94
+ /** Ignore certain types of a11y checks */
95
+ ignoreChecks?: string[];
96
+ /** Auto-fix simple a11y issues during template processing */
97
+ autoFix: boolean;
67
98
  }
68
99
  /**
69
100
  * SEO OpenGraph configuration
70
101
  */
71
- export declare interface OpenGraphConfig {
72
- type?: string
73
- title?: string
74
- description?: string
75
- url?: string
76
- image?: string
77
- imageAlt?: string
78
- imageWidth?: number
79
- imageHeight?: number
80
- siteName?: string
102
+ export interface OpenGraphConfig {
103
+ /** Open Graph type (website, article, etc.) */
104
+ type?: string;
105
+ /** Title for Open Graph */
106
+ title?: string;
107
+ /** Description for Open Graph */
108
+ description?: string;
109
+ /** URL for Open Graph */
110
+ url?: string;
111
+ /** Image URL for Open Graph */
112
+ image?: string;
113
+ /** Alt text for the OG image */
114
+ imageAlt?: string;
115
+ /** Width of the OG image */
116
+ imageWidth?: number;
117
+ /** Height of the OG image */
118
+ imageHeight?: number;
119
+ /** Site name for Open Graph */
120
+ siteName?: string;
81
121
  }
82
122
  /**
83
123
  * SEO Twitter card configuration
84
124
  */
85
- export declare interface TwitterConfig {
86
- card?: 'summary' | 'summary_large_image' | 'app' | 'player'
87
- title?: string
88
- description?: string
89
- image?: string
90
- site?: string
91
- creator?: string
125
+ export interface TwitterConfig {
126
+ /** Twitter card type */
127
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
128
+ /** Title for Twitter card */
129
+ title?: string;
130
+ /** Description for Twitter card */
131
+ description?: string;
132
+ /** Image URL for Twitter card */
133
+ image?: string;
134
+ /** Twitter site handle */
135
+ site?: string;
136
+ /** Twitter creator handle */
137
+ creator?: string;
92
138
  }
93
139
  /**
94
140
  * SEO configuration
95
141
  */
96
- export declare interface SeoConfig {
97
- title?: string
98
- description?: string
99
- keywords?: string[] | string
100
- robots?: string
101
- canonical?: string
102
- openGraph?: OpenGraphConfig
103
- twitter?: TwitterConfig
104
- structuredData?: Record<string, unknown>
142
+ export interface SeoConfig {
143
+ /** Page title */
144
+ title?: string;
145
+ /** Page description */
146
+ description?: string;
147
+ /** Page keywords */
148
+ keywords?: string[] | string;
149
+ /** Robots directives */
150
+ robots?: string;
151
+ /** Canonical URL */
152
+ canonical?: string;
153
+ /** Open Graph configuration */
154
+ openGraph?: OpenGraphConfig;
155
+ /** Twitter card configuration */
156
+ twitter?: TwitterConfig;
157
+ /** Structured data (JSON-LD) */
158
+ structuredData?: Record<string, unknown>;
105
159
  }
106
160
  /**
107
161
  * SEO features configuration
108
162
  */
109
- export declare interface SeoFeatureConfig {
110
- enabled: boolean
111
- defaultConfig?: SeoConfig
112
- socialPreview?: boolean
113
- defaultImage?: string
163
+ export interface SeoFeatureConfig {
164
+ /** Enable automatic SEO features */
165
+ enabled: boolean;
166
+ /** Default SEO configuration to apply to all pages */
167
+ defaultConfig?: SeoConfig;
168
+ /** Enable social preview meta tags */
169
+ socialPreview?: boolean;
170
+ /** Default image URL for social previews */
171
+ defaultImage?: string;
114
172
  }
173
+ /**
174
+ * Analytics driver type
175
+ */
176
+ export type AnalyticsDriver = 'fathom' | 'google-analytics' | 'plausible' | 'self-hosted' | 'custom';
115
177
  /**
116
178
  * Analytics configuration for automatic script injection
117
179
  */
118
- export declare interface AnalyticsConfig {
119
- enabled: boolean
120
- driver: AnalyticsDriver
121
- fathom?: {
122
- siteId: string
123
- scriptUrl?: string
124
- honorDnt?: boolean
125
- defer?: boolean
126
- spa?: boolean
127
- canonical?: string
128
- auto?: boolean
129
- }
130
- googleAnalytics?: {
131
- measurementId: string
132
- debug?: boolean
133
- }
134
- plausible?: {
135
- domain: string
136
- scriptUrl?: string
137
- trackLocalhost?: boolean
138
- hashMode?: boolean
139
- }
140
- selfHosted?: {
141
- siteId: string
142
- apiEndpoint: string
143
- honorDnt?: boolean
144
- trackHashChanges?: boolean
145
- trackOutboundLinks?: boolean
146
- }
147
- custom?: {
148
- scriptUrl: string
149
- scriptId?: string
150
- attributes?: Record<string, string>
151
- inlineScript?: string
152
- }
180
+ export interface AnalyticsConfig {
181
+ /** Enable analytics tracking */
182
+ enabled: boolean;
183
+ /** Analytics driver/provider */
184
+ driver: AnalyticsDriver;
185
+ /** Fathom Analytics configuration */
186
+ fathom?: {
187
+ /** Fathom site ID */
188
+ siteId: string;
189
+ /** Custom script URL (default: https://cdn.usefathom.com/script.js) */
190
+ scriptUrl?: string;
191
+ /** Honor Do Not Track browser setting */
192
+ honorDnt?: boolean;
193
+ /** Defer script loading (default: true) */
194
+ defer?: boolean;
195
+ /** Enable SPA mode for client-side routing */
196
+ spa?: boolean;
197
+ /** Canonical URL override */
198
+ canonical?: string;
199
+ /** Auto-track page views (default: true) */
200
+ auto?: boolean;
201
+ };
202
+ /** Google Analytics configuration */
203
+ googleAnalytics?: {
204
+ /** GA4 Measurement ID (e.g., G-XXXXXXXXXX) */
205
+ measurementId: string;
206
+ /** Enable debug mode */
207
+ debug?: boolean;
208
+ };
209
+ /** Plausible Analytics configuration */
210
+ plausible?: {
211
+ /** Your domain (e.g., example.com) */
212
+ domain: string;
213
+ /** Custom script URL (default: https://plausible.io/js/script.js) */
214
+ scriptUrl?: string;
215
+ /** Track localhost */
216
+ trackLocalhost?: boolean;
217
+ /** Enable hash-based routing */
218
+ hashMode?: boolean;
219
+ };
220
+ /** Self-hosted analytics configuration (using dynamodb-tooling analytics) */
221
+ selfHosted?: {
222
+ /** Site ID for tracking */
223
+ siteId: string;
224
+ /** API endpoint URL for collecting analytics */
225
+ apiEndpoint: string;
226
+ /** Honor Do Not Track browser setting */
227
+ honorDnt?: boolean;
228
+ /** Track hash changes as page views */
229
+ trackHashChanges?: boolean;
230
+ /** Track outbound link clicks */
231
+ trackOutboundLinks?: boolean;
232
+ };
233
+ /** Custom analytics configuration */
234
+ custom?: {
235
+ /** Custom script URL */
236
+ scriptUrl: string;
237
+ /** Script ID attribute */
238
+ scriptId?: string;
239
+ /** Additional script attributes */
240
+ attributes?: Record<string, string>;
241
+ /** Inline script content (instead of external URL) */
242
+ inlineScript?: string;
243
+ };
153
244
  }
154
245
  /**
155
246
  * Animation configuration
156
247
  */
157
- export declare interface AnimationConfig {
158
- enabled: boolean
159
- defaultDuration: number
160
- defaultEase: string
161
- respectMotionPreferences: boolean
162
- staggerDelay: number
248
+ export interface AnimationConfig {
249
+ /** Enable animation system */
250
+ enabled: boolean;
251
+ /** Default duration for transitions in milliseconds */
252
+ defaultDuration: number;
253
+ /** Default easing function for transitions */
254
+ defaultEase: string;
255
+ /** Respect user's motion preferences by default */
256
+ respectMotionPreferences: boolean;
257
+ /** Default stagger delay for grouped animations */
258
+ staggerDelay: number;
163
259
  }
164
260
  /**
165
261
  * Route middleware configuration
166
262
  */
167
- export declare interface RouteMiddlewareConfig {
168
- enabled: boolean
169
- dir: string
170
- global?: string[]
171
- defaultMode: MiddlewareMode
263
+ export interface RouteMiddlewareConfig {
264
+ /** Enable route middleware system */
265
+ enabled: boolean;
266
+ /** Directory containing middleware files (default: 'middleware') */
267
+ dir: string;
268
+ /** Global middleware to run on every route */
269
+ global?: string[];
172
270
  }
173
271
  /**
174
272
  * Loop directive configuration
175
273
  */
176
- export declare interface LoopConfig {
177
- maxWhileIterations: number
178
- useAltLoopVariable: boolean
274
+ export interface LoopConfig {
275
+ /**
276
+ * Maximum iterations for @while loops (safety limit to prevent infinite loops)
277
+ * @default 1000
278
+ */
279
+ maxWhileIterations: number;
280
+ /**
281
+ * Use $loop instead of loop for loop context variable
282
+ * Set to true to avoid conflicts if you have a variable named 'loop'
283
+ * @default false
284
+ */
285
+ useAltLoopVariable: boolean;
179
286
  }
287
+ /**
288
+ * Available syntax highlighting themes
289
+ */
290
+ export type SyntaxHighlightTheme = 'css-variables' | 'dark-plus' | 'dracula' | 'dracula-soft' | 'github-dark' | 'github-dark-dimmed' | 'github-light' | 'hc_light' | 'light-plus' | 'material-theme' | 'material-theme-darker' | 'material-theme-lighter' | 'material-theme-ocean' | 'material-theme-palenight' | 'min-dark' | 'min-light' | 'monokai' | 'nord' | 'one-dark-pro' | 'poimandres' | 'rose-pine' | 'rose-pine-dawn' | 'rose-pine-moon' | 'slack-dark' | 'slack-ochin' | 'solarized-dark' | 'solarized-light' | 'vitesse-dark' | 'vitesse-light';
180
291
  /**
181
292
  * Syntax highlighting configuration
182
293
  */
183
- export declare interface SyntaxHighlightingConfig {
184
- enabled: boolean
185
- serverSide: boolean
186
- defaultTheme: SyntaxHighlightTheme
187
- highlightUnknownLanguages: boolean
188
- additionalThemes?: SyntaxHighlightTheme[]
294
+ export interface SyntaxHighlightingConfig {
295
+ /** Enable syntax highlighting */
296
+ enabled: boolean;
297
+ /** Use server-side highlighting (true) instead of client-side (false) */
298
+ serverSide: boolean;
299
+ /** Default theme for syntax highlighting */
300
+ defaultTheme: SyntaxHighlightTheme;
301
+ /** Attempt to highlight code blocks with unknown language */
302
+ highlightUnknownLanguages: boolean;
303
+ /** List of additional themes to make available in the UI */
304
+ additionalThemes?: SyntaxHighlightTheme[];
189
305
  }
190
306
  /**
191
307
  * Markdown configuration
192
308
  */
193
- export declare interface MarkdownConfig {
194
- enabled: boolean
195
- dir?: string
196
- syntaxHighlighting?: Partial<SyntaxHighlightingConfig>
309
+ export interface MarkdownConfig {
310
+ /** Enable markdown processing */
311
+ enabled: boolean;
312
+ /** Path to markdown directory */
313
+ dir?: string;
314
+ /** Syntax highlighting configuration */
315
+ syntaxHighlighting?: Partial<SyntaxHighlightingConfig>;
197
316
  }
198
317
  /**
199
318
  * Configuration for form directives
200
319
  */
201
- export declare interface FormConfig {
202
- classes?: {
203
- input?: string
204
- inputError?: string
205
- checkInput?: string
206
- label?: string
207
- errorFeedback?: string
208
- }
320
+ export interface FormConfig {
321
+ /** CSS class names for form elements */
322
+ classes?: {
323
+ /** Class for text inputs, textareas, and selects */
324
+ input?: string;
325
+ /** Class added to inputs with validation errors */
326
+ inputError?: string;
327
+ /** Class for checkboxes and radios */
328
+ checkInput?: string;
329
+ /** Class for labels */
330
+ label?: string;
331
+ /** Class for error message containers */
332
+ errorFeedback?: string;
333
+ };
209
334
  }
210
335
  /**
211
336
  * Strict mode configuration for DOM API validation.
212
337
  * When enabled, stx warns (or errors) when client scripts use raw browser APIs
213
338
  * instead of framework composables.
214
339
  */
215
- export declare interface StrictModeConfig {
216
- enabled: boolean
217
- failOnViolation?: boolean
218
- allowPatterns?: string[]
340
+ export interface StrictModeConfig {
341
+ /** Enable strict mode validation */
342
+ enabled: boolean;
343
+ /** Throw errors instead of warnings (default: false) */
344
+ failOnViolation?: boolean;
345
+ /** Pattern strings to allow through validation (matched against message or regex source) */
346
+ allowPatterns?: string[];
219
347
  }
220
348
  /**
221
349
  * Real-time broadcasting configuration.
@@ -223,175 +351,508 @@ export declare interface StrictModeConfig {
223
351
  * When enabled, stx starts a ts-broadcasting WebSocket server
224
352
  * alongside the dev server so pages can receive push events.
225
353
  */
226
- export declare interface BroadcastingConfig {
227
- enabled?: boolean
228
- driver?: 'bun' | 'reverb' | 'pusher' | 'ably' | 'log' | 'null'
229
- host?: string
230
- port?: number
231
- scheme?: 'ws' | 'wss'
232
- verbose?: boolean
354
+ export interface BroadcastingConfig {
355
+ /** Enable the broadcasting server @default false */
356
+ enabled?: boolean;
357
+ /** Broadcasting driver @default 'bun' */
358
+ driver?: 'bun' | 'reverb' | 'pusher' | 'ably' | 'log' | 'null';
359
+ /** WebSocket server host @default '0.0.0.0' */
360
+ host?: string;
361
+ /** WebSocket server port @default 6001 */
362
+ port?: number;
363
+ /** URL scheme @default 'ws' */
364
+ scheme?: 'ws' | 'wss';
365
+ /** Enable verbose logging @default false */
366
+ verbose?: boolean;
233
367
  }
234
368
  /**
235
369
  * App head configuration — auto-generates the document shell.
236
370
  * No .stx file needs to write <!DOCTYPE>, <html>, <head>, or <body>.
237
371
  */
238
- export declare interface AppHeadConfig {
239
- title?: string
240
- lang?: string
241
- meta?: Array<Record<string, string>>
242
- link?: Array<Record<string, string>>
243
- script?: Array<{ src?: string, content?: string, [key: string]: any }>
244
- headRaw?: string
245
- htmlAttrs?: Record<string, string>
246
- bodyClass?: string
247
- bodyAttrs?: Record<string, string>
372
+ export interface AppHeadConfig {
373
+ /** Page title (can be overridden per-page with @section('title')) */
374
+ title?: string;
375
+ /** HTML lang attribute @default 'en' */
376
+ lang?: string;
377
+ /** Meta tags */
378
+ meta?: Array<Record<string, string>>;
379
+ /** Link tags (stylesheets, icons, etc.) */
380
+ link?: Array<Record<string, string>>;
381
+ /** Script tags to include in <head> */
382
+ script?: Array<{
383
+ src?: string;
384
+ content?: string;
385
+ [key: string]: any;
386
+ }>;
387
+ /** Additional raw HTML to inject in <head> */
388
+ headRaw?: string;
389
+ /**
390
+ * Attributes for the `<html>` element.
391
+ *
392
+ * `class` is the reason this exists: design tokens scoped to the root
393
+ * element (`html.marketing { --bg: … }`) need a class the page cannot
394
+ * otherwise set once it stops hand-writing its own document shell.
395
+ * `htmlAttrs.lang` takes precedence over the `lang` option.
396
+ *
397
+ * Also settable per-page via `useHead({ htmlAttrs })`, which merges over
398
+ * this. Reconciled by the router on SPA layout changes (stacksjs/stx#1798).
399
+ */
400
+ htmlAttrs?: Record<string, string>;
401
+ /** Body class */
402
+ bodyClass?: string;
403
+ /** Body attributes */
404
+ bodyAttrs?: Record<string, string>;
248
405
  }
249
406
  /**
250
407
  * stx configuration options
251
408
  */
252
- export declare interface StxConfig {
253
- app?: {
254
- head?: AppHeadConfig
255
- colorMode?: ColorModeBootConfig
256
- window?: {
257
- width?: number
258
- height?: number
259
- darkMode?: boolean
260
- hotReload?: boolean
261
- }
262
- }
263
- root?: string
264
- stateDir?: string
265
- pagesDir?: string
266
- templatesDir?: string
267
- defaultTitle?: string
268
- defaultDescription?: string
269
- defaultImage?: string
270
- ssr?: boolean
271
- cache?: boolean
272
- cacheDir?: string
273
- cacheVersion?: string
274
- enabled: boolean
275
- partialsDir: string
276
- componentsDir: string
277
- _rootComponentsDir?: string
278
- layoutsDir?: string
279
- storesDir?: string
280
- composablesDir?: string
281
- defaultLayout?: string
282
- plugins?: Array<string | [string, Record<string, any>]>
283
- publicDir?: string
284
- envFile?: string | boolean
285
- envPrefix?: string
286
- css?: string | { config?: string, content?: string[], preflight?: boolean, minify?: boolean, [key: string]: unknown }
287
- debug: boolean
288
- cachePath: string
289
- customDirectives?: CustomDirective[]
290
- middleware?: Middleware[]
291
- i18n?: Partial<I18nConfig>
292
- webComponents?: Partial<WebComponentConfig>
293
- docs?: Partial<DocGeneratorConfig>
294
- streaming?: Partial<StreamingConfig>
295
- hydration?: Partial<HydrationConfig>
296
- a11y?: Partial<A11yConfig>
297
- seo?: Partial<SeoFeatureConfig>
298
- analytics?: Partial<AnalyticsConfig>
299
- animation?: Partial<AnimationConfig>
300
- skipDefaultSeoTags?: boolean
301
- skipSignalsRuntime?: boolean
302
- skipEventDirectives?: boolean
303
- markdown?: Partial<MarkdownConfig>
304
- loops?: Partial<LoopConfig>
305
- forms?: Partial<FormConfig>
306
- csp?: Partial<CspConfig>
307
- story?: Partial<import('../story/types').StoryConfig>
308
- pwa?: Partial<PwaConfig>
309
- components?: Partial<ComponentConfig>
310
- routeMiddleware?: Partial<RouteMiddlewareConfig>
311
- heatmap?: Partial<HeatmapConfig>
312
- build?: Partial<BuildConfig>
313
- media?: Partial<MediaConfig>
314
- strict?: boolean | StrictModeConfig
315
- buildMode?: 'compile' | 'serve' | 'spa'
316
- autoShell?: boolean
317
- outputDir?: string
318
- shell?: string | false
319
- broadcasting?: Partial<BroadcastingConfig>
320
- apiRoutes?: Record<string, (request: Request) => Response | Promise<Response>>
321
- router?: {
322
- enabled?: boolean
323
- container?: string
324
- linkSelector?: string
325
- interceptAllLinks?: boolean
326
- viewTransitions?: boolean
327
- viewTransitionDuration?: number
328
- viewTransitionEasing?: string
329
- scrollToTop?: boolean
330
- prefetch?: boolean
331
- cache?: boolean
332
- cacheTTL?: number
333
- skipSelectors?: string
334
- viewTransitionCSS?: Record<string, string>
335
- progress?: boolean
336
- progressColor?: string
337
- progressHeight?: string
338
- }
339
- apiRouter?: { handleRequest: (request: Request) => Response | Promise<Response> }
409
+ export interface StxConfig {
410
+ /**
411
+ * App head configuration.
412
+ * Defines the document shell that stx auto-generates around page content.
413
+ * No .stx file needs to write <!DOCTYPE>, <html>, <head>, or <body>.
414
+ *
415
+ * @example
416
+ * ```ts
417
+ * // stx.config.ts
418
+ * export default {
419
+ * app: {
420
+ * head: {
421
+ * title: 'My App',
422
+ * meta: [
423
+ * { name: 'description', content: 'My stx app' },
424
+ * ],
425
+ * link: [
426
+ * { rel: 'icon', href: '/favicon.ico' },
427
+ * ],
428
+ * },
429
+ * },
430
+ * }
431
+ * ```
432
+ */
433
+ /**
434
+ * Canonical site identity (stacksjs/stx#1866).
435
+ *
436
+ * `url` is what sitemap.xml and robots.txt are built from. Without it the
437
+ * static build falls back to `http://localhost` and warns — a sitemap of
438
+ * localhost URLs is valid XML and useless to a crawler, so it has to be said
439
+ * out loud rather than discovered after deploy.
440
+ *
441
+ * The site-builder path reads the same field from `site.config.ts`; either
442
+ * file works.
443
+ *
444
+ * @example
445
+ * ```ts
446
+ * // stx.config.ts
447
+ * export default {
448
+ * site: { url: 'https://example.com' },
449
+ * }
450
+ * ```
451
+ */
452
+ site?: {
453
+ /** Absolute origin, e.g. `https://example.com`. */
454
+ url?: string;
455
+ };
456
+ app?: {
457
+ head?: AppHeadConfig;
458
+ /**
459
+ * Pre-paint color mode (stacksjs/stx#1794).
460
+ *
461
+ * Declaring this makes stx inline a small render-blocking script as the
462
+ * first thing in `<head>`, which reads the persisted preference and stamps
463
+ * the root element before the browser paints. Without it, `useColorMode`
464
+ * can only apply the theme after hydration, which flashes the wrong theme
465
+ * on every cold load for users whose stored preference differs from the
466
+ * default.
467
+ *
468
+ * The options are the same ones `useColorMode` takes, and the boot script
469
+ * publishes them to the client — so `useColorMode()` with no arguments
470
+ * picks up the configured key and attribute instead of repeating them.
471
+ *
472
+ * @example
473
+ * ```ts
474
+ * // stx.config.ts
475
+ * export default {
476
+ * app: {
477
+ * colorMode: { storageKey: 'theme', attribute: 'data-theme' },
478
+ * },
479
+ * }
480
+ * ```
481
+ */
482
+ colorMode?: ColorModeBootConfig;
483
+ /**
484
+ * Defaults for the native dev window (`stx dev --native`).
485
+ * Only used when the user passes `--native`. Sensible per-app sizes
486
+ * keep the window from opening at a one-size-fits-all 1400×900.
487
+ */
488
+ window?: {
489
+ /** Window width in points/pixels. Default: 1400. */
490
+ width?: number;
491
+ /** Window height in points/pixels. Default: 900. */
492
+ height?: number;
493
+ /** Open with the system dark theme. Default: true. */
494
+ darkMode?: boolean;
495
+ /** Enable hot-reload bridge inside the webview. Default: true. */
496
+ hotReload?: boolean;
497
+ };
498
+ };
499
+ /**
500
+ * Source root for .stx files.
501
+ * pages/, layouts/, components/, partials/ resolve relative to this.
502
+ *
503
+ * - Standalone app: defaults to '.' (project root)
504
+ * - Stacks app: auto-detected as 'resources/views' if that directory has pages/
505
+ * - Override: set explicitly to any path
506
+ *
507
+ * Note: the state directory (see `stateDir`), .output/ (build), and
508
+ * stx.config.ts stay at project root.
509
+ *
510
+ * @default '.' (auto-detects 'resources/views' if it exists with pages/)
511
+ */
512
+ root?: string;
513
+ /**
514
+ * Where stx keeps its generated state: the compiled-template cache, the
515
+ * Crosswind CSS cache, the client-script bundle cache and temp dir, the
516
+ * generated route manifest and route types, dev-server output, SSG and media
517
+ * caches, story snapshots.
518
+ *
519
+ * Point it at an existing home for generated state to keep the project root
520
+ * clean - a Stacks application sets `storage/framework/stx`. The path-shaped
521
+ * options that default to somewhere under `.stx/` (`cachePath`,
522
+ * `build.cacheDir`, `media.cache.directory`, `story.outDir`) follow this
523
+ * setting; a path you point somewhere else entirely is left alone.
524
+ *
525
+ * Relative paths resolve against the project root; absolute paths are used
526
+ * as-is. `STX_DIR` overrides this.
527
+ *
528
+ * @default '.stx'
529
+ */
530
+ stateDir?: string;
531
+ /**
532
+ * Pages directory name (relative to root).
533
+ * Standalone apps: 'pages' (default)
534
+ * Stacks apps: 'views'
535
+ *
536
+ * @default 'pages'
537
+ */
538
+ pagesDir?: string;
539
+ /**
540
+ * Root directory for templates
541
+ */
542
+ templatesDir?: string;
543
+ /**
544
+ * Default title to use for SEO if none is provided
545
+ */
546
+ defaultTitle?: string;
547
+ /**
548
+ * Default description to use for SEO if none is provided
549
+ */
550
+ defaultDescription?: string;
551
+ /**
552
+ * Default image URL to use for SEO/OpenGraph if none is provided
553
+ */
554
+ defaultImage?: string;
555
+ /**
556
+ * Enable server-side rendering at request time.
557
+ *
558
+ * - `false` (default) → SSG. `<script server>` runs at build time, output
559
+ * goes to `dist/` as flat HTML files. Deploy to S3 + CloudFront.
560
+ * - `true` → SSR. `<script server>` runs per-request on a Bun server,
561
+ * output goes to `.output/`. Deploy to EC2 behind CloudFront.
562
+ *
563
+ * `<script server>` works in both modes — this flag controls *when* it
564
+ * runs, not whether it's allowed.
565
+ *
566
+ * @default false
567
+ */
568
+ ssr?: boolean;
569
+ /**
570
+ * Enable or disable caching
571
+ */
572
+ cache?: boolean;
573
+ /**
574
+ * Cache directory path
575
+ */
576
+ cacheDir?: string;
577
+ /**
578
+ * Cache version, used to invalidate cache
579
+ */
580
+ cacheVersion?: string;
581
+ /**
582
+ * Enable stx features
583
+ */
584
+ enabled: boolean;
585
+ /** Path to partials directory, defaults to 'partials' in the same directory as the template */
586
+ partialsDir: string;
587
+ /** Path to components directory, defaults to 'components' in the same directory as the template */
588
+ componentsDir: string;
589
+ /** @internal Configured component root retained while nested components resolve locally. */
590
+ _rootComponentsDir?: string;
591
+ /** Path to layouts directory, defaults to 'layouts' in the project root */
592
+ layoutsDir?: string;
593
+ /**
594
+ * Path to the stores directory, resolved against `root`.
595
+ *
596
+ * Every `.ts` file in it (except `index.ts`, `types.ts` and `.d.ts`) is
597
+ * discovered, bundled, and injected ahead of any page script, so a
598
+ * `defineStore(...)` call has already run by the time `useStore('id')` looks
599
+ * it up. Files are ordered so stores that call `useStore()` load after the
600
+ * ones they depend on.
601
+ *
602
+ * @default 'stores'
603
+ */
604
+ storesDir?: string;
605
+ /**
606
+ * Path to the composables directory, resolved against `root`.
607
+ *
608
+ * Every `.ts` file in it (except `index.ts`, `types.ts` and `.d.ts`) is
609
+ * discovered, bundled, and injected ahead of any page script. Exported
610
+ * bindings are registered on `window.__composables`, which is what
611
+ * `import { useThing } from '@composables'` compiles to — a plain destructure
612
+ * in the page's own scope, so template directives can see the names.
613
+ *
614
+ * All composables share one scope, so they can call each other directly
615
+ * without importing.
616
+ *
617
+ * When unset, stx probes `composables/` and then `functions/`, so an app
618
+ * already using either layout works with no configuration.
619
+ *
620
+ * @default 'composables' (falls back to 'functions')
621
+ */
622
+ composablesDir?: string;
623
+ /** Default layout to use for pages without DOCTYPE, relative to layoutsDir */
624
+ defaultLayout?: string;
625
+ /** Plugins to load — npm packages, local paths, or [path, options] tuples */
626
+ plugins?: Array<string | [string, Record<string, any>]>;
627
+ /** Path to public/static assets directory, defaults to 'public' */
628
+ publicDir?: string;
629
+ /** Path to .env file, defaults to '.env' in project root (Bun loads this automatically) */
630
+ envFile?: string | boolean;
631
+ /** Environment variable prefix for client-side exposure (e.g. 'STX_PUBLIC_') */
632
+ envPrefix?: string;
633
+ /**
634
+ * Path to a `crosswind.config.*` file, or an inline Crosswind config. The
635
+ * inline object accepts any Crosswind field (`theme`, `fonts`, `safelist`,
636
+ * `shortcuts`, …) — e.g. load web fonts with
637
+ * `css: { fonts: { google: ['Inter:wght@400;700'] } }`.
638
+ */
639
+ css?: string | {
640
+ config?: string;
641
+ content?: string[];
642
+ preflight?: boolean;
643
+ minify?: boolean;
644
+ [key: string]: unknown;
645
+ };
646
+ /** Enable debug mode for detailed error messages */
647
+ debug: boolean;
648
+ /**
649
+ * Turn degraded-but-working behaviour into a hard failure.
650
+ *
651
+ * `bundlerFallback` decides what happens when a `<script client>` block will
652
+ * not bundle. The default `'warn'` ships the ORIGINAL, unbundled source so the
653
+ * page still renders, which is right for a dev server and is why the overlay
654
+ * exists; `'error'` refuses instead, for anyone who would rather nothing
655
+ * rendered than a page whose bindings quietly do nothing. `stx build` fails on
656
+ * a bundle error either way. See #1884.
657
+ */
658
+ strict?: {
659
+ bundlerFallback?: 'warn' | 'error';
660
+ };
661
+ /** Directory to store cached templates, defaults to `cache` inside `stateDir` */
662
+ cachePath: string;
663
+ /** Custom directives registered by the user */
664
+ customDirectives?: CustomDirective[];
665
+ /** Middleware for pre/post-processing templates */
666
+ middleware?: Middleware[];
667
+ /** Internationalization (i18n) configuration */
668
+ i18n?: Partial<I18nConfig>;
669
+ /** Web Components integration configuration */
670
+ webComponents?: Partial<WebComponentConfig>;
671
+ /** Documentation generator configuration */
672
+ docs?: Partial<DocGeneratorConfig>;
673
+ /** Streaming rendering configuration */
674
+ streaming?: Partial<StreamingConfig>;
675
+ /** Partial hydration configuration */
676
+ hydration?: Partial<HydrationConfig>;
677
+ /** Accessibility configuration */
678
+ a11y?: Partial<A11yConfig>;
679
+ /** SEO configuration */
680
+ seo?: Partial<SeoFeatureConfig>;
681
+ /** Analytics configuration */
682
+ analytics?: Partial<AnalyticsConfig>;
683
+ /** Animation system configuration */
684
+ animation?: Partial<AnimationConfig>;
685
+ /** Skip adding default SEO tags */
686
+ skipDefaultSeoTags?: boolean;
687
+ /** Skip injecting signals runtime (for nested component processing) */
688
+ skipSignalsRuntime?: boolean;
689
+ /** Skip event directive processing (for signal components where runtime handles @click etc.) */
690
+ skipEventDirectives?: boolean;
691
+ /** Markdown configuration */
692
+ markdown?: Partial<MarkdownConfig>;
693
+ /** Loop directive configuration */
694
+ loops?: Partial<LoopConfig>;
695
+ /** Form directives configuration */
696
+ forms?: Partial<FormConfig>;
697
+ /** Content Security Policy configuration */
698
+ csp?: Partial<CspConfig>;
699
+ /** Story (component showcase) configuration */
700
+ story?: Partial<import('../story/types').StoryConfig>;
701
+ /** Progressive Web App (PWA) configuration */
702
+ pwa?: Partial<PwaConfig>;
703
+ /** Component configuration */
704
+ components?: Partial<ComponentConfig>;
705
+ /** Route middleware configuration */
706
+ routeMiddleware?: Partial<RouteMiddlewareConfig>;
707
+ /** Heatmap tracking configuration */
708
+ heatmap?: Partial<HeatmapConfig>;
709
+ /** Static Site Generation (SSG) build configuration */
710
+ build?: Partial<BuildConfig>;
711
+ /** Media (images, video, uploads) configuration */
712
+ media?: Partial<MediaConfig>;
713
+ /**
714
+ * Strict mode for DOM API validation.
715
+ * When `true`, warns about raw `document.*` / `window.*` usage in client scripts.
716
+ * Pass a StrictModeConfig object for fine-grained control.
717
+ */
718
+ strict?: boolean | StrictModeConfig;
719
+ /**
720
+ * Build mode for the processing pipeline.
721
+ * - `undefined` (default): dev mode, inline everything per request
722
+ * - `'compile'`: build mode, emit asset reference placeholders instead of inline code
723
+ * - `'serve'`: serve mode, reference shared runtime and router assets
724
+ */
725
+ buildMode?: 'compile' | 'serve' | 'spa';
726
+ /**
727
+ * Auto-generate document shell (<!DOCTYPE>, <html>, <head>, <body>) around output.
728
+ * Set by serve paths to wrap page output. Not set for tests or programmatic usage.
729
+ * @default false
730
+ */
731
+ autoShell?: boolean;
732
+ /**
733
+ * Output directory for production builds.
734
+ * @default '.output'
735
+ */
736
+ outputDir?: string;
737
+ /**
738
+ * App shell file for single-shell mode.
739
+ * When set (or auto-detected as 'app.stx'), the shell wraps all pages.
740
+ * The shell's `<slot />` is replaced with page content.
741
+ * Direct requests get full shell + page; SPA navigation gets page fragments.
742
+ * @default undefined (auto-detects 'app.stx' in project root)
743
+ */
744
+ shell?: string | false;
745
+ /**
746
+ * Real-time broadcasting configuration (powered by ts-broadcasting).
747
+ *
748
+ * When enabled, stx starts a WebSocket broadcasting server alongside
749
+ * the dev server and injects client helpers automatically.
750
+ *
751
+ * @example
752
+ * ```ts
753
+ * // stx.config.ts
754
+ * export default {
755
+ * broadcasting: {
756
+ * enabled: true,
757
+ * port: 6001,
758
+ * }
759
+ * }
760
+ * ```
761
+ */
762
+ broadcasting?: Partial<BroadcastingConfig>;
763
+ /**
764
+ * Custom API routes for the dev server.
765
+ * Keys are path patterns (e.g. '/api/delete'), values are request handlers.
766
+ * Handlers receive the standard Request and return a Response.
767
+ */
768
+ apiRoutes?: Record<string, (request: Request) => Response | Promise<Response>>;
769
+ /**
770
+ * Client-side router configuration
771
+ */
772
+ router?: {
773
+ enabled?: boolean;
774
+ container?: string;
775
+ linkSelector?: string;
776
+ /**
777
+ * Intercept every in-app `<a>` for client-side navigation rather than
778
+ * only those matching `linkSelector`. Default: false.
779
+ */
780
+ interceptAllLinks?: boolean;
781
+ viewTransitions?: boolean;
782
+ /**
783
+ * Duration of the default View Transitions fade, in milliseconds.
784
+ * Only applied when viewTransitions is enabled and the browser supports
785
+ * document.startViewTransition. Default: 220.
786
+ */
787
+ viewTransitionDuration?: number;
788
+ /**
789
+ * Easing curve for the default View Transitions fade. Any valid CSS
790
+ * animation-timing-function. Default: cubic-bezier(0.16, 1, 0.3, 1).
791
+ */
792
+ viewTransitionEasing?: string;
793
+ scrollToTop?: boolean;
794
+ prefetch?: boolean;
795
+ cache?: boolean;
796
+ cacheTTL?: number;
797
+ skipSelectors?: string;
798
+ viewTransitionCSS?: Record<string, string>;
799
+ /**
800
+ * Show the top loading/progress bar during client-side navigation.
801
+ * Default: true.
802
+ */
803
+ progress?: boolean;
804
+ /**
805
+ * Progress-bar color (hex, rgb, css var, etc.). Default: '#78dce8'.
806
+ */
807
+ progressColor?: string;
808
+ /**
809
+ * Progress-bar height including units (e.g. '2px', '3px'). Default: '2px'.
810
+ */
811
+ progressHeight?: string;
812
+ };
813
+ /**
814
+ * Custom router instance (e.g. @stacksjs/bun-router) for API handling.
815
+ * When set, incoming requests are passed to router.handleRequest() before
816
+ * falling through to page routes. Takes precedence over apiRoutes for
817
+ * matching paths.
818
+ */
819
+ apiRouter?: {
820
+ handleRequest: (request: Request) => Response | Promise<Response>;
821
+ };
340
822
  }
341
823
  /**
342
824
  * SSG Build configuration for static site generation
343
825
  */
344
- export declare interface BuildConfig {
345
- pagesDir: string
346
- outputDir: string
347
- baseUrl: string
348
- domain?: string
349
- sitemap: boolean
350
- rss?: boolean | import('../ssg').RSSConfig
351
- minify: boolean
352
- cache: boolean
353
- cacheDir: string
354
- concurrency: number
355
- generate404: boolean
356
- publicDir: string
357
- trailingSlash: boolean
358
- cleanOutput: boolean
359
- revalidate?: number | false
826
+ export interface BuildConfig {
827
+ /** Directory containing page templates (default: 'pages') */
828
+ pagesDir: string;
829
+ /** Output directory for generated files (default: 'dist') */
830
+ outputDir: string;
831
+ /** Base URL path for the site (default: '/') */
832
+ baseUrl: string;
833
+ /** Site domain for absolute URLs in sitemap */
834
+ domain?: string;
835
+ /** Generate sitemap.xml (default: true) */
836
+ sitemap: boolean;
837
+ /** Generate RSS feed */
838
+ rss?: boolean | import('../ssg').RSSConfig;
839
+ /** Minify HTML output (default: true) */
840
+ minify: boolean;
841
+ /** Enable build caching (default: true) */
842
+ cache: boolean;
843
+ /** Cache directory (default: `ssg-cache` inside `stateDir`) */
844
+ cacheDir: string;
845
+ /** Parallel page generation limit (default: 10) */
846
+ concurrency: number;
847
+ /** Generate 404 page (default: true) */
848
+ generate404: boolean;
849
+ /** Directory with static assets to copy (default: 'public') */
850
+ publicDir: string;
851
+ /** Add trailing slashes to URLs (default: false) */
852
+ trailingSlash: boolean;
853
+ /** Clean output directory before build (default: true) */
854
+ cleanOutput: boolean;
855
+ /** ISR revalidation time in seconds */
856
+ revalidate?: number | false;
360
857
  }
361
- /**
362
- * Analytics driver type
363
- */
364
- export type AnalyticsDriver = 'fathom' | 'google-analytics' | 'plausible' | 'self-hosted' | 'custom';
365
- /**
366
- * Available syntax highlighting themes
367
- */
368
- export type SyntaxHighlightTheme = | 'css-variables'
369
- | 'dark-plus'
370
- | 'dracula'
371
- | 'dracula-soft'
372
- | 'github-dark'
373
- | 'github-dark-dimmed'
374
- | 'github-light'
375
- | 'hc_light'
376
- | 'light-plus'
377
- | 'material-theme'
378
- | 'material-theme-darker'
379
- | 'material-theme-lighter'
380
- | 'material-theme-ocean'
381
- | 'material-theme-palenight'
382
- | 'min-dark'
383
- | 'min-light'
384
- | 'monokai'
385
- | 'nord'
386
- | 'one-dark-pro'
387
- | 'poimandres'
388
- | 'rose-pine'
389
- | 'rose-pine-dawn'
390
- | 'rose-pine-moon'
391
- | 'slack-dark'
392
- | 'slack-ochin'
393
- | 'solarized-dark'
394
- | 'solarized-light'
395
- | 'vitesse-dark'
396
- | 'vitesse-light';
397
858
  export type StxOptions = Partial<StxConfig>;