@stacksjs/stx 0.2.4 → 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
package/dist/a11y.d.ts CHANGED
@@ -73,7 +73,7 @@ export declare function autoFixA11y(html: string, config?: A11yAutoFixConfig): A
73
73
  * @param writeBack - Whether to write the fixed content back to the file
74
74
  * @returns Fix result
75
75
  */
76
- export declare function autoFixA11yFile(filePath: string, config?: A11yAutoFixConfig, writeBack?: any): Promise<A11yFixResult>;
76
+ export declare function autoFixA11yFile(filePath: string, config?: A11yAutoFixConfig, writeBack?: boolean): Promise<A11yFixResult>;
77
77
  /**
78
78
  * Auto-fix accessibility issues in a directory of files.
79
79
  *
@@ -96,10 +96,6 @@ export declare function autoFixA11yDirectory(directory: string, config?: A11yAut
96
96
  * Register all a11y directives
97
97
  */
98
98
  export declare function registerA11yDirectives(): CustomDirective[];
99
- /**
100
- * A11y directive for adding accessibility hints
101
- */
102
- export declare const a11yDirective: CustomDirective;
103
99
  /**
104
100
  * Screen reader directive for screen reader only content
105
101
  */
@@ -141,4 +137,4 @@ export declare interface A11yAutoFixConfig {
141
137
  fixPositiveTabindex?: boolean
142
138
  fixButtonFocusable?: boolean
143
139
  defaultLang?: string
144
- }
140
+ }
@@ -37,4 +37,4 @@ export declare function injectAnalytics(html: string, options: StxOptions): stri
37
37
  /**
38
38
  * Custom @analytics directive for explicit placement
39
39
  */
40
- export declare const analyticsDirective: CustomDirective;
40
+ export declare const analyticsDirective: CustomDirective;
@@ -61,4 +61,4 @@ export declare interface ProjectSummary {
61
61
  issuesByCategory: Record<string, number>
62
62
  performanceScore: number
63
63
  recommendations: string[]
64
- }
64
+ }
@@ -1,8 +1,4 @@
1
1
  import type { CustomDirective, StxOptions } from './types';
2
- /**
3
- * Process animation directives in the template
4
- */
5
- export declare function processAnimationDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions): string;
6
2
  /**
7
3
  * Create an animation timeline for coordinated animations
8
4
  */
@@ -33,59 +29,6 @@ export declare const DEFAULT_TRANSITION_OPTIONS: {
33
29
  ease: string
34
30
  direction: string
35
31
  };
36
- /**
37
- * Transition directive for applying transitions to elements
38
- */
39
- export declare const transitionDirective: CustomDirective;
40
- /**
41
- * Scroll animation directive for triggering animations on scroll
42
- */
43
- export declare const scrollAnimateDirective: CustomDirective;
44
- /**
45
- * Animation group directive for coordinating multiple animations
46
- */
47
- export declare const animationGroupDirective: CustomDirective;
48
- /**
49
- * Motion preferences directive for controlling animation preferences
50
- */
51
- export declare const motionDirective: CustomDirective;
52
- /** Preset spring configurations */
53
- export declare const SPRING_PRESETS: {
54
- default: {
55
- stiffness: 100;
56
- damping: 10;
57
- mass: 1
58
- };
59
- gentle: {
60
- stiffness: 120;
61
- damping: 14;
62
- mass: 1
63
- };
64
- wobbly: {
65
- stiffness: 180;
66
- damping: 12;
67
- mass: 1
68
- };
69
- stiff: {
70
- stiffness: 210;
71
- damping: 20;
72
- mass: 1
73
- };
74
- slow: {
75
- stiffness: 280;
76
- damping: 60;
77
- mass: 1
78
- };
79
- molasses: {
80
- stiffness: 280;
81
- damping: 120;
82
- mass: 1
83
- }
84
- };
85
- /**
86
- * @keyframe directive for custom keyframe animations
87
- */
88
- export declare const keyframeDirective: CustomDirective;
89
32
  /**
90
33
  * @stagger directive for staggered child animations
91
34
  */
@@ -94,34 +37,15 @@ export declare const staggerDirective: CustomDirective;
94
37
  * @spring directive for spring physics animations
95
38
  */
96
39
  export declare const springDirective: CustomDirective;
97
- /** Keyframe definition */
98
- export declare interface Keyframe {
99
- offset?: number
100
- properties: Record<string, string | number>
101
- easing?: string
102
- }
103
- /** Animation timeline entry */
104
- export declare interface TimelineEntry {
105
- selector: string
106
- keyframes: Keyframe[]
107
- options: KeyframeAnimationOptions
108
- }
109
- /** Keyframe animation options */
110
- export declare interface KeyframeAnimationOptions {
111
- duration: number
112
- delay?: number
113
- easing?: string
114
- iterations?: number | 'infinite'
115
- direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'
116
- fill?: 'none' | 'forwards' | 'backwards' | 'both'
117
- }
118
- /** Spring animation config */
119
- export declare interface SpringConfig {
120
- stiffness: number
121
- damping: number
122
- mass: number
123
- velocity?: number
124
- }
40
+ declare type = : TransitionType,
41
+ options: {
42
+ duration?: number
43
+ delay?: number
44
+ ease?: TransitionEase
45
+ direction?: TransitionDirection
46
+ custom?: string
47
+ } = {},
48
+ ): string {;
125
49
  /**
126
50
  * Available transition types that can be used with @transition directive
127
51
  */
@@ -151,4 +75,4 @@ export declare enum TransitionEase {
151
75
  EaseOut = 'ease-out',
152
76
  EaseInOut = 'ease-in-out',
153
77
  Spring = 'spring',
154
- }
78
+ }
package/dist/app.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare interface StxAppPlugin {
24
24
  /** The stx application instance */
25
25
  export declare interface StxApp {
26
26
  use(plugin: StxPluginInput, ...options: any[]): StxApp
27
- provide(key: string | symbol, value: T): StxApp
27
+ provide<T>(key: string | symbol, value: T): StxApp
28
28
  component(name: string, definition?: any): StxApp | any
29
29
  directive(name: string, definition?: CustomDirective | Record<string, any>): StxApp | any
30
30
  mount(rootContainer?: string | Element): StxApp
@@ -41,11 +41,9 @@ export declare interface StxAppConfig {
41
41
  globalProperties: Record<string, any>
42
42
  performance: boolean
43
43
  compilerOptions: {
44
- /** Custom element tag pattern */
45
44
  isCustomElement?: (tag: string) => boolean
46
- /** Whitespace handling */
47
45
  whitespace?: 'condense' | 'preserve'
48
46
  }
49
47
  }
50
48
  /** Plugin can be an object with install() or a plain function */
51
- export type StxPluginInput = StxAppPlugin | ((app: StxApp, ...options: any[]) => void)
49
+ export type StxPluginInput = StxAppPlugin | ((app: StxApp, ...options: any[]) => void);
package/dist/assets.d.ts CHANGED
@@ -16,4 +16,4 @@ export declare const markdownCache: Map<string, {
16
16
  content: string
17
17
  data: Record<string, any>
18
18
  updatedAt: number
19
- }>;
19
+ }>;
package/dist/ast.d.ts CHANGED
@@ -242,7 +242,7 @@ export type ASTNode = | DocumentNode
242
242
  | AttributeNode
243
243
  | CommentNode
244
244
  | ScriptNode
245
- | StyleNode
245
+ | StyleNode;
246
246
  /**
247
247
  * Token types for lexer (reserved for future tokenizer implementation)
248
248
  */
@@ -256,31 +256,10 @@ declare type _TokenType = | 'TEXT'
256
256
  | 'TAG_OPEN'
257
257
  | 'TAG_CLOSE'
258
258
  | 'TAG_SELF_CLOSE'
259
- | 'EOF'
259
+ | 'EOF';
260
260
  /**
261
261
  * Simple template parser
262
262
  */
263
263
  export declare class TemplateParser {
264
- private source: string;
265
- private pos: number;
266
- private line: number;
267
- private column: number;
268
- private filePath?: string;
269
264
  parse(template: string, filePath?: string): DocumentNode;
270
- private parseChildren(stopAt?: RegExp): ASTNode[];
271
- private parseNext(): ASTNode | null;
272
- private parseText(): TextNode | null;
273
- private parseExpression(escaped: boolean): ExpressionNode;
274
- private parseDirective(): DirectiveNode;
275
- private parseParenthesized(): string;
276
- private parseStxComment(): CommentNode;
277
- private parseHtmlComment(): CommentNode;
278
- private parseTag(): ElementNode | ComponentNode;
279
- private parseAttributes(): AttributeNode[];
280
- private parseAttribute(): AttributeNode | null;
281
- private parseScript(): ScriptNode;
282
- private parseStyle(): StyleNode;
283
- private advance(count?: number): void;
284
- private skipWhitespace(): void;
285
- private getPosition(): Position;
286
- }
265
+ }
@@ -98,4 +98,4 @@ export declare interface DefineAsyncComponentOptions {
98
98
  }
99
99
  export declare interface AsyncComponentDefinition extends DefineAsyncComponentOptions {
100
100
  __asyncComponent: true
101
- }
101
+ }
package/dist/auth.d.ts CHANGED
@@ -7,4 +7,4 @@
7
7
  * @param {Record<string, any>} context - The context object containing variables
8
8
  * @returns The evaluated result
9
9
  */
10
- export declare function evaluateAuthExpression(expression: string, context: Record<string, any>): any;
10
+ export declare function evaluateAuthExpression(expression: string, context: Record<string, any>): any;
@@ -30,7 +30,6 @@ export declare function useSessionStorage<T>(key: string, defaultValue: T): { va
30
30
  export declare function useEventListener<K extends keyof WindowEventMap>(event: K, handler: (e: WindowEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
31
31
  export declare function useEventListener<K extends keyof DocumentEventMap>(target: Document, event: K, handler: (e: DocumentEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
32
32
  export declare function useEventListener<K extends keyof HTMLElementEventMap>(target: MaybeRef<HTMLElement | null>, event: K, handler: (e: HTMLElementEventMap[K]) => void, options?: AddEventListenerOptions): () => void;
33
- export declare function useEventListener(...args: any[]): () => void;
34
33
  /**
35
34
  * Detect clicks outside an element.
36
35
  *
@@ -192,7 +191,7 @@ export declare function useTimeout(callback: () => void, delay: number): {
192
191
  * setOpen(false) // false
193
192
  * ```
194
193
  */
195
- export declare function useToggle(initial?: any): [{ value: boolean }, () => void, (value: boolean) => void];
194
+ export declare function useToggle(initial?: boolean): [{ value: boolean }, () => void, (value: boolean) => void];
196
195
  /**
197
196
  * Counter with controls.
198
197
  *
@@ -204,7 +203,7 @@ export declare function useToggle(initial?: any): [{ value: boolean }, () => voi
204
203
  * dec() // 5
205
204
  * ```
206
205
  */
207
- export declare function useCounter(initial?: any, options?: { min?: number; max?: number }): {
206
+ export declare function useCounter(initial?: number, options?: { min?: number; max?: number }): {
208
207
  count: { value: number }
209
208
  inc: (delta?: number) => void
210
209
  dec: (delta?: number) => void
@@ -296,6 +295,9 @@ export declare function useAsync<T>(fn: () => Promise<T>, options?: { immediate?
296
295
  error: { readonly value: Error | null }
297
296
  execute: () => Promise<T | null>
298
297
  };
298
+ // =============================================================================
299
+ // Async Composables
300
+ // =============================================================================
299
301
  declare interface UseFetchOptions<T> {
300
302
  immediate?: boolean
301
303
  initialData?: T
@@ -311,4 +313,4 @@ declare interface UseFetchReturn<T> {
311
313
  // =============================================================================
312
314
  // Types
313
315
  // =============================================================================
314
- declare type MaybeRef<T> = T | { value: T }
316
+ declare type MaybeRef<T> = T | { value: T }
@@ -46,34 +46,6 @@ export declare function optimizeTemplate(template: string, options?: Optimizatio
46
46
  * Create optimized build for multiple templates.
47
47
  */
48
48
  export declare function createOptimizedBuild(templates: Map<string, string>, options?: OptimizationOptions): Promise<BuildResult>;
49
- /**
50
- * Build-Time Optimization Module
51
- *
52
- * Provides tree-shaking, dead code elimination, and compile-time optimizations
53
- * for stx templates to reduce bundle size and improve runtime performance.
54
- *
55
- * ## Features
56
- *
57
- * 1. **Tree-Shaking** - Remove unused directive handlers from compiled output
58
- * 2. **Dead Code Elimination** - Remove unreachable template branches
59
- * 3. **Constant Folding** - Pre-evaluate static expressions
60
- * 4. **String Pooling** - Deduplicate repeated string literals
61
- * 5. **HTML Minification** - Remove whitespace and comments from static HTML
62
- *
63
- * ## Usage
64
- *
65
- * ```typescript
66
- * import { optimizeTemplate, createOptimizedBuild } from 'stx/build-optimizer'
67
- *
68
- * // Optimize a single template
69
- * const optimized = optimizeTemplate(template, { treeShake: true })
70
- *
71
- * // Create optimized build for multiple templates
72
- * const build = await createOptimizedBuild(templates, options)
73
- * ```
74
- *
75
- * @module build-optimizer
76
- */
77
49
  /** Optimization options */
78
50
  export declare interface OptimizationOptions {
79
51
  treeShake?: boolean
@@ -120,7 +92,10 @@ declare interface DeadBranch {
120
92
  end: number
121
93
  reason: string
122
94
  }
95
+ // =============================================================================
96
+ // Export Analysis Functions
97
+ // =============================================================================
123
98
  export {
124
99
  analyzeDirectiveUsage as analyzeUsage,
125
100
  findDeadBranches as findDeadCode,
126
- };
101
+ };
@@ -11,6 +11,24 @@ export declare function buildViews(options: ViewBuildOptions): Promise<BuildResu
11
11
  * Watch views directory and rebuild on changes
12
12
  */
13
13
  export declare function watchViews(options: ViewBuildOptions, callback?: (result: BuildResult) => void): { close: () => void };
14
+ /**
15
+ * Render a .stx email template to an email-ready HTML string
16
+ *
17
+ * Optimized for email rendering:
18
+ * - Disables SEO tag injection
19
+ * - Inlines utility classes as style attributes (via Crosswind)
20
+ * - Strips <style> and <script> blocks
21
+ * - Returns clean HTML + plain text suitable for email
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * const { html, text } = await renderEmail('resources/emails/welcome.stx', {
26
+ * userName: 'John',
27
+ * unsubscribeUrl: 'https://example.com/unsubscribe?token=abc',
28
+ * })
29
+ * ```
30
+ */
31
+ export declare function renderEmail(templatePath: string, props?: Record<string, unknown>, options?: Partial<StxOptions>): Promise<{ html: string, text: string }>;
14
32
  export declare interface ViewBuildOptions {
15
33
  viewsDir: string
16
34
  outputDir: string
@@ -34,4 +52,5 @@ export declare interface BuildResult {
34
52
  errors: Array<{ file: string; error: string }>
35
53
  duration: number
36
54
  }
37
- export default buildViews;
55
+ // Default export for convenience
56
+ export default buildViews;
@@ -63,4 +63,4 @@ export declare interface CollectorOptions {
63
63
  detectDuplicates?: boolean
64
64
  topModulesCount?: number
65
65
  }
66
- export type ModuleType = 'js' | 'css' | 'html' | 'image' | 'font' | 'other'
66
+ export type ModuleType = 'js' | 'css' | 'html' | 'image' | 'font' | 'other';
@@ -1,6 +1,6 @@
1
- import { collectBundleStats, formatBytes, parseSize } from './collector';
2
- import { generateReport, analyzeBundle } from './report';
3
- import { generateTreemap, openInBrowser } from './treemap';
1
+ import { collectBundleStats, formatBytes, parseSize, type CollectorOptions } from './collector';
2
+ import { generateReport, analyzeBundle, type ReportOptions } from './report';
3
+ import { generateTreemap, openInBrowser, type TreemapOptions } from './treemap';
4
4
  /**
5
5
  * Analyze a bundle directory and generate a report
6
6
  */
@@ -32,6 +32,36 @@ export declare interface AnalyzeOptions {
32
32
  topModules?: number
33
33
  parseImports?: boolean
34
34
  }
35
+ /**
36
+ * STX Bundle Analyzer
37
+ *
38
+ * Analyze and visualize bundle composition for optimization.
39
+ *
40
+ * @module bundle-analyzer
41
+ *
42
+ * @example
43
+ * ```bash
44
+ * # Generate HTML treemap
45
+ * stx analyze dist/
46
+ *
47
+ * # JSON output for CI
48
+ * stx analyze dist/ --json
49
+ *
50
+ * # Check size threshold
51
+ * stx analyze dist/ --threshold 500KB
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * import { collectBundleStats, generateReport, generateTreemap } from 'stx/bundle-analyzer'
57
+ *
58
+ * const stats = await collectBundleStats('dist/')
59
+ * console.log(generateReport(stats, { format: 'text' }))
60
+ * ```
61
+ */
62
+ // ============================================================================
63
+ // Collector Exports
64
+ // ============================================================================
35
65
  export {
36
66
  collectBundleStats,
37
67
  formatBytes,
@@ -44,6 +74,9 @@ export {
44
74
  type BundleStats,
45
75
  type CollectorOptions,
46
76
  } from './collector';
77
+ // ============================================================================
78
+ // Report Exports
79
+ // ============================================================================
47
80
  export {
48
81
  generateReport,
49
82
  analyzeBundle,
@@ -53,8 +86,11 @@ export {
53
86
  type AnalysisIssue,
54
87
  type Recommendation,
55
88
  } from './report';
89
+ // ============================================================================
90
+ // Treemap Exports
91
+ // ============================================================================
56
92
  export {
57
93
  generateTreemap,
58
94
  openInBrowser,
59
95
  type TreemapOptions,
60
- } from './treemap';
96
+ } from './treemap';
@@ -36,4 +36,4 @@ export declare interface Recommendation {
36
36
  description: string
37
37
  impact: 'high' | 'medium' | 'low'
38
38
  effort: 'low' | 'medium' | 'high'
39
- }
39
+ }
@@ -16,4 +16,4 @@ export declare interface TreemapOptions {
16
16
  title?: string
17
17
  gzip?: boolean
18
18
  colorScheme?: 'default' | 'pastel' | 'monochrome'
19
- }
19
+ }
package/dist/caching.d.ts CHANGED
@@ -27,4 +27,4 @@ declare interface CacheEntry {
27
27
  output: string
28
28
  mtime: number
29
29
  dependencies: Set<string>
30
- }
30
+ }