@stacksjs/stx 0.2.5 → 0.2.6

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 (293) hide show
  1. package/dist/a11y.d.ts +2 -6
  2. package/dist/analytics.d.ts +1 -1
  3. package/dist/analyzer.d.ts +1 -1
  4. package/dist/animation.d.ts +10 -86
  5. package/dist/app.d.ts +2 -4
  6. package/dist/assets.d.ts +1 -1
  7. package/dist/ast.d.ts +3 -24
  8. package/dist/async-components.d.ts +1 -1
  9. package/dist/auth.d.ts +1 -1
  10. package/dist/browser-composables.d.ts +6 -4
  11. package/dist/build-optimizer.d.ts +4 -29
  12. package/dist/build-views.d.ts +20 -1
  13. package/dist/bundle-analyzer/collector.d.ts +1 -1
  14. package/dist/bundle-analyzer/index.d.ts +40 -4
  15. package/dist/bundle-analyzer/report.d.ts +1 -1
  16. package/dist/bundle-analyzer/treemap.d.ts +1 -1
  17. package/dist/caching.d.ts +1 -1
  18. package/dist/cli.js +1323 -511
  19. package/dist/client/directive.d.ts +1 -1
  20. package/dist/client/index.d.ts +6 -1
  21. package/dist/client/router.d.ts +3 -11
  22. package/dist/client/stx-router.browser.d.ts +1 -0
  23. package/dist/client-script.d.ts +2 -1
  24. package/dist/client.d.ts +2 -2
  25. package/dist/component-hmr.d.ts +4 -18
  26. package/dist/components.d.ts +1 -1
  27. package/dist/composables/index.d.ts +114 -1
  28. package/dist/composables/use-battery.d.ts +1 -1
  29. package/dist/composables/use-broadcast-channel.d.ts +2 -2
  30. package/dist/composables/use-clipboard.d.ts +1 -1
  31. package/dist/composables/use-color-mode.d.ts +52 -0
  32. package/dist/composables/use-cookie.d.ts +1 -1
  33. package/dist/composables/use-device-orientation.d.ts +1 -1
  34. package/dist/composables/use-event-listener.d.ts +35 -0
  35. package/dist/composables/use-event-source.d.ts +1 -1
  36. package/dist/composables/use-eye-dropper.d.ts +3 -2
  37. package/dist/composables/use-fetch.d.ts +1 -1
  38. package/dist/composables/use-fullscreen.d.ts +1 -1
  39. package/dist/composables/use-geolocation.d.ts +1 -1
  40. package/dist/composables/use-idle.d.ts +2 -2
  41. package/dist/composables/use-intersection-observer.d.ts +1 -1
  42. package/dist/composables/use-keyboard.d.ts +1 -2
  43. package/dist/composables/use-media-query.d.ts +1 -1
  44. package/dist/composables/use-meta.d.ts +35 -0
  45. package/dist/composables/use-mouse.d.ts +1 -1
  46. package/dist/composables/use-mutation-observer.d.ts +1 -1
  47. package/dist/composables/use-network.d.ts +1 -1
  48. package/dist/composables/use-notification.d.ts +10 -1
  49. package/dist/composables/use-permissions.d.ts +17 -7
  50. package/dist/composables/use-query.d.ts +43 -0
  51. package/dist/composables/use-resize-observer.d.ts +1 -1
  52. package/dist/composables/use-router.d.ts +59 -0
  53. package/dist/composables/use-share.d.ts +1 -1
  54. package/dist/composables/use-speech.d.ts +1 -1
  55. package/dist/composables/use-storage.d.ts +1 -1
  56. package/dist/composables/use-text-selection.d.ts +1 -1
  57. package/dist/composables/use-timer.d.ts +92 -0
  58. package/dist/composables/use-utilities.d.ts +103 -0
  59. package/dist/composables/use-wake-lock.d.ts +1 -1
  60. package/dist/composables/use-websocket.d.ts +3 -3
  61. package/dist/composables/use-window.d.ts +1 -1
  62. package/dist/composables.d.ts +10 -7
  63. package/dist/composition-api.d.ts +1 -14
  64. package/dist/computed.d.ts +10 -4
  65. package/dist/conditionals.d.ts +1 -1
  66. package/dist/config.d.ts +1 -1
  67. package/dist/craft-bridge.d.ts +1 -1
  68. package/dist/craft-compiler.d.ts +6 -3
  69. package/dist/craft-components.d.ts +1 -8
  70. package/dist/craft-entry.d.ts +1 -1
  71. package/dist/craft-ssr.d.ts +1 -1
  72. package/dist/csp.d.ts +2 -2
  73. package/dist/csrf.d.ts +1 -1
  74. package/dist/custom-directives.d.ts +1 -1
  75. package/dist/database.d.ts +8 -26
  76. package/dist/defer.d.ts +1 -1
  77. package/dist/deploy/config-generators.d.ts +1 -1
  78. package/dist/deploy/index.d.ts +6 -3
  79. package/dist/deploy/netlify.d.ts +1 -1
  80. package/dist/dev-server/crosswind.d.ts +11 -1
  81. package/dist/dev-server/index.d.ts +16 -1
  82. package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
  83. package/dist/dev-server/native-window.d.ts +1 -1
  84. package/dist/dev-server/port-utils.d.ts +2 -2
  85. package/dist/dev-server/terminal-colors.d.ts +1 -5
  86. package/dist/dev-server/theme-selector.d.ts +1 -1
  87. package/dist/dev-server/types.d.ts +3 -8
  88. package/dist/dev-server.d.ts +1 -4
  89. package/dist/devtools.d.ts +4 -1
  90. package/dist/directive-api.d.ts +3 -3
  91. package/dist/docs.d.ts +2 -2
  92. package/dist/dynamic-components.d.ts +1 -1
  93. package/dist/edge-runtime.d.ts +3 -3
  94. package/dist/env.d.ts +1 -1
  95. package/dist/error-boundaries.d.ts +1 -1
  96. package/dist/error-handling.d.ts +14 -1
  97. package/dist/errors/codes.d.ts +2 -17
  98. package/dist/errors/formatter.d.ts +1 -1
  99. package/dist/errors/index.d.ts +13 -1
  100. package/dist/errors/logger.d.ts +2 -15
  101. package/dist/errors/sanitizer.d.ts +1 -1
  102. package/dist/errors/types.d.ts +1 -1
  103. package/dist/events.d.ts +1 -1
  104. package/dist/expressions.d.ts +64 -90
  105. package/dist/formatter.d.ts +1 -1
  106. package/dist/forms-validation.d.ts +23 -24
  107. package/dist/forms.d.ts +5 -22
  108. package/dist/head.d.ts +5 -1
  109. package/dist/heatmap.d.ts +4 -7
  110. package/dist/hot-reload.d.ts +3 -8
  111. package/dist/hydration-runtime.d.ts +1 -1
  112. package/dist/hydration.d.ts +5 -32
  113. package/dist/i18n.d.ts +1 -9
  114. package/dist/image-optimization/build-plugin.d.ts +2 -2
  115. package/dist/image-optimization/component.d.ts +2 -2
  116. package/dist/image-optimization/directive.d.ts +2 -2
  117. package/dist/image-optimization/index.d.ts +55 -1
  118. package/dist/image-optimization/processor.d.ts +9 -4
  119. package/dist/includes.d.ts +1 -1
  120. package/dist/index.d.ts +29 -1
  121. package/dist/index.js +1387 -542
  122. package/dist/init.d.ts +1 -1
  123. package/dist/interactive.d.ts +1 -1
  124. package/dist/internal-markdown.d.ts +1 -1
  125. package/dist/js-ts.d.ts +1 -1
  126. package/dist/jsx-runtime.d.ts +1 -20
  127. package/dist/keep-alive.d.ts +1 -1
  128. package/dist/lazy-loader.d.ts +3 -35
  129. package/dist/loading-indicator.d.ts +2 -1
  130. package/dist/loops.d.ts +1 -1
  131. package/dist/markdown.d.ts +1 -1
  132. package/dist/media/client/blur-up.d.ts +1 -1
  133. package/dist/media/client/index.d.ts +17 -1
  134. package/dist/media/client/lazy-load.d.ts +1 -1
  135. package/dist/media/client/upload-handler.d.ts +1 -1
  136. package/dist/media/image/component.d.ts +2 -4
  137. package/dist/media/image/directive.d.ts +1 -1
  138. package/dist/media/image/editing.d.ts +1 -1
  139. package/dist/media/image/index.d.ts +25 -1
  140. package/dist/media/image/placeholder.d.ts +1 -1
  141. package/dist/media/image/processor/cache.d.ts +3 -4
  142. package/dist/media/image/processor/index.d.ts +9 -1
  143. package/dist/media/image/processor/optimizer.d.ts +2 -2
  144. package/dist/media/image/processor/responsive.d.ts +3 -2
  145. package/dist/media/image/srcset.d.ts +6 -4
  146. package/dist/media/index.d.ts +37 -1
  147. package/dist/media/manager/embed.d.ts +1 -1
  148. package/dist/media/protected/component.d.ts +2 -3
  149. package/dist/media/protected/index.d.ts +14 -1
  150. package/dist/media/protected/signature.d.ts +2 -2
  151. package/dist/media/shared/cache.d.ts +1 -1
  152. package/dist/media/shared/hash.d.ts +1 -1
  153. package/dist/media/shared/index.d.ts +6 -1
  154. package/dist/media/types.d.ts +16 -72
  155. package/dist/media/upload/component.d.ts +2 -16
  156. package/dist/media/upload/index.d.ts +8 -1
  157. package/dist/media/video/directive.d.ts +1 -1
  158. package/dist/media/video/index.d.ts +11 -2
  159. package/dist/media/video/processor/cache.d.ts +3 -4
  160. package/dist/media/video/processor/index.d.ts +9 -1
  161. package/dist/media/video/processor/streaming.d.ts +2 -2
  162. package/dist/media/video/processor/thumbnail.d.ts +2 -2
  163. package/dist/media/video/processor/transcoder.d.ts +2 -2
  164. package/dist/method-spoofing.d.ts +1 -1
  165. package/dist/middleware.d.ts +1 -1
  166. package/dist/native-build.d.ts +3 -6
  167. package/dist/parser/directive-parser.d.ts +1 -1
  168. package/dist/parser/expression-parser.d.ts +2 -1
  169. package/dist/parser/index.d.ts +14 -1
  170. package/dist/parser/tokenizer.d.ts +2 -18
  171. package/dist/partial-hydration.d.ts +5 -6
  172. package/dist/performance-utils.d.ts +5 -18
  173. package/dist/plugin-system.d.ts +2 -8
  174. package/dist/plugin.d.ts +1 -1
  175. package/dist/precompiler.d.ts +2 -67
  176. package/dist/process.d.ts +12 -2
  177. package/dist/production-build.d.ts +1 -37
  178. package/dist/props.d.ts +3 -30
  179. package/dist/pwa/audit.d.ts +1 -1
  180. package/dist/pwa/directives.d.ts +1 -1
  181. package/dist/pwa/icons.d.ts +7 -4
  182. package/dist/pwa/index.d.ts +46 -1
  183. package/dist/pwa/inject.d.ts +1 -1
  184. package/dist/pwa/manifest.d.ts +1 -1
  185. package/dist/pwa/offline.d.ts +1 -1
  186. package/dist/pwa/precache.d.ts +1 -1
  187. package/dist/pwa/service-worker.d.ts +1 -1
  188. package/dist/pwa/workbox-strategies.d.ts +1 -1
  189. package/dist/pwa/workbox.d.ts +1 -10
  190. package/dist/pwa.d.ts +1 -1
  191. package/dist/pwa.js +1242 -430
  192. package/dist/reactive-bindings.d.ts +1 -1
  193. package/dist/reactive.d.ts +1 -1
  194. package/dist/reactivity.d.ts +6 -50
  195. package/dist/release.d.ts +1 -1
  196. package/dist/route-middleware.d.ts +3 -3
  197. package/dist/router.d.ts +1 -1
  198. package/dist/routes.d.ts +2 -2
  199. package/dist/runtime.d.ts +4 -4
  200. package/dist/safe-evaluator.d.ts +1 -4
  201. package/dist/scaffolding.d.ts +1 -1
  202. package/dist/seo.d.ts +1 -5
  203. package/dist/serve.d.ts +1 -1
  204. package/dist/server-components.d.ts +1 -1
  205. package/dist/signals.d.ts +8 -168
  206. package/dist/slots.d.ts +2 -2
  207. package/dist/source-maps.d.ts +3 -22
  208. package/dist/spa-shell.d.ts +20 -0
  209. package/dist/ssg.d.ts +4 -6
  210. package/dist/ssg.js +1242 -430
  211. package/dist/ssr.d.ts +6 -14
  212. package/dist/state-management.d.ts +5 -45
  213. package/dist/stores-client.d.ts +3 -3
  214. package/dist/story/addons.d.ts +1 -1
  215. package/dist/story/analytics.d.ts +4 -11
  216. package/dist/story/auto-stories.d.ts +1 -1
  217. package/dist/story/bookmarks.d.ts +2 -6
  218. package/dist/story/bun-test.d.ts +1 -1
  219. package/dist/story/cli.d.ts +0 -25
  220. package/dist/story/collect/analyzer.d.ts +1 -1
  221. package/dist/story/collect/index.d.ts +5 -1
  222. package/dist/story/collect/parser.d.ts +1 -1
  223. package/dist/story/collect/scanner.d.ts +1 -1
  224. package/dist/story/collect/tree.d.ts +2 -2
  225. package/dist/story/commands/build.d.ts +1 -1
  226. package/dist/story/commands/dev.d.ts +1 -1
  227. package/dist/story/commands/index.d.ts +4 -1
  228. package/dist/story/commands/preview.d.ts +1 -1
  229. package/dist/story/compiled-output.d.ts +1 -1
  230. package/dist/story/composition.d.ts +1 -1
  231. package/dist/story/config-watcher.d.ts +1 -1
  232. package/dist/story/config.d.ts +2 -2
  233. package/dist/story/context.d.ts +1 -1
  234. package/dist/story/controls/index.d.ts +1 -1
  235. package/dist/story/crosswind.d.ts +1 -1
  236. package/dist/story/desktop-preview.d.ts +1 -1
  237. package/dist/story/docs-generator.d.ts +1 -1
  238. package/dist/story/errors.d.ts +1 -1
  239. package/dist/story/figma-export.d.ts +2 -2
  240. package/dist/story/generator.d.ts +1 -1
  241. package/dist/story/hmr.d.ts +1 -1
  242. package/dist/story/hot-swap.d.ts +1 -1
  243. package/dist/story/index.d.ts +49 -1
  244. package/dist/story/interactions.d.ts +1 -1
  245. package/dist/story/keyboard-shortcuts.d.ts +1 -1
  246. package/dist/story/output.d.ts +1 -1
  247. package/dist/story/performance.d.ts +3 -12
  248. package/dist/story/presets.d.ts +3 -8
  249. package/dist/story/props-validation.d.ts +11 -1
  250. package/dist/story/renderer.d.ts +1 -1
  251. package/dist/story/search-index.d.ts +2 -2
  252. package/dist/story/search.d.ts +2 -2
  253. package/dist/story/server.d.ts +1 -1
  254. package/dist/story/setup.d.ts +1 -1
  255. package/dist/story/snapshots.d.ts +1 -1
  256. package/dist/story/testing.d.ts +1 -1
  257. package/dist/story/theme.d.ts +1 -1
  258. package/dist/story/types.d.ts +3 -12
  259. package/dist/story/ui/code-panel.d.ts +1 -1
  260. package/dist/story/ui/controls-panel.d.ts +1 -1
  261. package/dist/story/ui/index.d.ts +5 -1
  262. package/dist/story/ui/navigation.d.ts +1 -1
  263. package/dist/story/ui/preview.d.ts +1 -1
  264. package/dist/story/visual-testing.d.ts +1 -1
  265. package/dist/streaming.d.ts +0 -59
  266. package/dist/suspense.d.ts +1 -1
  267. package/dist/teleport.d.ts +1 -1
  268. package/dist/testing.d.ts +62 -80
  269. package/dist/transitions.d.ts +1 -1
  270. package/dist/type-checker.d.ts +2 -26
  271. package/dist/types/component-types.d.ts +3 -3
  272. package/dist/types/config-types.d.ts +15 -30
  273. package/dist/types/context-types.d.ts +6 -5
  274. package/dist/types/csp-types.d.ts +2 -2
  275. package/dist/types/directive-types.d.ts +5 -5
  276. package/dist/types/index.d.ts +21 -1
  277. package/dist/types/pwa-types.d.ts +1 -6
  278. package/dist/types.d.ts +28 -1
  279. package/dist/typescript-templates.d.ts +1 -34
  280. package/dist/utils.d.ts +2 -1
  281. package/dist/validator.d.ts +1 -1
  282. package/dist/variable-extractor.d.ts +1 -1
  283. package/dist/view-composers.d.ts +1 -1
  284. package/dist/virtual-scrolling.d.ts +4 -1
  285. package/dist/visual-editor.d.ts +2 -30
  286. package/dist/visual-testing.d.ts +4 -1
  287. package/dist/vue-template.d.ts +1 -1
  288. package/dist/web-components/css-scoping.d.ts +1 -1
  289. package/dist/web-components/index.d.ts +10 -1
  290. package/dist/web-components/reactive-generator.d.ts +1 -1
  291. package/dist/web-components.d.ts +1 -1
  292. package/dist/x-element.d.ts +13 -6
  293. package/package.json +4 -4
@@ -21,4 +21,4 @@ declare interface ProcessedBindings {
21
21
  html: string
22
22
  bindings: BindingInfo[]
23
23
  stores: Set<string>
24
- }
24
+ }
@@ -97,4 +97,4 @@ export declare interface TransitionConfig {
97
97
  leaveStart?: string
98
98
  leaveEnd?: string
99
99
  duration?: number
100
- }
100
+ }
@@ -163,53 +163,6 @@ export declare function unmountInstance(instance: ComponentInstance): Promise<vo
163
163
  * This is injected into the page to enable reactivity.
164
164
  */
165
165
  export declare function generateClientRuntime(): string;
166
- /**
167
- * Vue-Style Reactivity Module
168
- *
169
- * Provides Vue 3 Composition API-style reactivity for STX templates.
170
- * This module is designed to feel familiar to Vue developers while
171
- * leveraging STX's template processing capabilities.
172
- *
173
- * ## Core Primitives
174
- *
175
- * - `ref()` - Create a reactive reference
176
- * - `reactive()` - Create a reactive object
177
- * - `computed()` - Create a computed value
178
- * - `watch()` - Watch reactive sources
179
- * - `watchEffect()` - Auto-track dependencies
180
- *
181
- * ## Lifecycle Hooks
182
- *
183
- * - `onBeforeMount()` - Before DOM insertion
184
- * - `onMounted()` - Component in DOM
185
- * - `onBeforeUpdate()` - Before re-render
186
- * - `onUpdated()` - After re-render
187
- * - `onBeforeUnmount()` - Before cleanup
188
- * - `onUnmounted()` - After cleanup
189
- *
190
- * ## Usage
191
- *
192
- * ```html
193
- * <script client>
194
- * import { ref, onMounted, watch } from 'stx'
195
- *
196
- * const count = ref(0)
197
- * const users = ref([])
198
- *
199
- * onMounted(async () => {
200
- * users.value = await fetch('/api/users').then(r => r.json())
201
- * })
202
- *
203
- * watch(count, (newVal, oldVal) => {
204
- * console.log(`Count changed: ${oldVal} -> ${newVal}`)
205
- * })
206
- * </script>
207
- *
208
- * <button @click="count++">Count: {{ count }}</button>
209
- * ```
210
- *
211
- * @module reactivity
212
- */
213
166
  /** Reactive reference wrapper */
214
167
  export declare interface Ref<T> {
215
168
  value: T
@@ -243,11 +196,14 @@ export declare interface ReactiveScope {
243
196
  cleanups: (() => void)[]
244
197
  }
245
198
  /** Subscriber callback */
246
- export type WatchCallback<T> = (newValue: T, oldValue: T | undefined) => void
199
+ export type WatchCallback<T> = (newValue: T, oldValue: T | undefined) => void;
247
200
  /** Lifecycle hook callback */
248
- export type LifecycleHook = () => void | Promise<void>
201
+ export type LifecycleHook = () => void | Promise<void>;
202
+ // =============================================================================
203
+ // Exports
204
+ // =============================================================================
249
205
  export {
250
206
  ref as createRef,
251
207
  reactive as createReactive,
252
208
  computed as createComputed,
253
- };
209
+ };
package/dist/release.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const gitHash: string;
1
+ export declare const gitHash: string;
@@ -219,14 +219,14 @@ export declare interface MiddlewareResult {
219
219
  /**
220
220
  * Middleware execution mode
221
221
  */
222
- export type MiddlewareMode = 'universal' | 'server' | 'client'
222
+ export type MiddlewareMode = 'universal' | 'server' | 'client';
223
223
  /**
224
224
  * Middleware handler function
225
225
  */
226
226
  export type RouteMiddlewareHandler = (
227
227
  context: MiddlewareContext
228
- ) => void | Promise<void> | NavigationResult | Promise<NavigationResult | void>
228
+ ) => void | Promise<void> | NavigationResult | Promise<NavigationResult | void>;
229
229
  /**
230
230
  * Result from middleware (redirect or abort)
231
231
  */
232
- export type NavigationResult = NavigateToResult | AbortNavigationResult
232
+ export type NavigationResult = NavigateToResult | AbortNavigationResult;
package/dist/router.d.ts CHANGED
@@ -28,4 +28,4 @@ export declare interface RouteMatch {
28
28
  export declare interface RouterOptions {
29
29
  pagesDir?: string
30
30
  extensions?: string[]
31
- }
31
+ }
package/dist/routes.d.ts CHANGED
@@ -13,7 +13,7 @@ export declare function defineRoutes(routeDefinitions: Record<string, string | R
13
13
  /**
14
14
  * Generate a URL for a named route with parameters
15
15
  */
16
- export declare function route(name: string, params?: Record<string, any>, absolute?: any): string;
16
+ export declare function route(name: string, params?: Record<string, any>, absolute?: boolean): string;
17
17
  /**
18
18
  * Create a route URL directive processor for stx templates
19
19
  */
@@ -26,4 +26,4 @@ declare interface RouteDefinition {
26
26
  path: string
27
27
  name?: string
28
28
  params?: Record<string, any>
29
- }
29
+ }
package/dist/runtime.d.ts CHANGED
@@ -25,7 +25,7 @@ export declare function getStoreNames(): string[];
25
25
  /**
26
26
  * Wait for a store to be ready (for async initialization)
27
27
  */
28
- export declare function waitForStore<T = unknown>(name: string, timeout?: any): Promise<StoreRef<T>>;
28
+ export declare function waitForStore<T = unknown>(name: string, timeout?: number): Promise<StoreRef<T>>;
29
29
  /**
30
30
  * Get current route parameters
31
31
  *
@@ -130,11 +130,11 @@ export declare interface StoreRef<T = unknown> {
130
130
  // Route Params
131
131
  // =============================================================================
132
132
  export declare interface RouteParams {
133
-
133
+ [key: string]: string
134
134
  }
135
135
  // =============================================================================
136
136
  // Middleware State
137
137
  // =============================================================================
138
138
  export declare interface MiddlewareState {
139
-
140
- }
139
+ [key: string]: unknown
140
+ }
@@ -118,13 +118,10 @@ export declare function isForExpressionSafe(expression: string): boolean;
118
118
  * @returns A function that executes the loop safely
119
119
  */
120
120
  export declare function createSafeLoopFunction(loopType: 'for' | 'while', expression: string, body: string, contextKeys: string[], maxIterations?: number): (...args: unknown[]) => string;
121
- /**
122
- * Safe expression evaluator that reduces security risks from using new Function()
123
- */
124
121
  /**
125
122
  * Safe evaluator configuration options
126
123
  */
127
124
  export declare interface SafeEvaluatorConfig {
128
125
  maxSanitizeDepth: number
129
126
  allowBracketNotation: boolean
130
- }
127
+ }
@@ -110,4 +110,4 @@ export declare interface ScaffoldResult {
110
110
  /**
111
111
  * Project template options
112
112
  */
113
- export type ProjectTemplate = 'default' | 'minimal' | 'full' | 'blog' | 'dashboard' | 'landing'
113
+ export type ProjectTemplate = 'default' | 'minimal' | 'full' | 'blog' | 'dashboard' | 'landing';
package/dist/seo.d.ts CHANGED
@@ -105,10 +105,6 @@ export declare const metaDirective: CustomDirective;
105
105
  * SEO structured data directive for JSON-LD generation
106
106
  */
107
107
  export declare const structuredDataDirective: CustomDirective;
108
- declare interface StructuredData {
109
- '@context': string
110
- '@type': string
111
- }
112
108
  /**
113
109
  * URL entry for sitemap
114
110
  */
@@ -143,4 +139,4 @@ export declare interface RobotsOptions {
143
139
  rules: RobotsRule[]
144
140
  sitemap?: string | string[]
145
141
  host?: string
146
- }
142
+ }
package/dist/serve.d.ts CHANGED
@@ -32,4 +32,4 @@ export declare interface ServeResult {
32
32
  server: Server<any>
33
33
  stop: () => void
34
34
  url: string
35
- }
35
+ }
@@ -131,4 +131,4 @@ declare interface SuspenseState {
131
131
  promise?: Promise<unknown>
132
132
  result?: string
133
133
  error?: Error
134
- }
134
+ }
package/dist/signals.d.ts CHANGED
@@ -274,169 +274,6 @@ export declare function generateSignalsRuntime(): string;
274
274
  * @returns Human-readable JavaScript runtime code
275
275
  */
276
276
  export declare function generateSignalsRuntimeDev(): string;
277
- /**
278
- * STX Signals - Reactive State Management
279
- * =========================================
280
- *
281
- * A simple, intuitive reactivity system for STX templates.
282
- * Signals provide fine-grained reactivity with automatic dependency tracking
283
- * and seamless template integration.
284
- *
285
- * ## Why Signals?
286
- *
287
- * - **No `.value` needed** - Read with `count()`, write with `count.set(5)`
288
- * - **Automatic tracking** - Dependencies are tracked automatically in effects
289
- * - **Fine-grained updates** - Only affected DOM nodes update, not the whole component
290
- * - **Simple API** - Just `state`, `derived`, and `effect`
291
- * - **Seamless syntax** - Same `@if`, `@for` directives work on server and client
292
- *
293
- * ## Quick Start
294
- *
295
- * ```html
296
- * <script>
297
- * const count = state(0)
298
- * const items = state(['Apple', 'Banana', 'Cherry'])
299
- * const showList = state(true)
300
- *
301
- * function increment() {
302
- * count.update(n => n + 1)
303
- * }
304
- *
305
- * function addItem() {
306
- * items.update(list => [...list, 'New Item'])
307
- * }
308
- * </script>
309
- *
310
- * <button @click="increment">Count: {{ count }}</button>
311
- *
312
- * <button @click="showList.set(!showList())">Toggle List</button>
313
- *
314
- * @if="showList()"
315
- * <ul>
316
- * <li @for="item in items()">{{ item }}</li>
317
- * </ul>
318
- * @endif
319
- *
320
- * <button @click="addItem">Add Item</button>
321
- * ```
322
- *
323
- * ## Core Concepts
324
- *
325
- * ### State
326
- * A state signal holds a reactive value. Read it by calling it as a function,
327
- * write it using `.set()` or `.update()`.
328
- *
329
- * ```typescript
330
- * const count = state(0) // Create with initial value
331
- * console.log(count()) // Read: 0
332
- * count.set(5) // Write: set to 5
333
- * count.update(n => n + 1) // Update: increment by 1
334
- * ```
335
- *
336
- * ### Derived
337
- * A derived signal computes its value from other signals. It automatically
338
- * updates when its dependencies change.
339
- *
340
- * ```typescript
341
- * const firstName = state('John')
342
- * const lastName = state('Doe')
343
- * const fullName = derived(() => `${firstName()} ${lastName()}`)
344
- *
345
- * console.log(fullName()) // "John Doe"
346
- * firstName.set('Jane')
347
- * console.log(fullName()) // "Jane Doe"
348
- * ```
349
- *
350
- * ### Effect
351
- * Effects run side effects when their dependencies change. They're perfect
352
- * for logging, API calls, or DOM manipulation.
353
- *
354
- * ```typescript
355
- * const searchQuery = state('')
356
- *
357
- * effect(() => {
358
- * // This runs whenever searchQuery changes
359
- * fetchResults(searchQuery())
360
- * })
361
- * ```
362
- *
363
- * ## Template Syntax (all use @ prefix)
364
- *
365
- * All directives work seamlessly on both server-side and client-side.
366
- * Server-side directives are processed at build time. Reactive directives
367
- * (those using signals) are handled by the client runtime.
368
- *
369
- * ### Text Interpolation
370
- * ```html
371
- * <p>{{ message }}</p>
372
- * <p>{{ user.name }}</p>
373
- * <p>{{ items().length }} items</p>
374
- * ```
375
- *
376
- * ### Conditional Rendering
377
- * ```html
378
- * <div @if="isVisible()">Shown when true</div>
379
- * <div @if="user()">Welcome, {{ user().name }}</div>
380
- * ```
381
- *
382
- * ### List Rendering
383
- * ```html
384
- * <ul>
385
- * <li @for="item in items()">{{ item.name }}</li>
386
- * </ul>
387
- *
388
- * <div @for="item, index in items()">
389
- * {{ index }}: {{ item }}
390
- * </div>
391
- * ```
392
- *
393
- * ### Visibility Toggle
394
- * ```html
395
- * <!-- @show keeps element in DOM but toggles display -->
396
- * <p @show="hasContent()">Toggles visibility</p>
397
- * ```
398
- *
399
- * ### Attribute Binding
400
- * ```html
401
- * <img @bind:src="imageUrl()" @bind:alt="imageAlt()">
402
- * <button @bind:disabled="isLoading()">Submit</button>
403
- * <div @class="{ active: isActive(), hidden: !visible() }">
404
- * ```
405
- *
406
- * ### Event Handling
407
- * ```html
408
- * <button @click="handleClick">Click me</button>
409
- * <input @input="updateValue" @keydown.enter="submit">
410
- * <form @submit.prevent="handleSubmit">
411
- * ```
412
- *
413
- * ### Two-Way Binding
414
- * ```html
415
- * <input @model="username">
416
- * <textarea @model="message"></textarea>
417
- * <select @model="selectedOption">
418
- * ```
419
- *
420
- * ### Text and HTML Content
421
- * ```html
422
- * <span @text="message()"></span>
423
- * <div @html="richContent()"></div>
424
- * ```
425
- *
426
- * ## Lifecycle Hooks
427
- *
428
- * ```typescript
429
- * onMount(() => {
430
- * console.log('Component mounted')
431
- * })
432
- *
433
- * onDestroy(() => {
434
- * console.log('Component destroyed')
435
- * })
436
- * ```
437
- *
438
- * @module signals
439
- */
440
277
  /**
441
278
  * A reactive state signal.
442
279
  *
@@ -455,7 +292,7 @@ export declare interface Signal<T> {
455
292
  set(value: T): void
456
293
  update(fn: (current: T) => T): void
457
294
  subscribe(callback: (value: T, prev: T) => void): () => void
458
- _isSignal: true
295
+ readonly _isSignal: true
459
296
  }
460
297
  /**
461
298
  * A derived (computed) signal that automatically updates when dependencies change.
@@ -468,7 +305,7 @@ export declare interface Signal<T> {
468
305
  */
469
306
  export declare interface DerivedSignal<T> {
470
307
  (): T
471
- _isDerived: true
308
+ readonly _isDerived: true
472
309
  }
473
310
  /**
474
311
  * Options for creating effects.
@@ -480,11 +317,14 @@ export declare interface EffectOptions {
480
317
  /**
481
318
  * Cleanup function returned by effects.
482
319
  */
483
- export type CleanupFn = () => void
320
+ export type CleanupFn = () => void;
484
321
  /**
485
322
  * Lifecycle hook callback.
486
323
  */
487
- export type LifecycleCallback = () => void | CleanupFn | Promise<void>
324
+ export type LifecycleCallback = () => void | CleanupFn | Promise<void>;
325
+ // =============================================================================
326
+ // Default Export
327
+ // =============================================================================
488
328
  export default {
489
329
  state,
490
330
  derived,
@@ -498,4 +338,4 @@ export default {
498
338
  peek,
499
339
  generateSignalsRuntime,
500
340
  generateSignalsRuntimeDev
501
- };
341
+ };
package/dist/slots.d.ts CHANGED
@@ -55,9 +55,9 @@ export declare interface SlotDefinition {
55
55
  propsBinding?: string
56
56
  }
57
57
  export declare interface SlotProps {
58
-
58
+ [key: string]: unknown
59
59
  }
60
60
  export declare interface ParsedSlots {
61
61
  default: string
62
62
  named: Map<string, SlotDefinition>
63
- }
63
+ }
@@ -51,18 +51,11 @@ export declare interface SourceMapV3 {
51
51
  * Source map generator for stx templates
52
52
  */
53
53
  export declare class SourceMapGenerator {
54
- private file: string;
55
- private sourceRoot?: string;
56
- private sources: string[];
57
- private sourcesContent: Map<string, string>;
58
- private names: string[];
59
- private mappings: Mapping[];
60
54
  constructor(file: string, sourceRoot?: string);
61
55
  addSource(path: string, content?: string): number;
62
56
  addName(name: string): number;
63
57
  addMapping(mapping: Mapping): void;
64
58
  addMappingRange(generatedStart: Position, source: string, originalStart: Position, lineCount: number): void;
65
- private generateMappings(): string;
66
59
  toJSON(): SourceMapV3;
67
60
  toString(): string;
68
61
  toDataURL(): string;
@@ -74,17 +67,7 @@ export declare class SourceMapGenerator {
74
67
  * Source map consumer for parsing and querying source maps
75
68
  */
76
69
  export declare class SourceMapConsumer {
77
- private sourceMap: SourceMapV3;
78
- private decodedMappings: Array<{
79
- generatedLine: number
80
- generatedColumn: number
81
- sourceIndex: number
82
- originalLine: number
83
- originalColumn: number
84
- nameIndex: number
85
- }>;
86
70
  constructor(sourceMap: SourceMapV3 | string);
87
- private decodeMappings(): void;
88
71
  originalPositionFor(generated: Position): {
89
72
  source: string | null
90
73
  line: number | null
@@ -96,15 +79,13 @@ export declare class SourceMapConsumer {
96
79
  column: number | null
97
80
  };
98
81
  sourceContentFor(source: string): string | null;
82
+ get sources(): string[];
83
+ get rawSourceMap(): SourceMapV3;
99
84
  }
100
85
  /**
101
86
  * Tracks positions during template transformation for source map generation
102
87
  */
103
88
  export declare class TemplateTracker {
104
- private generator: SourceMapGenerator;
105
- private currentGeneratedLine: any;
106
- private currentGeneratedColumn: any;
107
- private sourceFile: string;
108
89
  constructor(outputFile: string, sourceFile: string, sourceContent?: string);
109
90
  trackReplacement(originalLine: number, originalColumn: number, generatedContent: string): void;
110
91
  trackInclude(includeFile: string, includeContent: string, generatedContent: string): void;
@@ -114,4 +95,4 @@ export declare class TemplateTracker {
114
95
  getGenerator(): SourceMapGenerator;
115
96
  toJSON(): SourceMapV3;
116
97
  toInlineComment(): string;
117
- }
98
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Generate a client-side SPA shell that wraps the raw template
3
+ * for client-side rendering.
4
+ */
5
+ export declare function generateSpaShell(options: SpaShellOptions): string;
6
+ /**
7
+ * SPA Shell Generator
8
+ *
9
+ * When `ssr: false` is set in the config, templates are not processed
10
+ * server-side. Instead, a client-side shell is served that contains:
11
+ * - A mount point for the application
12
+ * - The raw template in a <template> tag
13
+ * - Serialized context data for client-side hydration
14
+ * - A bootstrap script that initializes the signals runtime
15
+ */
16
+ export declare interface SpaShellOptions {
17
+ template: string
18
+ context?: Record<string, unknown>
19
+ title?: string
20
+ }
package/dist/ssg.d.ts CHANGED
@@ -126,9 +126,6 @@ export declare interface CachedPage {
126
126
  headers?: Record<string, string>
127
127
  }
128
128
  declare class BuildCache {
129
- private cacheDir: string;
130
- private cache: Map<string, BuildCacheEntry>;
131
- private loaded: any;
132
129
  constructor(cacheDir: string);
133
130
  load(): Promise<void>;
134
131
  save(): Promise<void>;
@@ -140,18 +137,19 @@ declare class BuildCache {
140
137
  // ISR Cache Implementation
141
138
  // =============================================================================
142
139
  declare class FileISRCache implements ISRCache {
143
- private cacheDir: string;
144
140
  constructor(cacheDir: string);
145
- private getFilePath(route: string): string;
146
141
  get(route: string): Promise<CachedPage | null>;
147
142
  set(route: string, page: CachedPage): Promise<void>;
148
143
  invalidate(route: string): Promise<void>;
149
144
  invalidatePattern(pattern: RegExp): Promise<void>;
150
145
  needsRevalidation(route: string): Promise<boolean>;
151
146
  }
147
+ // =============================================================================
148
+ // Exports
149
+ // =============================================================================
152
150
  export default {
153
151
  generateStaticSite,
154
152
  createISRHandler,
155
153
  defineStaticPaths,
156
154
  createMarkdownLoader,
157
- };
155
+ };