@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
package/dist/ssr.d.ts CHANGED
@@ -19,13 +19,13 @@ export declare function render(template: string, data?: Record<string, unknown>,
19
19
  export declare function createApp(config?: AppConfig): void;
20
20
  /** Session data store */
21
21
  export declare interface SessionData {
22
-
22
+ [key: string]: unknown
23
23
  }
24
24
  /** Session interface */
25
25
  export declare interface Session {
26
26
  id: string
27
27
  data: SessionData
28
- get(key: string): T | undefined
28
+ get<T = unknown>(key: string): T | undefined
29
29
  set(key: string, value: unknown): void
30
30
  delete(key: string): void
31
31
  clear(): void
@@ -72,7 +72,7 @@ export declare interface CookieOptions {
72
72
  }
73
73
  /** Validation errors */
74
74
  export declare interface ValidationErrors {
75
-
75
+ [field: string]: string[]
76
76
  }
77
77
  /** App configuration */
78
78
  export declare interface AppConfig {
@@ -87,21 +87,13 @@ export declare interface AppConfig {
87
87
  csrfEnabled?: boolean
88
88
  sessionStore?: SessionStore
89
89
  }
90
- /** Route definition */
91
- declare interface Route {
92
- method: string
93
- pattern: string
94
- handler: RouteHandler
95
- middleware: Middleware[]
96
- }
97
90
  /** Route handler */
98
- export type RouteHandler = (ctx: RequestContext) => Response | Promise<Response>
91
+ export type RouteHandler = (ctx: RequestContext) => Response | Promise<Response>;
99
92
  /** Middleware function */
100
- export type Middleware = (ctx: RequestContext, next: () => Promise<Response>) => Response | Promise<Response>
93
+ export type Middleware = (ctx: RequestContext, next: () => Promise<Response>) => Response | Promise<Response>;
101
94
  /** Default in-memory session store. Use a custom SessionStore (Redis, DB) for production. */
102
95
  export declare class MemorySessionStore implements SessionStore {
103
- private store: any;
104
96
  get(sessionId: string): Promise<SessionData | null>;
105
97
  set(sessionId: string, data: SessionData, ttlSeconds: number): Promise<void>;
106
98
  delete(sessionId: string): Promise<void>;
107
- }
99
+ }
@@ -146,7 +146,7 @@ export declare function initDevTools(): void;
146
146
  * </script>
147
147
  * ```
148
148
  */
149
- export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>>(id: string, options: DefineStoreOptions<S, G, A>): DefinedStoreWithGettersAndActions<S, G, A>;
149
+ export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>,>(id: string, options: DefineStoreOptions<S, G, A>): DefinedStoreWithGettersAndActions<S, G, A>;
150
150
  /**
151
151
  * Get a defined store by name.
152
152
  * Used internally by the @stores import transformation.
@@ -262,56 +262,16 @@ export declare interface DefinedStore<S, G extends Record<string, (state: S) =>
262
262
  _store: Store<S>
263
263
  $id: string
264
264
  }
265
- /**
266
- * State Management Module
267
- *
268
- * Provides reactive state management for stx templates with support for
269
- * both simple stores and complex global state management.
270
- *
271
- * ## Features
272
- *
273
- * 1. **Reactive Stores** - Simple observable stores with auto-subscriptions
274
- * 2. **Computed Values** - Derived state that auto-updates
275
- * 3. **Actions** - Structured state mutations
276
- * 4. **Persistence** - LocalStorage/SessionStorage integration
277
- * 5. **DevTools** - State inspection and time-travel debugging
278
- * 6. **Server State** - Sync state between server and client
279
- *
280
- * ## Usage
281
- *
282
- * ```typescript
283
- * import { createStore, computed, action } from 'stx/state-management'
284
- *
285
- * const counter = createStore({ count: 0 })
286
- *
287
- * // Subscribe to changes
288
- * counter.subscribe(state => console.log(state.count))
289
- *
290
- * // Update state
291
- * counter.set({ count: counter.get().count + 1 })
292
- * ```
293
- *
294
- * In templates:
295
- * ```html
296
- * <script>
297
- * import { useStore } from 'stx/state-management'
298
- * const { count } = useStore('counter')
299
- * </script>
300
- * <p>Count: {{ count }}</p>
301
- * ```
302
- *
303
- * @module state-management
304
- */
305
265
  /** Subscription callback */
306
- export type Subscriber<T> = (value: T, previousValue: T | undefined) => void
266
+ export type Subscriber<T> = (value: T, previousValue: T | undefined) => void;
307
267
  /** Unsubscribe function */
308
- export type Unsubscribe = () => void
268
+ export type Unsubscribe = () => void;
309
269
  /** Store middleware */
310
270
  export type StoreMiddleware<T> = (
311
271
  set: (value: T) => void,
312
272
  get: () => T,
313
273
  store: Store<T>
314
- ) => (nextSet: (value: T) => void) => (value: T) => void
274
+ ) => (nextSet: (value: T) => void) => (value: T) => void;
315
275
  // Type helper for getters
316
276
  declare type StoreGetters<S, G extends Record<string, (state: S) => any>> = {
317
277
  [K in keyof G]: ReturnType<G[K]>
@@ -321,4 +281,4 @@ declare type StoreActions<A extends Record<string, (...args: any[]) => any>> = {
321
281
  [K in keyof A]: A[K]
322
282
  }
323
283
  // Full store type combining state, getters, and actions
324
- export type DefinedStoreWithGettersAndActions<S, G extends Record<string, (state: S) => any>, A extends Record<string, (...args: any[]) => any>> = DefinedStore<S, G, A> & StoreGetters<S, G> & StoreActions<A>
284
+ export type DefinedStoreWithGettersAndActions<S, G extends Record<string, (state: S) => any>, A extends Record<string, (...args: any[]) => any>,> = DefinedStore<S, G, A> & StoreGetters<S, G> & StoreActions<A>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Define a reactive store with state, getters, and actions.
3
3
  */
4
- export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>>(id: string, options: StoreOptions<S, G, A>): Store<S> & { [K in keyof G]: ReturnType<G[K]> } & { [K in keyof A]: A[K] };
4
+ export declare function defineStore<S extends object, G extends Record<string, (state: S) => any> = Record<string, never>, A extends Record<string, (...args: any[]) => any> = Record<string, never>,>(id: string, options: StoreOptions<S, G, A>): Store<S> & { [K in keyof G]: ReturnType<G[K]> } & { [K in keyof A]: A[K] };
5
5
  /**
6
6
  * Register multiple stores at once.
7
7
  */
@@ -13,7 +13,7 @@ export declare function getStore<T = any>(name: string): T | undefined;
13
13
  /**
14
14
  * Wait for a store to be available.
15
15
  */
16
- export declare function waitForStore<T = any>(name: string, timeout?: any): Promise<T>;
16
+ export declare function waitForStore<T = any>(name: string, timeout?: number): Promise<T>;
17
17
  /**
18
18
  * STX Stores - Client Runtime
19
19
  *
@@ -67,4 +67,4 @@ export declare interface Store<S> {
67
67
  $patch: (partial: Partial<S> | ((state: S) => void)) => void
68
68
  $id: string
69
69
  }
70
- export type Unsubscribe = () => void
70
+ export type Unsubscribe = () => void;
@@ -120,4 +120,4 @@ export declare interface StoryAddon {
120
120
  export type StoryDecorator = (
121
121
  story: ServerStoryFile,
122
122
  ctx: AddonContext,
123
- ) => ServerStoryFile
123
+ ) => ServerStoryFile;
@@ -58,30 +58,23 @@ export type AnalyticsEventType = | 'view'
58
58
  | 'search'
59
59
  | 'bookmark'
60
60
  | 'copy_code'
61
- | 'test_run'
61
+ | 'test_run';
62
62
  /**
63
63
  * Analytics tracker
64
64
  */
65
65
  export declare class AnalyticsTracker {
66
- private storage: AnalyticsStorage;
67
- private storagePath: string;
68
- private currentSession: AnalyticsSession | null;
69
- private dirty: any;
70
- private viewStartTimes: any;
71
66
  constructor(rootDir: string);
72
- private loadStorage(): AnalyticsStorage;
73
67
  save(): Promise<void>;
74
68
  startSession(): void;
75
69
  endSession(): void;
76
70
  track(event: Omit<AnalyticsEvent, 'timestamp'>): void;
77
71
  trackView(componentId: string, variantId?: string): void;
78
- private endViewTiming(componentId: string): void;
79
72
  trackPropChange(componentId: string, propName: string, value: any): void;
80
73
  trackVariantSwitch(componentId: string, variantId: string): void;
81
74
  trackSearch(query: string, resultCount: number): void;
82
75
  getComponentAnalytics(componentId: string, componentName: string): ComponentAnalytics;
83
- getMostViewedComponents(limit?: any): Array<{ componentId: string, viewCount: number }>;
84
- getMostChangedProps(limit?: any): Array<{ propName: string, changeCount: number }>;
76
+ getMostViewedComponents(limit?: number): Array<{ componentId: string, viewCount: number }>;
77
+ getMostChangedProps(limit?: number): Array<{ propName: string, changeCount: number }>;
85
78
  getSearchAnalytics(): {
86
79
  totalSearches: number
87
80
  topQueries: Array<{ query: string, count: number }>
@@ -89,4 +82,4 @@ export declare class AnalyticsTracker {
89
82
  };
90
83
  clear(): void;
91
84
  exportAnalytics(): string;
92
- }
85
+ }
@@ -35,4 +35,4 @@ export declare interface GeneratedStory {
35
35
  storyPath: string
36
36
  content: string
37
37
  status: 'created' | 'skipped' | 'updated'
38
- }
38
+ }
@@ -34,11 +34,7 @@ export declare interface BookmarksStorage {
34
34
  * Bookmarks manager
35
35
  */
36
36
  export declare class BookmarksManager {
37
- private storage: BookmarksStorage;
38
- private storagePath: string;
39
- private dirty: any;
40
37
  constructor(rootDir: string);
41
- private loadStorage(): BookmarksStorage;
42
38
  save(): Promise<void>;
43
39
  addBookmark(storyId: string, variantId: string, props: Record<string, any>, options?: { name?: string, notes?: string, color?: string }): Bookmark;
44
40
  getAllBookmarks(): Bookmark[];
@@ -49,5 +45,5 @@ export declare class BookmarksManager {
49
45
  deleteBookmark(id: string): boolean;
50
46
  toggleBookmark(storyId: string, variantId: string, props: Record<string, any>): { added: boolean, bookmark?: Bookmark };
51
47
  exportBookmarks(): string;
52
- importBookmarks(json: string, merge?: any): number;
53
- }
48
+ importBookmarks(json: string, merge?: boolean): number;
49
+ }
@@ -41,4 +41,4 @@ export declare interface BunTestOptions {
41
41
  update?: boolean
42
42
  threshold?: number
43
43
  timeout?: number
44
- }
44
+ }
@@ -7,28 +7,3 @@ export declare function registerStoryCommands(cli: any): void;
7
7
  * Run story CLI directly (for standalone usage)
8
8
  */
9
9
  export declare function runStoryCLI(args?: string[]): Promise<void>;
10
- /**
11
- * CLI command definitions for integration with @stacksjs/clapp
12
- */
13
- export declare const storyCommands: {
14
- /**
15
- * Main story command (defaults to dev)
16
- */
17
- 'story': { description: 'Component showcase and testing'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 6006)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' }; host: { type: 'string'; description: 'Host to bind to' } }; action: (options: { port?: number, open?: boolean, host?: string }) => any };
18
- /**
19
- * Story dev subcommand
20
- */
21
- 'story:dev': { description: 'Start story development server'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 6006)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' }; host: { type: 'string'; description: 'Host to bind to' } }; action: (options: { port?: number, open?: boolean, host?: string }) => any };
22
- /**
23
- * Story build subcommand
24
- */
25
- 'story:build': { description: 'Build static story site'; options: { outDir: { alias: 'o'; type: 'string'; description: 'Output directory' } }; action: (options: { outDir?: string }) => any };
26
- /**
27
- * Story preview subcommand
28
- */
29
- 'story:preview': { description: 'Preview built story site'; options: { port: { alias: 'p'; type: 'number'; description: 'Server port (default: 4173)' }; open: { alias: 'o'; type: 'boolean'; description: 'Open browser automatically' } }; action: (options: { port?: number, open?: boolean }) => any };
30
- /**
31
- * Story test subcommand
32
- */
33
- 'story:test': { description: 'Run visual regression tests'; options: { update: { alias: 'u'; type: 'boolean'; description: 'Update snapshots' }; filter: { alias: 'f'; type: 'string'; description: 'Filter components by name' } }; action: (options: { update?: boolean, filter?: string }) => any }
34
- };
@@ -30,4 +30,4 @@ export declare function extractCssClasses(content: string): string[];
30
30
  /**
31
31
  * Extract directive usage from template
32
32
  */
33
- export declare function extractDirectives(content: string): DirectiveUsage[];
33
+ export declare function extractDirectives(content: string): DirectiveUsage[];
@@ -1,3 +1,7 @@
1
+ /**
2
+ * STX Story - Collection module
3
+ * Discovers and analyzes story files
4
+ */
1
5
  export {
2
6
  analyzeComponent,
3
7
  analyzeComponentFile,
@@ -24,4 +28,4 @@ export {
24
28
  createTreePath,
25
29
  findStoryInTree,
26
30
  flattenTree,
27
- } from './tree';
31
+ } from './tree';
@@ -14,4 +14,4 @@ export declare function extractScriptContent(content: string): string;
14
14
  /**
15
15
  * Extract template content from a story file (everything outside script tags)
16
16
  */
17
- export declare function extractTemplateContent(content: string): string;
17
+ export declare function extractTemplateContent(content: string): string;
@@ -10,4 +10,4 @@ export declare function isNonComponentFile(relativePath: string): boolean;
10
10
  /**
11
11
  * Watch for story file changes
12
12
  */
13
- export declare function watchStoryFiles(ctx: StoryContext, onChange: (event: 'add' | 'change' | 'unlink', file: ServerStoryFile) => void): () => void;
13
+ export declare function watchStoryFiles(ctx: StoryContext, onChange: (event: 'add' | 'change' | 'unlink', file: ServerStoryFile) => void): () => void;
@@ -1,4 +1,4 @@
1
- import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf, } from '../types';
1
+ import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf } from '../types';
2
2
  /**
3
3
  * Create tree path from a story file
4
4
  */
@@ -14,4 +14,4 @@ export declare function flattenTree(tree: ServerTree): number[];
14
14
  /**
15
15
  * Find a story in the tree by index
16
16
  */
17
- export declare function findStoryInTree(tree: ServerTree, index: number): { path: string[], node: ServerTreeLeaf } | null;
17
+ export declare function findStoryInTree(tree: ServerTree, index: number): { path: string[], node: ServerTreeLeaf } | null;
@@ -11,4 +11,4 @@ export declare const build: typeof buildCommand;
11
11
  */
12
12
  export declare interface BuildOptions {
13
13
  outDir?: string
14
- }
14
+ }
@@ -13,4 +13,4 @@ export declare interface DevOptions {
13
13
  port?: number
14
14
  open?: boolean
15
15
  host?: string | boolean
16
- }
16
+ }
@@ -1,6 +1,9 @@
1
1
  export type { BuildOptions } from './build';
2
2
  export type { DevOptions } from './dev';
3
3
  export type { PreviewOptions } from './preview';
4
+ /**
5
+ * STX Story - CLI commands
6
+ */
4
7
  export { build, buildCommand } from './build';
5
8
  export { dev, devCommand } from './dev';
6
- export { preview, previewCommand } from './preview';
9
+ export { preview, previewCommand } from './preview';
@@ -12,4 +12,4 @@ export declare const preview: typeof previewCommand;
12
12
  export declare interface PreviewOptions {
13
13
  port?: number
14
14
  open?: boolean
15
- }
15
+ }
@@ -23,4 +23,4 @@ export declare interface CompiledOutputOptions {
23
23
  includeScripts?: boolean
24
24
  minify?: boolean
25
25
  format?: boolean
26
- }
26
+ }
@@ -44,4 +44,4 @@ export declare interface DependencyGraph {
44
44
  nodes: Map<string, DependencyNode>
45
45
  roots: string[]
46
46
  leaves: string[]
47
- }
47
+ }
@@ -23,4 +23,4 @@ export declare interface ConfigWatcherOptions {
23
23
  */
24
24
  export declare interface ConfigWatcher {
25
25
  stop: () => void
26
- }
26
+ }
@@ -1,4 +1,4 @@
1
- import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig, } from './types';
1
+ import type { BackgroundPreset, ResolvedStoryConfig, ResponsivePreset, StoryConfig, StoryTreeConfig } from './types';
2
2
  /**
3
3
  * Resolve story configuration with defaults
4
4
  */
@@ -23,4 +23,4 @@ export declare const defaultTreeConfig: Required<StoryTreeConfig>;
23
23
  /**
24
24
  * Default story configuration
25
25
  */
26
- export declare const defaultStoryConfig: StoryConfig;
26
+ export declare const defaultStoryConfig: StoryConfig;
@@ -18,4 +18,4 @@ export declare interface CreateContextOptions {
18
18
  mode: 'dev' | 'build'
19
19
  root?: string
20
20
  config?: StoryConfig
21
- }
21
+ }
@@ -51,4 +51,4 @@ export declare function getControlStyles(): string;
51
51
  * Button group control
52
52
  */
53
53
  export declare function renderButtonGroupControl(title: string, value: any, onChange: string, config: ControlConfig): string;
54
- declare type ControlOption = string | { value: any, label: string }
54
+ declare type ControlOption = string | { value: any, label: string }
@@ -26,4 +26,4 @@ export declare interface CrosswindOptions {
26
26
  cssPath?: string
27
27
  includeReset?: boolean
28
28
  includeBase?: boolean
29
- }
29
+ }
@@ -31,4 +31,4 @@ export declare interface DesktopPreviewInstance {
31
31
  close: () => void
32
32
  reload: () => void
33
33
  update: (html: string) => void
34
- }
34
+ }
@@ -27,4 +27,4 @@ export declare interface DocsOptions {
27
27
  includeStories?: boolean
28
28
  includeSource?: boolean
29
29
  template?: string
30
- }
30
+ }
@@ -44,4 +44,4 @@ export type StoryErrorType = | 'parse_error'
44
44
  | 'file_not_found'
45
45
  | 'circular_dependency'
46
46
  | 'prop_type_error'
47
- | 'unknown'
47
+ | 'unknown';
@@ -162,8 +162,8 @@ export type FigmaNodeType = | 'DOCUMENT'
162
162
  | 'SLICE'
163
163
  | 'COMPONENT'
164
164
  | 'COMPONENT_SET'
165
- | 'INSTANCE'
165
+ | 'INSTANCE';
166
166
  /**
167
167
  * Union of all Figma node types
168
168
  */
169
- export type FigmaNode = FigmaFrameNode | FigmaTextNode | FigmaRectangleNode | FigmaNodeBase
169
+ export type FigmaNode = FigmaFrameNode | FigmaTextNode | FigmaRectangleNode | FigmaNodeBase;
@@ -18,4 +18,4 @@ export declare function generateStorySource(componentName: string, state: Record
18
18
  /**
19
19
  * Generate a complete story file content
20
20
  */
21
- export declare function generateStoryFileContent(component: AnalyzedComponent): string;
21
+ export declare function generateStoryFileContent(component: AnalyzedComponent): string;
@@ -61,4 +61,4 @@ export type HmrMessageType = | 'connected'
61
61
  | 'story-remove'
62
62
  | 'config-change'
63
63
  | 'full-reload'
64
- | 'error'
64
+ | 'error';
@@ -32,4 +32,4 @@ export declare interface HotSwapOptions {
32
32
  preserveScroll?: boolean
33
33
  onBeforeSwap?: (state: HotSwapState) => void
34
34
  onAfterSwap?: (state: HotSwapState) => void
35
- }
35
+ }
@@ -1,15 +1,35 @@
1
1
  export type { CreateContextOptions } from './context';
2
2
  export type { ServerOptions, StoryServer } from './server';
3
+ /**
4
+ * STX Story - Component showcase and testing
5
+ *
6
+ * Native component explorer for stx, providing:
7
+ * - Automatic component discovery
8
+ * - Interactive prop editing
9
+ * - Visual regression testing
10
+ * - Documentation generation
11
+ */
12
+ // Addons
3
13
  export * from './addons';
14
+ // Analytics
4
15
  export * from './analytics';
16
+ // Auto-generate Stories
5
17
  export * from './auto-stories';
18
+ // Bookmarks
6
19
  export * from './bookmarks';
20
+ // Bun Test Integration
7
21
  export * from './bun-test';
22
+ // CLI
8
23
  export * from './cli';
24
+ // Collection (scanner, analyzer, tree)
9
25
  export * from './collect';
26
+ // Commands
10
27
  export * from './commands';
28
+ // Compiled Output
11
29
  export * from './compiled-output';
30
+ // Composition (dependency graph)
12
31
  export * from './composition';
32
+ // Configuration
13
33
  export {
14
34
  defaultBackgroundPresets,
15
35
  defaultResponsivePresets,
@@ -17,35 +37,63 @@ export {
17
37
  getDefaultStoryConfig,
18
38
  resolveStoryConfig,
19
39
  } from './config';
40
+ // Config Watcher
20
41
  export * from './config-watcher';
42
+ // Context
21
43
  export {
22
44
  createContext,
23
45
  updateContextStoryFiles,
24
46
  updateContextTree,
25
47
  } from './context';
48
+ // Controls
26
49
  export * from './controls';
50
+ // Desktop Preview
27
51
  export * from './desktop-preview';
52
+ // Docs Generator
28
53
  export * from './docs-generator';
54
+ // Errors
29
55
  export * from './errors';
56
+ // Figma Export
30
57
  export * from './figma-export';
58
+ // Generator
31
59
  export * from './generator';
60
+ // Crosswind CSS
32
61
  export * from './crosswind';
62
+ // HMR
33
63
  export * from './hmr';
64
+ // Hot Swap
34
65
  export * from './hot-swap';
66
+ // Interactions
35
67
  export * from './interactions';
68
+ // Keyboard Shortcuts
36
69
  export * from './keyboard-shortcuts';
70
+ // Output (terminal styling)
37
71
  export * from './output';
72
+ // Performance Profiling
38
73
  export * from './performance';
74
+ // Presets
39
75
  export * from './presets';
76
+ // Props Validation
40
77
  export * from './props-validation';
78
+ // Renderer
41
79
  export * from './renderer';
80
+ // Search
42
81
  export * from './search';
82
+ // Search Index
43
83
  export * from './search-index';
84
+ // Server
44
85
  export { createStoryServer } from './server';
86
+ // Setup
45
87
  export * from './setup';
88
+ // Snapshots
46
89
  export * from './snapshots';
90
+ // Testing
47
91
  export * from './testing';
92
+ // Theme
48
93
  export * from './theme';
94
+ // Types
49
95
  export * from './types';
96
+ // UI Components
50
97
  export * from './ui';
51
- export * from './visual-testing';
98
+ // Visual Testing
99
+ export * from './visual-testing';
@@ -49,4 +49,4 @@ export declare interface InteractionTestResult {
49
49
  error?: string
50
50
  duration: number
51
51
  failedStep?: number
52
- }
52
+ }
@@ -31,4 +31,4 @@ export declare interface KeyboardShortcut {
31
31
  description: string
32
32
  category: string
33
33
  action: string
34
- }
34
+ }
@@ -82,4 +82,4 @@ export declare const gray: (text: string) => string;
82
82
  export declare const bold: (text: string) => string;
83
83
  export declare const dim: (text: string) => string;
84
84
  export declare const italic: (text: string) => string;
85
- export declare const underline: (text: string) => string;
85
+ export declare const underline: (text: string) => string;
@@ -46,18 +46,14 @@ export declare interface RenderRecord {
46
46
  * Performance profiler
47
47
  */
48
48
  export declare class PerformanceProfiler {
49
- private metrics: any;
50
- private maxHistorySize: any;
51
- private enabled: any;
52
49
  setEnabled(enabled: boolean): void;
53
50
  recordRender(componentId: string, componentName: string, duration: number, props?: Record<string, any>): void;
54
51
  getMetrics(componentId: string): ComponentMetrics | undefined;
55
52
  getAllMetrics(): ComponentMetrics[];
56
- getSlowestComponents(limit?: any): ComponentMetrics[];
57
- getMostRenderedComponents(limit?: any): ComponentMetrics[];
53
+ getSlowestComponents(limit?: number): ComponentMetrics[];
54
+ getMostRenderedComponents(limit?: number): ComponentMetrics[];
58
55
  clear(): void;
59
56
  clearComponent(componentId: string): void;
60
- private getMemoryUsage(): number | undefined;
61
57
  exportMetrics(): string;
62
58
  createTimer(componentId: string, componentName: string): RenderTimer;
63
59
  }
@@ -65,12 +61,7 @@ export declare class PerformanceProfiler {
65
61
  * Render timer helper
66
62
  */
67
63
  export declare class RenderTimer {
68
- private startTime: number;
69
- private props?: Record<string, any>;
70
- private profiler: PerformanceProfiler;
71
- private componentId: string;
72
- private componentName: string;
73
64
  constructor(profiler: PerformanceProfiler, componentId: string, componentName: string);
74
65
  setProps(props: Record<string, any>): this;
75
66
  end(): number;
76
- }
67
+ }
@@ -36,12 +36,7 @@ export declare interface PresetsStorage {
36
36
  * Presets manager
37
37
  */
38
38
  export declare class PresetsManager {
39
- private storage: PresetsStorage;
40
- private storagePath: string;
41
- private dirty: any;
42
39
  constructor(rootDir: string);
43
- private loadStorage(): PresetsStorage;
44
- private migrateStorage(data: any): PresetsStorage;
45
40
  save(): Promise<void>;
46
41
  createPreset(name: string, props: Record<string, any>, options?: {
47
42
  description?: string
@@ -56,7 +51,7 @@ export declare class PresetsManager {
56
51
  updatePreset(id: string, updates: Partial<Omit<PropPreset, 'id' | 'created'>>): PropPreset | undefined;
57
52
  deletePreset(id: string): boolean;
58
53
  searchPresets(query: string): PropPreset[];
59
- getMostUsedPresets(limit?: any): PropPreset[];
54
+ getMostUsedPresets(limit?: number): PropPreset[];
60
55
  exportPresets(ids?: string[]): string;
61
- importPresets(json: string, overwrite?: any): number;
62
- }
56
+ importPresets(json: string, overwrite?: boolean): number;
57
+ }