@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/init.d.ts CHANGED
@@ -36,4 +36,4 @@ declare interface InitOptions {
36
36
  /**
37
37
  * Built-in template presets
38
38
  */
39
- declare type TemplatePreset = 'basic' | 'component' | 'layout' | 'blog' | 'api' | 'app'
39
+ declare type TemplatePreset = 'basic' | 'component' | 'layout' | 'blog' | 'api' | 'app';
@@ -11,4 +11,4 @@ export declare interface InteractiveOptions {
11
11
  verbose?: boolean
12
12
  historyFile?: string
13
13
  maxHistory?: number
14
- }
14
+ }
@@ -19,4 +19,4 @@ export declare interface FrontmatterResult {
19
19
  export declare interface MarkdownOptions {
20
20
  gfm?: boolean
21
21
  breaks?: boolean
22
- }
22
+ }
package/dist/js-ts.d.ts CHANGED
@@ -7,4 +7,4 @@ export declare function processJsDirectives(template: string, context: Record<st
7
7
  * Process TypeScript directives in templates
8
8
  * Executes TypeScript code on the server and removes the code blocks from output
9
9
  */
10
- export declare function processTsDirectives(template: string, context: Record<string, any>, filePath?: string): Promise<string>;
10
+ export declare function processTsDirectives(template: string, context: Record<string, any>, filePath?: string): Promise<string>;
@@ -79,25 +79,6 @@ export declare const jsxs: unknown;
79
79
  * Development version of jsx with extra validation.
80
80
  */
81
81
  export declare const jsxDEV: unknown;
82
- /**
83
- * STX JSX Runtime
84
- *
85
- * Self-made JSX runtime for stx — no React, no Preact, no external dependencies.
86
- * This module provides the jsx/jsxs/Fragment functions that Bun's JSX transpiler calls,
87
- * plus renderToString() for SSR and renderToDOM() for client-side rendering.
88
- *
89
- * Usage in tsconfig.json:
90
- * ```json
91
- * {
92
- * "compilerOptions": {
93
- * "jsx": "react-jsx",
94
- * "jsxImportSource": "@stacksjs/stx"
95
- * }
96
- * }
97
- * ```
98
- *
99
- * @module jsx-runtime
100
- */
101
82
  /** Virtual DOM node representation */
102
83
  export declare interface VNode {
103
84
  type: string | ComponentFunction | typeof Fragment
@@ -107,4 +88,4 @@ export declare interface VNode {
107
88
  ref?: string | ((el: any) => void) | null
108
89
  }
109
90
  /** Function component type */
110
- export type ComponentFunction = (props: Record<string, any>) => VNode | string | null
91
+ export type ComponentFunction = (props: Record<string, any>) => VNode | string | null;
@@ -84,4 +84,4 @@ export declare interface KeepAliveCache {
84
84
  max: number
85
85
  include: string[] | null
86
86
  exclude: string[] | null
87
- }
87
+ }
@@ -39,47 +39,18 @@ export declare interface DirectiveProcessor {
39
39
  name?: string
40
40
  hasEndTag?: boolean
41
41
  }
42
- /**
43
- * Lazy Loading for Directive Processors
44
- *
45
- * Provides lazy loading capabilities for directive processors to reduce
46
- * initial load time and memory usage.
47
- *
48
- * ## Features
49
- *
50
- * - On-demand loading of directive processors
51
- * - Module caching to prevent re-imports
52
- * - Support for both sync and async loading
53
- * - Automatic dependency resolution
54
- *
55
- * ## Usage
56
- *
57
- * ```typescript
58
- * const loader = new LazyLoader()
59
- *
60
- * // Register lazy directive
61
- * loader.register('markdown', () => import('./markdown'))
62
- *
63
- * // Load when needed
64
- * const markdown = await loader.load('markdown')
65
- * ```
66
- *
67
- * @module lazy-loader
68
- */
69
42
  /**
70
43
  * Module loader function
71
44
  */
72
- export type ModuleLoader<T = unknown> = () => Promise<T> | T
45
+ export type ModuleLoader<T = unknown> = () => Promise<T> | T;
73
46
  /**
74
47
  * Module status
75
48
  */
76
- export type ModuleStatus = 'pending' | 'loading' | 'loaded' | 'error'
49
+ export type ModuleStatus = 'pending' | 'loading' | 'loaded' | 'error';
77
50
  /**
78
51
  * Lazy loader for directive processors
79
52
  */
80
53
  export declare class LazyLoader<T = unknown> {
81
- private modules: Map<string, ModuleInfo<T>>;
82
- private options: LazyLoaderOptions;
83
54
  constructor(options?: LazyLoaderOptions);
84
55
  register(name: string, loader: ModuleLoader<T>, dependencies?: string[]): void;
85
56
  registerAll(modules: Record<string, ModuleLoader<T>>): void;
@@ -105,18 +76,15 @@ export declare class LazyLoader<T = unknown> {
105
76
  loadTime?: number
106
77
  }>
107
78
  };
108
- private loadWithTimeout(name: string, loader: ModuleLoader<T>): Promise<T>;
109
79
  }
110
80
  /**
111
81
  * Lazy loader specifically for directive processors
112
82
  */
113
83
  export declare class DirectiveLoaderRegistry {
114
- private loader: LazyLoader<DirectiveProcessor | { default: DirectiveProcessor }>;
115
- private directiveMap: Map<string, string>;
116
84
  constructor(options?: LazyLoaderOptions);
117
85
  registerDirective(directiveName: string, moduleName: string, loader: ModuleLoader<DirectiveProcessor | { default: DirectiveProcessor }>): void;
118
86
  getProcessor(directiveName: string): Promise<DirectiveProcessor | null>;
119
87
  hasDirective(directiveName: string): boolean;
120
88
  getDirectiveNames(): string[];
121
89
  preloadDirectives(directiveNames: string[]): Promise<void>;
122
- }
90
+ }
@@ -33,8 +33,9 @@ export declare interface LoadingIndicatorInstance {
33
33
  clear: () => void
34
34
  state: LoadingIndicatorState
35
35
  }
36
+ // Export for use in STX templates
36
37
  export default {
37
38
  useLoadingIndicator,
38
39
  initLoadingIndicator,
39
40
  generateLoadingIndicatorHtml,
40
- };
41
+ };
package/dist/loops.d.ts CHANGED
@@ -22,4 +22,4 @@ import type { StxOptions } from './types';
22
22
  * @param filePath - Path to template file for error messages
23
23
  * @param options - Optional stx configuration
24
24
  */
25
- export declare function processLoops(template: string, context: Record<string, any>, filePath: string, options?: StxOptions): string;
25
+ export declare function processLoops(template: string, context: Record<string, any>, filePath: string, options?: StxOptions): string;
@@ -7,4 +7,4 @@ export declare function processMarkdownDirectives(template: string, context: Rec
7
7
  * Custom directive handler for markdown
8
8
  * Can be registered as a custom directive
9
9
  */
10
- export declare function markdownDirectiveHandler(content: string, params: string[], _context: Record<string, any>, _filePath: string): Promise<string>;
10
+ export declare function markdownDirectiveHandler(content: string, params: string[], _context: Record<string, any>, _filePath: string): Promise<string>;
@@ -62,4 +62,4 @@ export declare interface BlurUpOptions {
62
62
  removePlaceholder?: boolean
63
63
  loadedClass?: string
64
64
  loadingClass?: string
65
- }
65
+ }
@@ -9,6 +9,16 @@ export declare function generateMediaRuntime(): { script: string; css: string };
9
9
  * Generate minified media runtime for production
10
10
  */
11
11
  export declare function generateMinifiedMediaRuntime(): { script: string; css: string };
12
+ /**
13
+ * STX Media - Client-Side Runtime
14
+ *
15
+ * Client-side utilities for lazy loading, blur-up effects, and file uploads.
16
+ *
17
+ * @module media/client
18
+ */
19
+ // =============================================================================
20
+ // Lazy Loading
21
+ // =============================================================================
12
22
  export {
13
23
  // Types
14
24
  type LazyLoadOptions,
@@ -33,6 +43,9 @@ export {
33
43
  // Runtime generation
34
44
  generateLazyLoadRuntime,
35
45
  } from './lazy-load';
46
+ // =============================================================================
47
+ // Blur-Up Effects
48
+ // =============================================================================
36
49
  export {
37
50
  // Types
38
51
  type BlurUpOptions,
@@ -54,6 +67,9 @@ export {
54
67
  generateBlurUpRuntime,
55
68
  generateBlurUpCSS,
56
69
  } from './blur-up';
70
+ // =============================================================================
71
+ // Upload Handler
72
+ // =============================================================================
57
73
  export {
58
74
  // Types
59
75
  type UploadHandlerOptions,
@@ -74,4 +90,4 @@ export {
74
90
 
75
91
  // Runtime generation
76
92
  generateUploadRuntime,
77
- } from './upload-handler';
93
+ } from './upload-handler';
@@ -70,4 +70,4 @@ export declare interface LazyLoadOptions {
70
70
  onLoad?: (element: HTMLElement) => void
71
71
  onLoaded?: (element: HTMLElement) => void
72
72
  onError?: (element: HTMLElement, error: Error) => void
73
- }
73
+ }
@@ -76,4 +76,4 @@ export declare interface FileValidationResult {
76
76
  valid: boolean
77
77
  error?: string
78
78
  code?: 'INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL'
79
- }
79
+ }
@@ -1,6 +1,4 @@
1
- import { } from './placeholder';
2
- import { } from './srcset';
3
- import type { ImageRenderContext, ImageRenderResult, ImgProps, EnhancedImgProps, TsImagesConfig, ProcessedImageResult, ResponsiveVariantSet, } from '../types';
1
+ import type { ImageRenderContext, ImageRenderResult, ImgProps, EnhancedImgProps, TsImagesConfig, ProcessedImageResult, ResponsiveVariantSet } from '../types';
4
2
  /**
5
3
  * Render an optimized <Img> component
6
4
  *
@@ -43,4 +41,4 @@ export declare interface ExtendedImageRenderContext extends ImageRenderContext {
43
41
  tsImagesConfig?: TsImagesConfig
44
42
  processedResult?: ProcessedImageResult
45
43
  responsiveVariants?: ResponsiveVariantSet
46
- }
44
+ }
@@ -6,4 +6,4 @@ export declare function createImgDirective(): CustomDirective;
6
6
  /**
7
7
  * The @img directive instance
8
8
  */
9
- export declare const imgDirective: unknown;
9
+ export declare const imgDirective: unknown;
@@ -209,4 +209,4 @@ export declare const PRESETS: {
209
209
  blur: 200;
210
210
  q: 20
211
211
  }
212
- };
212
+ };
@@ -1,4 +1,16 @@
1
+ // Export types separately
1
2
  export type { ExtendedImageRenderContext } from './component';
3
+ /**
4
+ * STX Media - Image Module
5
+ *
6
+ * Complete image optimization with responsive srcset, lazy loading,
7
+ * blur-up placeholders, and imgix-style URL transformations.
8
+ *
9
+ * @module media/image
10
+ */
11
+ // =============================================================================
12
+ // Component Exports
13
+ // =============================================================================
2
14
  export {
3
15
  // Main render function
4
16
  renderImgComponent,
@@ -6,12 +18,18 @@ export {
6
18
  parseImgComponent,
7
19
  processImgComponents,
8
20
  } from './component';
21
+ // =============================================================================
22
+ // Directive Exports
23
+ // =============================================================================
9
24
  export {
10
25
  // Directive factory
11
26
  createImgDirective,
12
27
  // Directive instance
13
28
  imgDirective,
14
29
  } from './directive';
30
+ // =============================================================================
31
+ // Srcset Exports
32
+ // =============================================================================
15
33
  export {
16
34
  // Constants
17
35
  DEFAULT_WIDTHS,
@@ -50,6 +68,9 @@ export {
50
68
  getFormatExtension,
51
69
  detectFormat,
52
70
  } from './srcset';
71
+ // =============================================================================
72
+ // Placeholder Exports
73
+ // =============================================================================
53
74
  export {
54
75
  // Constants
55
76
  DEFAULT_PLACEHOLDER_OPTIONS,
@@ -74,6 +95,9 @@ export {
74
95
  clearPlaceholderCache,
75
96
  getPlaceholderCacheStats,
76
97
  } from './placeholder';
98
+ // =============================================================================
99
+ // Editing API Exports
100
+ // =============================================================================
77
101
  export {
78
102
  // URL building
79
103
  buildImageUrl as buildUrl,
@@ -115,4 +139,4 @@ export {
115
139
  // Validation
116
140
  validateParams,
117
141
  sanitizeParams,
118
- } from './editing';
142
+ } from './editing';
@@ -75,4 +75,4 @@ export declare const DEFAULT_PLACEHOLDER_OPTIONS: PlaceholderOptions;
75
75
  /**
76
76
  * CSS for blur-up transition
77
77
  */
78
- export declare const BLUR_UP_CSS: unknown;
78
+ export declare const BLUR_UP_CSS: unknown;
@@ -1,5 +1,5 @@
1
- import { } from '../../shared/cache';
2
- import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, } from '../../types';
1
+ import { type CacheConfig } from '../../shared/cache';
2
+ import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig } from '../../types';
3
3
  /**
4
4
  * Get cached image processing result
5
5
  */
@@ -23,10 +23,9 @@ export declare interface ImageCacheConfig extends CacheConfig {
23
23
  * Image processor cache class
24
24
  */
25
25
  export declare class ImageProcessorCache {
26
- private config: ImageCacheConfig;
27
26
  constructor(config?: Partial<ImageCacheConfig>);
28
27
  get(src: string, options: Partial<EnhancedImgProps>): Promise<ProcessedImageResult | null>;
29
28
  set(src: string, options: Partial<EnhancedImgProps>, result: ProcessedImageResult): Promise<void>;
30
29
  clear(): Promise<void>;
31
30
  updateConfig(config: Partial<ImageCacheConfig>): void;
32
- }
31
+ }
@@ -1,3 +1,4 @@
1
+ // Re-export types for convenience
1
2
  export type {
2
3
  EnhancedImgProps,
3
4
  ProcessedImageResult,
@@ -7,6 +8,13 @@ export type {
7
8
  ImageTransformationConfig,
8
9
  FormatQualitySettings,
9
10
  } from '../../types';
11
+ /**
12
+ * STX Media - Image Processor
13
+ *
14
+ * Integration with ts-images for build-time image optimization.
15
+ *
16
+ * @module media/image/processor
17
+ */
10
18
  export { processImage, optimizeImage, applyTransformations } from './optimizer';
11
19
  export { generateResponsiveVariants, generateSrcset } from './responsive';
12
- export { getCachedImageResult, setCachedImageResult, clearImageCache, ImageProcessorCache } from './cache';
20
+ export { getCachedImageResult, setCachedImageResult, clearImageCache, ImageProcessorCache } from './cache';
@@ -1,4 +1,4 @@
1
- import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, ImageFormat, ImageTransformationConfig, } from '../../types';
1
+ import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, ImageFormat, ImageTransformationConfig } from '../../types';
2
2
  /**
3
3
  * Process a single image with ts-images
4
4
  */
@@ -10,4 +10,4 @@ export declare function optimizeImage(src: string, format: ImageFormat, quality:
10
10
  /**
11
11
  * Apply transformations to an image
12
12
  */
13
- export declare function applyTransformations(src: string, transformations: ImageTransformationConfig[], tsImages?: typeof import('ts-images') | null): Promise<Buffer | null>;
13
+ export declare function applyTransformations(src: string, transformations: ImageTransformationConfig[], tsImages?: typeof import('ts-images') | null): Promise<Buffer | null>;
@@ -1,4 +1,4 @@
1
- import type { EnhancedImgProps, ResponsiveVariantSet, TsImagesConfig, ProcessedImageResult, } from '../../types';
1
+ import type { EnhancedImgProps, ResponsiveVariantSet, TsImagesConfig, ProcessedImageResult } from '../../types';
2
2
  /**
3
3
  * Generate responsive image variants using ts-images
4
4
  */
@@ -13,5 +13,6 @@ export declare function generateSrcset(variants: ProcessedImageResult['variants'
13
13
  export declare function generateArtDirectionSources(src: string, artDirection: NonNullable<EnhancedImgProps['artDirection']>, config: TsImagesConfig): Promise<Array<{ media: string; srcset: string; type: string }>>;
14
14
  /**
15
15
  * Default responsive breakpoints
16
+ * @defaultValue `[320, 480, 640, 768, 1024, 1280, 1536, 1920]`
16
17
  */
17
- export declare const DEFAULT_RESPONSIVE_WIDTHS: readonly [320, 480, 640, 768, 1024, 1280, 1536, 1920];
18
+ export declare const DEFAULT_RESPONSIVE_WIDTHS: number[];
@@ -1,4 +1,4 @@
1
- import type { Breakpoint, ImageFormat, ImageParams, ImageVariant, SrcsetData, SrcsetOptions, } from '../types';
1
+ import type { Breakpoint, ImageFormat, ImageParams, ImageVariant, SrcsetData, SrcsetOptions } from '../types';
2
2
  /**
3
3
  * Generate a width-based srcset string
4
4
  *
@@ -111,12 +111,14 @@ export declare function getFormatExtension(format: ImageFormat): string;
111
111
  export declare function detectFormat(src: string): ImageFormat | undefined;
112
112
  /**
113
113
  * Default breakpoint widths for responsive images
114
+ * @defaultValue `[320, 480, 640, 768, 1024, 1280, 1536, 1920, 2560]`
114
115
  */
115
- export declare const DEFAULT_WIDTHS: readonly [320, 480, 640, 768, 1024, 1280, 1536, 1920, 2560];
116
+ export declare const DEFAULT_WIDTHS: number[];
116
117
  /**
117
118
  * Default DPR values for fixed-width images
119
+ * @defaultValue `[1, 1.5, 2, 3]`
118
120
  */
119
- export declare const DEFAULT_DPR_VALUES: readonly [1, 1.5, 2, 3];
121
+ export declare const DEFAULT_DPR_VALUES: number[];
120
122
  /**
121
123
  * Default output formats in order of preference
122
124
  */
@@ -155,4 +157,4 @@ export declare const COMMON_SIZES: {
155
157
  quarterDesktop: '(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw';
156
158
  /** Content width (centered with max-width) */
157
159
  contentWidth: '(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px'
158
- };
160
+ };
@@ -1,4 +1,12 @@
1
1
  import type { MediaConfig } from './types';
2
+ /*"
3
+ * preview
4
+ * />
5
+ * ```
6
+ */
7
+ // =============================================================================
8
+ // Type Exports
9
+ // =============================================================================
2
10
  export type {
3
11
  // Placeholder types
4
12
  PlaceholderStrategy,
@@ -96,12 +104,16 @@ export type {
96
104
  SrcsetOptions,
97
105
  SrcsetData,
98
106
  } from './types';
107
+ // Export types separately
99
108
  export type { ExtendedVideoRenderContext } from './video';
100
109
  export type { CacheConfig, CacheEntry } from './shared';
101
110
  /**
102
111
  * Default media configuration
103
112
  */
104
113
  export declare const defaultMediaConfig: MediaConfig;
114
+ // =============================================================================
115
+ // Image Module
116
+ // =============================================================================
105
117
  export {
106
118
  // Component
107
119
  renderImgComponent,
@@ -182,6 +194,9 @@ export {
182
194
  validateParams,
183
195
  sanitizeParams,
184
196
  } from './image';
197
+ // =============================================================================
198
+ // Image Processor Module (ts-images integration)
199
+ // =============================================================================
185
200
  export {
186
201
  processImage,
187
202
  optimizeImage,
@@ -193,6 +208,9 @@ export {
193
208
  clearImageCache,
194
209
  ImageProcessorCache,
195
210
  } from './image/processor';
211
+ // =============================================================================
212
+ // Video Module
213
+ // =============================================================================
196
214
  export {
197
215
  renderVideoComponent,
198
216
  parseVideoDirectiveOptions,
@@ -200,6 +218,9 @@ export {
200
218
  createVideoDirective,
201
219
  videoDirective,
202
220
  } from './video';
221
+ // =============================================================================
222
+ // Video Processor Module (ts-videos integration)
223
+ // =============================================================================
203
224
  export {
204
225
  processVideo,
205
226
  analyzeVideo,
@@ -213,7 +234,13 @@ export {
213
234
  clearVideoCache,
214
235
  VideoProcessorCache,
215
236
  } from './video/processor';
237
+ // =============================================================================
238
+ // Upload Module
239
+ // =============================================================================
216
240
  export { renderMediaUpload } from './upload';
241
+ // =============================================================================
242
+ // Protected Media Module
243
+ // =============================================================================
217
244
  export {
218
245
  // URL signing
219
246
  signUrl,
@@ -243,7 +270,13 @@ export {
243
270
  // Runtime
244
271
  generateSignatureRuntime,
245
272
  } from './protected';
273
+ // =============================================================================
274
+ // Media Manager Module
275
+ // =============================================================================
246
276
  export { generateMediaManagerEmbed, generateSimpleMediaPicker } from './manager/embed';
277
+ // =============================================================================
278
+ // Client Runtime Module
279
+ // =============================================================================
247
280
  export {
248
281
  // Lazy loading
249
282
  isNativeLazySupported,
@@ -280,6 +313,9 @@ export {
280
313
  generateMediaRuntime,
281
314
  generateMinifiedMediaRuntime,
282
315
  } from './client';
316
+ // =============================================================================
317
+ // Shared Utilities
318
+ // =============================================================================
283
319
  export {
284
320
  hashFile,
285
321
  hashBuffer,
@@ -292,4 +328,4 @@ export {
292
328
  clearCache,
293
329
  getCacheStats,
294
330
  pruneCache,
295
- } from './shared';
331
+ } from './shared';
@@ -22,4 +22,4 @@ export declare function generateSimpleMediaPicker(options: {
22
22
  accept?: string
23
23
  multiple?: boolean
24
24
  onSelect?: string
25
- }): { html: string; script: string; css: string };
25
+ }): { html: string; script: string; css: string };
@@ -1,5 +1,4 @@
1
- import { } from './signature';
2
- import type { ProtectedMediaProps, } from '../types';
1
+ import type { ProtectedMediaProps } from '../types';
3
2
  /**
4
3
  * Render a protected image component
5
4
  *
@@ -31,4 +30,4 @@ export declare function processProtectedMedia(content: string, signatureEndpoint
31
30
  /**
32
31
  * Parse @protected directive arguments
33
32
  */
34
- export declare function parseProtectedArgs(content: string, params: Record<string, unknown>, context: Record<string, unknown>): ProtectedMediaProps;
33
+ export declare function parseProtectedArgs(content: string, params: Record<string, unknown>, context: Record<string, unknown>): ProtectedMediaProps;
@@ -1,3 +1,13 @@
1
+ /**
2
+ * STX Media - Protected Media Module
3
+ *
4
+ * Content protection via signed URLs and authentication.
5
+ *
6
+ * @module media/protected
7
+ */
8
+ // =============================================================================
9
+ // Signature Exports
10
+ // =============================================================================
1
11
  export {
2
12
  // URL signing
3
13
  signUrl,
@@ -21,6 +31,9 @@ export {
21
31
  // Runtime
22
32
  generateSignatureRuntime,
23
33
  } from './signature';
34
+ // =============================================================================
35
+ // Component Exports
36
+ // =============================================================================
24
37
  export {
25
38
  // Components
26
39
  renderProtectedImg,
@@ -31,4 +44,4 @@ export {
31
44
 
32
45
  // Directive helpers
33
46
  parseProtectedArgs,
34
- } from './component';
47
+ } from './component';
@@ -1,4 +1,4 @@
1
- import type { BatchSignatureResult, ProtectedAuthContext, SignatureConfig, SignedUrl, } from '../types';
1
+ import type { BatchSignatureResult, ProtectedAuthContext, SignatureConfig, SignedUrl } from '../types';
2
2
  /**
3
3
  * Sign a single URL for protected access
4
4
  *
@@ -69,4 +69,4 @@ export declare function pruneSignatureCache(): number;
69
69
  /**
70
70
  * Generate client-side signature handler runtime
71
71
  */
72
- export declare function generateSignatureRuntime(): string;
72
+ export declare function generateSignatureRuntime(): string;
@@ -51,4 +51,4 @@ export declare interface CacheConfig {
51
51
  directory: string
52
52
  maxAge: number
53
53
  maxSize: number
54
- }
54
+ }
@@ -21,4 +21,4 @@ export declare function getFileMtime(filePath: string): Promise<number>;
21
21
  /**
22
22
  * Check if file exists
23
23
  */
24
- export declare function fileExists(filePath: string): Promise<boolean>;
24
+ export declare function fileExists(filePath: string): Promise<boolean>;
@@ -1,2 +1,7 @@
1
+ /**
2
+ * STX Media - Shared Utilities
3
+ *
4
+ * @module media/shared
5
+ */
1
6
  export * from './hash';
2
- export * from './cache';
7
+ export * from './cache';