@stacksjs/stx 0.1.16 → 0.2.3

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 (277) hide show
  1. package/dist/a11y.d.ts +109 -5
  2. package/dist/analytics.d.ts +40 -0
  3. package/dist/animation.d.ts +91 -1
  4. package/dist/app.d.ts +51 -0
  5. package/dist/ast.d.ts +286 -0
  6. package/dist/async-components.d.ts +101 -0
  7. package/dist/auth.d.ts +1 -3
  8. package/dist/browser-composables.d.ts +314 -0
  9. package/dist/build-optimizer.d.ts +126 -0
  10. package/dist/build-views.d.ts +37 -0
  11. package/dist/bundle-analyzer/collector.d.ts +66 -0
  12. package/dist/bundle-analyzer/index.d.ts +60 -0
  13. package/dist/bundle-analyzer/report.d.ts +39 -0
  14. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  15. package/dist/bundle-analyzer.js +499 -0
  16. package/dist/caching.d.ts +7 -0
  17. package/dist/cli.js +10885 -1203
  18. package/dist/client/directive.d.ts +10 -0
  19. package/dist/client/index.d.ts +7 -0
  20. package/dist/client/router.d.ts +36 -0
  21. package/dist/client/stx-router.browser.d.ts +0 -0
  22. package/dist/client-script.d.ts +22 -0
  23. package/dist/component-hmr.d.ts +120 -0
  24. package/dist/components.d.ts +23 -1
  25. package/dist/composables/index.d.ts +277 -0
  26. package/dist/composables/use-battery.d.ts +46 -0
  27. package/dist/composables/use-broadcast-channel.d.ts +58 -0
  28. package/dist/composables/use-clipboard.d.ts +34 -0
  29. package/dist/composables/use-cookie.d.ts +70 -0
  30. package/dist/composables/use-device-orientation.d.ts +109 -0
  31. package/dist/composables/use-event-source.d.ts +77 -0
  32. package/dist/composables/use-eye-dropper.d.ts +107 -0
  33. package/dist/composables/use-fetch.d.ts +84 -0
  34. package/dist/composables/use-fullscreen.d.ts +47 -0
  35. package/dist/composables/use-geolocation.d.ts +62 -0
  36. package/dist/composables/use-idle.d.ts +84 -0
  37. package/dist/composables/use-intersection-observer.d.ts +81 -0
  38. package/dist/composables/use-keyboard.d.ts +100 -0
  39. package/dist/composables/use-media-query.d.ts +56 -0
  40. package/dist/composables/use-mouse.d.ts +64 -0
  41. package/dist/composables/use-mutation-observer.d.ts +101 -0
  42. package/dist/composables/use-network.d.ts +40 -0
  43. package/dist/composables/use-notification.d.ts +89 -0
  44. package/dist/composables/use-permissions.d.ts +109 -0
  45. package/dist/composables/use-resize-observer.d.ts +60 -0
  46. package/dist/composables/use-share.d.ts +70 -0
  47. package/dist/composables/use-speech.d.ts +117 -0
  48. package/dist/composables/use-storage.d.ts +64 -0
  49. package/dist/composables/use-text-selection.d.ts +97 -0
  50. package/dist/composables/use-wake-lock.d.ts +85 -0
  51. package/dist/composables/use-websocket.d.ts +69 -0
  52. package/dist/composables/use-window.d.ts +84 -0
  53. package/dist/composables.d.ts +268 -0
  54. package/dist/composition-api.d.ts +190 -0
  55. package/dist/computed.d.ts +137 -0
  56. package/dist/conditionals.d.ts +14 -2
  57. package/dist/config.d.ts +36 -3
  58. package/dist/craft-bridge.d.ts +319 -0
  59. package/dist/craft-compiler.d.ts +229 -0
  60. package/dist/craft-components.d.ts +411 -0
  61. package/dist/craft-entry.d.ts +5 -0
  62. package/dist/craft-ssr.d.ts +134 -0
  63. package/dist/craft.js +1553 -0
  64. package/dist/csp.d.ts +229 -0
  65. package/dist/database.d.ts +407 -0
  66. package/dist/database.js +5 -0
  67. package/dist/defer.d.ts +4 -0
  68. package/dist/deploy/config-generators.d.ts +75 -0
  69. package/dist/deploy/index.d.ts +84 -0
  70. package/dist/deploy/netlify.d.ts +109 -0
  71. package/dist/dev-server/crosswind.d.ts +54 -0
  72. package/dist/dev-server/index.d.ts +7 -0
  73. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  74. package/dist/dev-server/native-window.d.ts +40 -0
  75. package/dist/dev-server/port-utils.d.ts +27 -0
  76. package/dist/dev-server/terminal-colors.d.ts +60 -0
  77. package/dist/dev-server/theme-selector.d.ts +32 -0
  78. package/dist/dev-server/types.d.ts +92 -0
  79. package/dist/dev-server.d.ts +21 -0
  80. package/dist/devtools.d.ts +142 -0
  81. package/dist/directive-api.d.ts +111 -0
  82. package/dist/dynamic-components.d.ts +14 -0
  83. package/dist/edge-runtime.d.ts +200 -0
  84. package/dist/env.d.ts +9 -0
  85. package/dist/error-boundaries.d.ts +71 -0
  86. package/dist/error-handling.d.ts +1 -101
  87. package/dist/errors/codes.d.ts +99 -0
  88. package/dist/errors/formatter.d.ts +64 -0
  89. package/dist/errors/index.d.ts +56 -0
  90. package/dist/errors/logger.d.ts +74 -0
  91. package/dist/errors/sanitizer.d.ts +43 -0
  92. package/dist/errors/types.d.ts +79 -0
  93. package/dist/events.d.ts +106 -0
  94. package/dist/expressions.d.ts +86 -11
  95. package/dist/formatter.d.ts +4 -0
  96. package/dist/forms-validation.d.ts +173 -0
  97. package/dist/forms.d.ts +157 -8
  98. package/dist/head.d.ts +225 -0
  99. package/dist/heatmap.d.ts +125 -0
  100. package/dist/hot-reload.d.ts +87 -0
  101. package/dist/hydration-runtime.d.ts +47 -0
  102. package/dist/hydration.d.ts +161 -0
  103. package/dist/i18n.d.ts +240 -4
  104. package/dist/image-optimization/build-plugin.d.ts +53 -0
  105. package/dist/image-optimization/component.d.ts +46 -0
  106. package/dist/image-optimization/directive.d.ts +30 -0
  107. package/dist/image-optimization/index.d.ts +86 -0
  108. package/dist/image-optimization/processor.d.ts +112 -0
  109. package/dist/includes.d.ts +94 -9
  110. package/dist/index.d.ts +63 -3
  111. package/dist/index.js +11604 -1318
  112. package/dist/init.d.ts +32 -2
  113. package/dist/interactive.d.ts +14 -0
  114. package/dist/internal-markdown.d.ts +22 -0
  115. package/dist/jsx-runtime.d.ts +110 -0
  116. package/dist/keep-alive.d.ts +87 -0
  117. package/dist/lazy-loader.d.ts +122 -0
  118. package/dist/loading-indicator.d.ts +40 -0
  119. package/dist/loops.d.ts +22 -1
  120. package/dist/media/client/blur-up.d.ts +65 -0
  121. package/dist/media/client/index.d.ts +77 -0
  122. package/dist/media/client/lazy-load.d.ts +73 -0
  123. package/dist/media/client/upload-handler.d.ts +79 -0
  124. package/dist/media/image/component.d.ts +46 -0
  125. package/dist/media/image/directive.d.ts +9 -0
  126. package/dist/media/image/editing.d.ts +212 -0
  127. package/dist/media/image/index.d.ts +118 -0
  128. package/dist/media/image/placeholder.d.ts +78 -0
  129. package/dist/media/image/processor/cache.d.ts +32 -0
  130. package/dist/media/image/processor/index.d.ts +12 -0
  131. package/dist/media/image/processor/optimizer.d.ts +13 -0
  132. package/dist/media/image/processor/responsive.d.ts +17 -0
  133. package/dist/media/image/srcset.d.ts +158 -0
  134. package/dist/media/index.d.ts +295 -0
  135. package/dist/media/manager/embed.d.ts +25 -0
  136. package/dist/media/protected/component.d.ts +34 -0
  137. package/dist/media/protected/index.d.ts +34 -0
  138. package/dist/media/protected/signature.d.ts +72 -0
  139. package/dist/media/shared/cache.d.ts +54 -0
  140. package/dist/media/shared/hash.d.ts +24 -0
  141. package/dist/media/shared/index.d.ts +2 -0
  142. package/dist/media/types.d.ts +1051 -0
  143. package/dist/media/upload/component.d.ts +23 -0
  144. package/dist/media/upload/index.d.ts +1 -0
  145. package/dist/media/video/directive.d.ts +9 -0
  146. package/dist/media/video/index.d.ts +47 -0
  147. package/dist/media/video/processor/cache.d.ts +33 -0
  148. package/dist/media/video/processor/index.d.ts +21 -0
  149. package/dist/media/video/processor/streaming.d.ts +19 -0
  150. package/dist/media/video/processor/thumbnail.d.ts +28 -0
  151. package/dist/media/video/processor/transcoder.d.ts +9 -0
  152. package/dist/middleware.d.ts +42 -3
  153. package/dist/native-build.d.ts +74 -0
  154. package/dist/parser/directive-parser.d.ts +79 -0
  155. package/dist/parser/expression-parser.d.ts +59 -0
  156. package/dist/parser/index.d.ts +35 -0
  157. package/dist/parser/tokenizer.d.ts +81 -0
  158. package/dist/partial-hydration.d.ts +88 -0
  159. package/dist/performance-utils.d.ts +146 -3
  160. package/dist/plugin-system.d.ts +128 -0
  161. package/dist/plugin.d.ts +1 -0
  162. package/dist/precompiler.d.ts +108 -0
  163. package/dist/production-build.d.ts +199 -0
  164. package/dist/props.d.ts +199 -0
  165. package/dist/pwa/audit.d.ts +42 -0
  166. package/dist/pwa/directives.d.ts +29 -0
  167. package/dist/pwa/icons.d.ts +39 -0
  168. package/dist/pwa/index.d.ts +59 -0
  169. package/dist/pwa/inject.d.ts +22 -0
  170. package/dist/pwa/manifest.d.ts +104 -0
  171. package/dist/pwa/offline.d.ts +8 -0
  172. package/dist/pwa/precache.d.ts +29 -0
  173. package/dist/pwa/service-worker.d.ts +21 -0
  174. package/dist/pwa/workbox-strategies.d.ts +100 -0
  175. package/dist/pwa/workbox.d.ts +52 -0
  176. package/dist/pwa.d.ts +51 -0
  177. package/dist/pwa.js +8124 -0
  178. package/dist/reactive-bindings.d.ts +24 -0
  179. package/dist/reactive.d.ts +100 -0
  180. package/dist/reactivity.d.ts +253 -0
  181. package/dist/route-middleware.d.ts +232 -0
  182. package/dist/router.d.ts +31 -0
  183. package/dist/routes.d.ts +0 -7
  184. package/dist/runtime.d.ts +140 -0
  185. package/dist/safe-evaluator.d.ts +117 -3
  186. package/dist/scaffolding.d.ts +113 -0
  187. package/dist/seo.d.ts +120 -7
  188. package/dist/server-components.d.ts +134 -0
  189. package/dist/signals.d.ts +501 -0
  190. package/dist/slots.d.ts +63 -0
  191. package/dist/source-maps.d.ts +117 -0
  192. package/dist/ssg.d.ts +157 -0
  193. package/dist/ssg.js +6831 -0
  194. package/dist/ssr.d.ts +107 -0
  195. package/dist/state-management.d.ts +324 -0
  196. package/dist/stores-client.d.ts +70 -0
  197. package/dist/story/addons.d.ts +123 -0
  198. package/dist/story/analytics.d.ts +92 -0
  199. package/dist/story/auto-stories.d.ts +38 -0
  200. package/dist/story/bookmarks.d.ts +53 -0
  201. package/dist/story/bun-test.d.ts +44 -0
  202. package/dist/story/cli.d.ts +34 -0
  203. package/dist/story/collect/analyzer.d.ts +33 -0
  204. package/dist/story/collect/index.d.ts +27 -0
  205. package/dist/story/collect/parser.d.ts +17 -0
  206. package/dist/story/collect/scanner.d.ts +13 -0
  207. package/dist/story/collect/tree.d.ts +17 -0
  208. package/dist/story/commands/build.d.ts +14 -0
  209. package/dist/story/commands/dev.d.ts +16 -0
  210. package/dist/story/commands/index.d.ts +6 -0
  211. package/dist/story/commands/preview.d.ts +15 -0
  212. package/dist/story/compiled-output.d.ts +26 -0
  213. package/dist/story/composition.d.ts +47 -0
  214. package/dist/story/config-watcher.d.ts +26 -0
  215. package/dist/story/config.d.ts +26 -0
  216. package/dist/story/context.d.ts +21 -0
  217. package/dist/story/controls/index.d.ts +54 -0
  218. package/dist/story/crosswind.d.ts +29 -0
  219. package/dist/story/desktop-preview.d.ts +34 -0
  220. package/dist/story/docs-generator.d.ts +30 -0
  221. package/dist/story/errors.d.ts +47 -0
  222. package/dist/story/figma-export.d.ts +169 -0
  223. package/dist/story/generator.d.ts +21 -0
  224. package/dist/story/hmr.d.ts +64 -0
  225. package/dist/story/hot-swap.d.ts +35 -0
  226. package/dist/story/index.d.ts +51 -0
  227. package/dist/story/interactions.d.ts +52 -0
  228. package/dist/story/keyboard-shortcuts.d.ts +34 -0
  229. package/dist/story/output.d.ts +85 -0
  230. package/dist/story/performance.d.ts +76 -0
  231. package/dist/story/presets.d.ts +62 -0
  232. package/dist/story/props-validation.d.ts +45 -0
  233. package/dist/story/renderer.d.ts +53 -0
  234. package/dist/story/search-index.d.ts +47 -0
  235. package/dist/story/search.d.ts +45 -0
  236. package/dist/story/server.d.ts +21 -0
  237. package/dist/story/setup.d.ts +47 -0
  238. package/dist/story/snapshots.d.ts +65 -0
  239. package/dist/story/testing.d.ts +58 -0
  240. package/dist/story/theme.d.ts +68 -0
  241. package/dist/story/types.d.ts +249 -0
  242. package/dist/story/ui/code-panel.d.ts +42 -0
  243. package/dist/story/ui/controls-panel.d.ts +25 -0
  244. package/dist/story/ui/index.d.ts +4 -0
  245. package/dist/story/ui/navigation.d.ts +55 -0
  246. package/dist/story/ui/preview.d.ts +46 -0
  247. package/dist/story/visual-testing.d.ts +45 -0
  248. package/dist/streaming.d.ts +82 -2
  249. package/dist/suspense.d.ts +83 -0
  250. package/dist/teleport.d.ts +9 -0
  251. package/dist/testing.d.ts +289 -0
  252. package/dist/transitions.d.ts +87 -0
  253. package/dist/type-checker.d.ts +109 -0
  254. package/dist/types/component-types.d.ts +129 -0
  255. package/dist/types/config-types.d.ts +336 -0
  256. package/dist/types/context-types.d.ts +99 -0
  257. package/dist/types/csp-types.d.ts +79 -0
  258. package/dist/types/directive-types.d.ts +259 -0
  259. package/dist/types/index.d.ts +98 -0
  260. package/dist/types/pwa-types.d.ts +218 -0
  261. package/dist/types.d.ts +1 -315
  262. package/dist/typescript-templates.d.ts +178 -0
  263. package/dist/utils.d.ts +52 -6
  264. package/dist/validator.d.ts +77 -0
  265. package/dist/variable-extractor.d.ts +39 -0
  266. package/dist/view-composers.d.ts +154 -9
  267. package/dist/virtual-scrolling.d.ts +103 -0
  268. package/dist/visual-editor.d.ts +209 -0
  269. package/dist/visual-testing.d.ts +109 -0
  270. package/dist/visual-testing.js +126 -0
  271. package/dist/vue-template.d.ts +16 -0
  272. package/dist/web-components/css-scoping.d.ts +54 -0
  273. package/dist/web-components/index.d.ts +20 -0
  274. package/dist/web-components/reactive-generator.d.ts +72 -0
  275. package/dist/web-components.d.ts +222 -2
  276. package/dist/x-element.d.ts +35 -0
  277. package/package.json +41 -10
@@ -0,0 +1,1051 @@
1
+ /**
2
+ * Options for placeholder generation
3
+ */
4
+ export declare interface PlaceholderOptions {
5
+ strategy: PlaceholderStrategy
6
+ width?: number
7
+ height?: number
8
+ quality?: number
9
+ blurLevel?: number
10
+ transitionDuration?: number
11
+ easing?: string
12
+ }
13
+ /**
14
+ * Result from placeholder generation
15
+ */
16
+ export declare interface PlaceholderResult {
17
+ dataURL: string
18
+ width: number
19
+ height: number
20
+ aspectRatio: number
21
+ originalWidth: number
22
+ originalHeight: number
23
+ strategy: PlaceholderStrategy
24
+ dominantColor?: string
25
+ css?: string
26
+ }
27
+ /**
28
+ * imgix-style image transformation parameters
29
+ */
30
+ export declare interface ImageParams {
31
+ w?: number
32
+ h?: number
33
+ fit?: ImageFit
34
+ crop?: ImageCrop
35
+ ar?: string
36
+ fm?: ImageFormat
37
+ q?: number
38
+ lossless?: boolean
39
+ progressive?: boolean
40
+ blur?: number
41
+ sharp?: number
42
+ bri?: number
43
+ con?: number
44
+ sat?: number
45
+ hue?: number
46
+ exp?: number
47
+ vib?: number
48
+ high?: number
49
+ shad?: number
50
+ gam?: number
51
+ rot?: number
52
+ flip?: 'h' | 'v' | 'hv'
53
+ orient?: number
54
+ mark?: string
55
+ markx?: number
56
+ marky?: number
57
+ markalpha?: number
58
+ markscale?: number
59
+ markalign?: 'top' | 'middle' | 'bottom' | 'left' | 'center' | 'right'
60
+ sepia?: number
61
+ px?: number
62
+ mono?: string
63
+ duotone?: string
64
+ invert?: boolean
65
+ auto?: string | string[]
66
+ dpr?: number
67
+ }
68
+ /**
69
+ * Image variant generated at a specific size/format
70
+ */
71
+ export declare interface ImageVariant {
72
+ path: string
73
+ url: string
74
+ width: number
75
+ height: number
76
+ format: ImageFormat
77
+ size: number
78
+ dpr?: number
79
+ }
80
+ /**
81
+ * Processed image with all variants
82
+ */
83
+ export declare interface ProcessedImage {
84
+ src: string
85
+ variants: ImageVariant[]
86
+ placeholder?: PlaceholderResult
87
+ width: number
88
+ height: number
89
+ aspectRatio: number
90
+ hash: string
91
+ }
92
+ /**
93
+ * <Img> component props
94
+ */
95
+ export declare interface ImgProps {
96
+ src: string
97
+ alt: string
98
+ width?: number | string
99
+ height?: number | string
100
+ sizes?: string
101
+ widths?: number[]
102
+ dpr?: number[]
103
+ formats?: ImageFormat[]
104
+ quality?: number
105
+ params?: ImageParams
106
+ placeholder?: PlaceholderStrategy
107
+ placeholderOptions?: Partial<PlaceholderOptions>
108
+ lazy?: boolean
109
+ priority?: boolean
110
+ loading?: 'lazy' | 'eager'
111
+ decoding?: 'sync' | 'async' | 'auto'
112
+ fetchpriority?: 'high' | 'low' | 'auto'
113
+ objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'
114
+ objectPosition?: string
115
+ class?: string
116
+ style?: string
117
+ id?: string
118
+ data?: Record<string, string>
119
+ crossorigin?: 'anonymous' | 'use-credentials'
120
+ referrerpolicy?: string
121
+ }
122
+ /**
123
+ * @img directive options
124
+ */
125
+ export declare interface ImgDirectiveOptions extends Omit<ImgProps, 'src' | 'alt'> {
126
+ srcset?: string
127
+ }
128
+ /**
129
+ * Image render context
130
+ */
131
+ export declare interface ImageRenderContext {
132
+ processedImage?: ProcessedImage
133
+ optimize?: boolean
134
+ isDev?: boolean
135
+ baseUrl?: string
136
+ outputDir?: string
137
+ }
138
+ /**
139
+ * Image render result
140
+ */
141
+ export declare interface ImageRenderResult {
142
+ html: string
143
+ preloadLink?: string
144
+ css?: string
145
+ script?: string
146
+ }
147
+ /**
148
+ * Video source definition
149
+ */
150
+ export declare interface VideoSource {
151
+ src: string
152
+ type: string
153
+ media?: string
154
+ codecs?: string
155
+ }
156
+ /**
157
+ * Plyr.js configuration options
158
+ */
159
+ export declare interface PlyrOptions {
160
+ controls?: PlyrControl[] | boolean
161
+ autoplay?: boolean
162
+ muted?: boolean
163
+ loop?: { active: boolean }
164
+ seekTime?: number
165
+ volume?: number
166
+ clickToPlay?: boolean
167
+ hideControls?: number
168
+ resetOnEnd?: boolean
169
+ disableContextMenu?: boolean
170
+ keyboard?: { focused: boolean; global: boolean }
171
+ tooltips?: { controls: boolean; seek: boolean }
172
+ quality?: { default: number; options: number[]; forced: boolean }
173
+ captions?: { active: boolean; language: string; update: boolean }
174
+ storage?: { enabled: boolean; key: string }
175
+ speed?: { selected: number; options: number[] }
176
+ ratio?: string
177
+ fullscreen?: { enabled: boolean; fallback: boolean; iosNative: boolean }
178
+ previewThumbnails?: { enabled: boolean; src: string }
179
+ i18n?: Record<string, string>
180
+ }
181
+ /**
182
+ * <Video> component props
183
+ */
184
+ export declare interface VideoProps {
185
+ src?: string
186
+ sources?: VideoSource[]
187
+ poster?: string
188
+ posterPlaceholder?: PlaceholderStrategy
189
+ controls?: boolean
190
+ autoplay?: boolean
191
+ muted?: boolean
192
+ loop?: boolean
193
+ preload?: 'none' | 'metadata' | 'auto'
194
+ playsinline?: boolean
195
+ lazy?: boolean
196
+ player?: 'native' | 'plyr' | 'ts-video'
197
+ title?: string
198
+ plyrOptions?: PlyrOptions
199
+ type?: VideoEmbedType
200
+ width?: number | string
201
+ height?: number | string
202
+ class?: string
203
+ style?: string
204
+ id?: string
205
+ crossorigin?: 'anonymous' | 'use-credentials'
206
+ disablePictureInPicture?: boolean
207
+ disableRemotePlayback?: boolean
208
+ }
209
+ /**
210
+ * @video directive options
211
+ */
212
+ export declare interface VideoDirectiveOptions extends Omit<VideoProps, 'src'> {
213
+
214
+ }
215
+ /**
216
+ * Video render result
217
+ */
218
+ export declare interface VideoRenderResult {
219
+ html: string
220
+ script?: string
221
+ css?: string
222
+ }
223
+ /**
224
+ * File validation result
225
+ */
226
+ export declare interface FileValidationResult {
227
+ valid: boolean
228
+ error?: string
229
+ code?: 'INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL' | 'INVALID_DIMENSIONS'
230
+ }
231
+ /**
232
+ * Upload progress information
233
+ */
234
+ export declare interface UploadProgress {
235
+ file: File
236
+ loaded: number
237
+ total: number
238
+ percent: number
239
+ speed?: number
240
+ timeRemaining?: number
241
+ }
242
+ /**
243
+ * Upload result
244
+ */
245
+ export declare interface UploadResult {
246
+ success: boolean
247
+ url?: string
248
+ id?: string
249
+ name?: string
250
+ size?: number
251
+ type?: string
252
+ error?: string
253
+ errorCode?: string
254
+ data?: Record<string, unknown>
255
+ }
256
+ /**
257
+ * Upload configuration
258
+ */
259
+ export declare interface UploadConfig {
260
+ endpoint: string
261
+ method?: 'POST' | 'PUT' | 'PATCH'
262
+ headers?: Record<string, string>
263
+ fieldName?: string
264
+ maxSize?: number
265
+ minSize?: number
266
+ maxFiles?: number
267
+ accept?: string[]
268
+ chunkSize?: number
269
+ retries?: number
270
+ timeout?: number
271
+ withCredentials?: boolean
272
+ formData?: Record<string, string>
273
+ validateDimensions?: {
274
+ minWidth?: number
275
+ maxWidth?: number
276
+ minHeight?: number
277
+ maxHeight?: number
278
+ }
279
+ }
280
+ /**
281
+ * <MediaUpload> component props
282
+ */
283
+ export declare interface MediaUploadProps extends UploadConfig {
284
+ preview?: boolean
285
+ dropzone?: boolean
286
+ multiple?: boolean
287
+ autoUpload?: boolean
288
+ showProgress?: boolean
289
+ disabled?: boolean
290
+ class?: string
291
+ style?: string
292
+ id?: string
293
+ placeholder?: string
294
+ label?: string
295
+ }
296
+ /**
297
+ * @upload directive options
298
+ */
299
+ export declare interface UploadDirectiveOptions extends Omit<MediaUploadProps, 'endpoint'> {
300
+ onProgress?: string
301
+ onComplete?: string
302
+ onError?: string
303
+ }
304
+ /**
305
+ * Signed URL result
306
+ */
307
+ export declare interface SignedUrl {
308
+ url: string
309
+ signature: string
310
+ expires: number
311
+ oneTimeUse?: boolean
312
+ }
313
+ /**
314
+ * Signature request configuration
315
+ */
316
+ export declare interface SignatureConfig {
317
+ endpoint: string
318
+ method?: 'GET' | 'POST'
319
+ headers?: Record<string, string>
320
+ expirationSeconds?: number
321
+ oneTimeUse?: boolean
322
+ params?: Record<string, unknown>
323
+ }
324
+ /**
325
+ * Batch signature request
326
+ */
327
+ export declare interface BatchSignatureRequest {
328
+ sources: string[]
329
+ config: SignatureConfig
330
+ }
331
+ /**
332
+ * Batch signature result
333
+ */
334
+ export declare interface BatchSignatureResult {
335
+ signatures: Map<string, SignedUrl>
336
+ errors: Map<string, string>
337
+ }
338
+ /**
339
+ * Protected media authentication context
340
+ */
341
+ export declare interface ProtectedAuthContext {
342
+ role?: string
343
+ permission?: string
344
+ userId?: string
345
+ check?: () => boolean | Promise<boolean>
346
+ }
347
+ /**
348
+ * <ProtectedImg> component props
349
+ */
350
+ export declare interface ProtectedMediaProps {
351
+ src: string
352
+ alt?: string
353
+ signatureEndpoint?: string
354
+ signatureConfig?: Partial<SignatureConfig>
355
+ auth?: ProtectedAuthContext
356
+ fallback?: string
357
+ oneTimeUse?: boolean
358
+ class?: string
359
+ style?: string
360
+ }
361
+ /**
362
+ * @protected directive options
363
+ */
364
+ export declare interface ProtectedDirectiveOptions extends Omit<ProtectedMediaProps, 'src' | 'alt'> {
365
+
366
+ }
367
+ /**
368
+ * Media manager configuration
369
+ */
370
+ export declare interface MediaManagerConfig {
371
+ src: string
372
+ apiKey?: string
373
+ bucket?: string
374
+ allowedTypes?: string[]
375
+ maxFileSize?: number
376
+ multiple?: boolean
377
+ customStyles?: Record<string, string>
378
+ callbacks?: {
379
+ onSelect?: string
380
+ onUpload?: string
381
+ onDelete?: string
382
+ onError?: string
383
+ }
384
+ }
385
+ /**
386
+ * Media item from manager
387
+ */
388
+ export declare interface MediaItem {
389
+ id: string
390
+ url: string
391
+ name: string
392
+ type: string
393
+ size: number
394
+ width?: number
395
+ height?: number
396
+ duration?: number
397
+ createdAt: string
398
+ updatedAt: string
399
+ metadata?: Record<string, unknown>
400
+ }
401
+ /**
402
+ * Image optimization configuration
403
+ */
404
+ export declare interface MediaImageConfig {
405
+ enabled?: boolean
406
+ defaultWidths?: number[]
407
+ defaultFormats?: ImageFormat[]
408
+ defaultQuality?: number
409
+ placeholderStrategy?: PlaceholderStrategy
410
+ lazyByDefault?: boolean
411
+ editingEndpoint?: string | null
412
+ outputDir?: string
413
+ baseUrl?: string
414
+ enableDpr?: boolean
415
+ defaultDpr?: number[]
416
+ tsImages?: Record<string, unknown>
417
+ }
418
+ /**
419
+ * Video configuration
420
+ */
421
+ export declare interface MediaVideoConfig {
422
+ enabled?: boolean
423
+ plyrVersion?: string
424
+ plyrTheme?: string
425
+ lazyByDefault?: boolean
426
+ defaultControls?: boolean
427
+ defaultPlyrOptions?: Partial<PlyrOptions>
428
+ tsVideos?: Record<string, unknown>
429
+ }
430
+ /**
431
+ * Upload configuration
432
+ */
433
+ export declare interface MediaUploadConfig {
434
+ enabled?: boolean
435
+ defaultEndpoint?: string
436
+ maxSize?: number
437
+ allowedTypes?: string[]
438
+ chunkSize?: number
439
+ maxConcurrent?: number
440
+ }
441
+ /**
442
+ * Protected media configuration
443
+ */
444
+ export declare interface MediaProtectedConfig {
445
+ enabled?: boolean
446
+ signatureEndpoint?: string
447
+ expirationSeconds?: number
448
+ batchSize?: number
449
+ }
450
+ /**
451
+ * Media cache configuration
452
+ */
453
+ export declare interface MediaCacheConfig {
454
+ enabled?: boolean
455
+ directory?: string
456
+ maxAge?: number
457
+ maxSize?: number
458
+ }
459
+ /**
460
+ * Complete media module configuration
461
+ */
462
+ export declare interface MediaConfig {
463
+ enabled?: boolean
464
+ image?: MediaImageConfig
465
+ video?: MediaVideoConfig
466
+ upload?: MediaUploadConfig
467
+ protected?: MediaProtectedConfig
468
+ cache?: MediaCacheConfig
469
+ }
470
+ /**
471
+ * Lazy load observer options
472
+ */
473
+ export declare interface LazyLoadOptions {
474
+ root?: Element | null
475
+ rootMargin?: string
476
+ threshold?: number | number[]
477
+ useNative?: boolean
478
+ }
479
+ /**
480
+ * Blur-up animation options
481
+ */
482
+ export declare interface BlurUpOptions {
483
+ duration?: number
484
+ easing?: string
485
+ removePlaceholder?: boolean
486
+ loadedClass?: string
487
+ }
488
+ /**
489
+ * Breakpoint definition for responsive images
490
+ */
491
+ export declare interface Breakpoint {
492
+ name: string
493
+ minWidth?: number
494
+ maxWidth?: number
495
+ imageWidth: number | string
496
+ }
497
+ /**
498
+ * Srcset generation options
499
+ */
500
+ export declare interface SrcsetOptions {
501
+ src: string
502
+ widths?: number[]
503
+ dprValues?: number[]
504
+ fixedWidth?: number
505
+ formats?: ImageFormat[]
506
+ baseUrl?: string
507
+ params?: ImageParams
508
+ }
509
+ /**
510
+ * Generated srcset data
511
+ */
512
+ export declare interface SrcsetData {
513
+ srcset: string
514
+ format: ImageFormat
515
+ mimeType: string
516
+ variants: ImageVariant[]
517
+ }
518
+ /**
519
+ * Watermark configuration
520
+ */
521
+ export declare interface WatermarkConfig {
522
+ image?: string
523
+ text?: string
524
+ position?: WatermarkPosition
525
+ opacity?: number
526
+ scale?: number
527
+ font?: string
528
+ fontSize?: number
529
+ color?: string
530
+ }
531
+ /**
532
+ * Art direction configuration for responsive images
533
+ */
534
+ export declare interface ArtDirectionConfig {
535
+ media: string
536
+ src: string
537
+ widths?: number[]
538
+ crop?: ImageCrop
539
+ aspectRatio?: string
540
+ }
541
+ /**
542
+ * Image transformation configuration
543
+ */
544
+ export declare interface ImageTransformationConfig {
545
+ type: ImageTransformation
546
+ options?: {
547
+ // Resize options
548
+ width?: number
549
+ height?: number
550
+ fit?: ImageFit
551
+ // Blur options
552
+ sigma?: number
553
+ // Sharpen options
554
+ amount?: number
555
+ // Rotation options
556
+ angle?: number
557
+ // Adjustment options
558
+ value?: number
559
+ }
560
+ }
561
+ /**
562
+ * Format-specific quality settings for ts-images
563
+ */
564
+ export declare interface FormatQualitySettings {
565
+ jpeg?: {
566
+ /** Quality (1-100) */
567
+ quality?: number
568
+ /** Use MozJPEG encoder */
569
+ mozjpeg?: boolean
570
+ /** Chroma subsampling */
571
+ chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0'
572
+ /** Progressive encoding */
573
+ progressive?: boolean
574
+ /** Optimize Huffman coding */
575
+ optimizeCoding?: boolean
576
+ }
577
+ png?: {
578
+ /** Quality (1-100) */
579
+ quality?: number
580
+ /** Compression level (0-9) */
581
+ compressionLevel?: number
582
+ /** Use palette mode */
583
+ palette?: boolean
584
+ /** Adaptive filtering */
585
+ adaptiveFiltering?: boolean
586
+ /** Progressive scan */
587
+ progressive?: boolean
588
+ }
589
+ webp?: {
590
+ /** Quality (1-100) */
591
+ quality?: number
592
+ /** Lossless encoding */
593
+ lossless?: boolean
594
+ /** Compression effort (0-6) */
595
+ effort?: number
596
+ /** Smart chroma subsampling */
597
+ smartSubsample?: boolean
598
+ /** Near-lossless mode (0-100) */
599
+ nearLossless?: number
600
+ }
601
+ avif?: {
602
+ /** Quality (1-100) */
603
+ quality?: number
604
+ /** Lossless encoding */
605
+ lossless?: boolean
606
+ /** Compression effort (0-9) */
607
+ effort?: number
608
+ /** Chroma subsampling */
609
+ chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0'
610
+ }
611
+ }
612
+ /**
613
+ * ts-images integration configuration
614
+ */
615
+ export declare interface TsImagesConfig {
616
+ enabled: boolean
617
+ outputDir: string
618
+ baseUrl?: string
619
+ formatQuality?: FormatQualitySettings
620
+ breakpoints?: number[]
621
+ defaultFormats?: ImageFormat[]
622
+ defaultQuality?: number
623
+ batchOptions?: {
624
+ /** Max concurrent processing */
625
+ concurrency?: number
626
+ /** Optimization preset */
627
+ optimizationPreset?: ImageOptimizationPreset
628
+ }
629
+ placeholderStrategy?: string
630
+ generateSprites?: boolean
631
+ spriteOutputDir?: string
632
+ }
633
+ /**
634
+ * Enhanced image props with ts-images integration
635
+ */
636
+ export declare interface EnhancedImgProps extends ImgProps {
637
+ preset?: ImageOptimizationPreset
638
+ process?: boolean
639
+ transformations?: ImageTransformationConfig[]
640
+ responsiveWidths?: number[]
641
+ watermark?: WatermarkConfig
642
+ artDirection?: ArtDirectionConfig[]
643
+ useDominantColor?: boolean
644
+ embedThumbhash?: boolean
645
+ blurAmount?: number
646
+ outputPattern?: string
647
+ skipOptimization?: boolean
648
+ outputFormat?: ImageFormat
649
+ }
650
+ /**
651
+ * Result from processing an image with ts-images
652
+ */
653
+ export declare interface ProcessedImageResult {
654
+ src: string
655
+ processed: boolean
656
+ variants?: Array<{
657
+ /** Output path */
658
+ path: string
659
+ /** URL for srcset */
660
+ url: string
661
+ /** Width in pixels */
662
+ width: number
663
+ /** Height in pixels */
664
+ height: number
665
+ /** Output format */
666
+ format: ImageFormat
667
+ /** File size in bytes */
668
+ size: number
669
+ /** Device pixel ratio (for DPR-based srcsets) */
670
+ dpr?: number
671
+ }>
672
+ placeholder?: string
673
+ dominantColor?: string
674
+ originalWidth?: number
675
+ originalHeight?: number
676
+ hash?: string
677
+ errors?: string[]
678
+ }
679
+ /**
680
+ * Responsive variant set result
681
+ */
682
+ export declare interface ResponsiveVariantSet {
683
+ src: string
684
+ byFormat: Record<ImageFormat, ProcessedImageResult['variants']>
685
+ srcsets: Record<ImageFormat, string>
686
+ sizes?: string
687
+ placeholder?: {
688
+ dataURL: string
689
+ width: number
690
+ height: number
691
+ strategy: PlaceholderStrategy
692
+ }
693
+ }
694
+ /**
695
+ * Poster/thumbnail generation options
696
+ */
697
+ export declare interface PosterGenerationConfig {
698
+ timestamp?: number
699
+ width?: number
700
+ height?: number
701
+ format?: 'jpeg' | 'png' | 'webp'
702
+ quality?: number
703
+ }
704
+ /**
705
+ * Sprite sheet configuration for video scrubbing preview
706
+ */
707
+ export declare interface SpriteSheetConfig {
708
+ columns?: number
709
+ thumbnailWidth?: number
710
+ thumbnailHeight?: number
711
+ interval?: number
712
+ format?: 'jpeg' | 'png' | 'webp'
713
+ quality?: number
714
+ }
715
+ /**
716
+ * Streaming quality level configuration
717
+ */
718
+ export declare interface StreamingQualityLevel {
719
+ label: string
720
+ width: number
721
+ height?: number
722
+ bitrate: number
723
+ audioBitrate?: number
724
+ }
725
+ /**
726
+ * Adaptive streaming configuration
727
+ */
728
+ export declare interface StreamingConfig {
729
+ format?: 'hls' | 'dash'
730
+ segmentDuration?: number
731
+ qualities?: StreamingQualityLevel[]
732
+ encryption?: {
733
+ enabled: boolean
734
+ keyUrl?: string
735
+ iv?: string
736
+ }
737
+ }
738
+ /**
739
+ * Video transcoding options
740
+ */
741
+ export declare interface TranscodeConfig {
742
+ codec?: VideoCodec
743
+ bitrate?: number
744
+ maxWidth?: number
745
+ maxHeight?: number
746
+ frameRate?: number
747
+ audioCodec?: AudioCodec
748
+ audioBitrate?: number
749
+ sampleRate?: number
750
+ channels?: number
751
+ twoPass?: boolean
752
+ speedPreset?: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow'
753
+ crf?: number
754
+ }
755
+ /**
756
+ * Waveform visualization configuration
757
+ */
758
+ export declare interface WaveformConfig {
759
+ width?: number
760
+ height?: number
761
+ color?: string
762
+ backgroundColor?: string
763
+ format?: 'png' | 'svg' | 'json'
764
+ samples?: number
765
+ }
766
+ /**
767
+ * ts-videos integration configuration
768
+ */
769
+ export declare interface TsVideosConfig {
770
+ enabled: boolean
771
+ outputDir: string
772
+ baseUrl?: string
773
+ defaultQuality?: VideoQualityPreset
774
+ streaming?: {
775
+ /** Enable streaming manifest generation */
776
+ enabled: boolean
777
+ /** Default format */
778
+ format?: 'hls' | 'dash'
779
+ /** Segment duration */
780
+ segmentDuration?: number
781
+ /** Default quality levels */
782
+ defaultQualities?: StreamingQualityLevel[]
783
+ }
784
+ thumbnails?: {
785
+ /** Enable thumbnail generation */
786
+ enabled: boolean
787
+ /** Number of thumbnails to generate */
788
+ count?: number
789
+ /** Interval between thumbnails in seconds */
790
+ interval?: number
791
+ /** Output format */
792
+ format?: 'jpeg' | 'png' | 'webp'
793
+ /** Thumbnail width */
794
+ width?: number
795
+ }
796
+ transcoding?: {
797
+ /** Default codec */
798
+ defaultCodec?: VideoCodec
799
+ /** Default audio codec */
800
+ defaultAudioCodec?: AudioCodec
801
+ /** Default speed preset */
802
+ speedPreset?: TranscodeConfig['speedPreset']
803
+ }
804
+ }
805
+ /**
806
+ * Enhanced video props with ts-videos integration
807
+ */
808
+ export declare interface EnhancedVideoProps extends VideoProps {
809
+ quality?: VideoQualityPreset
810
+ platform?: VideoPlatformPreset
811
+ process?: boolean
812
+ generatePoster?: boolean | PosterGenerationConfig
813
+ spriteSheet?: boolean | SpriteSheetConfig
814
+ streaming?: boolean | StreamingConfig
815
+ transcode?: TranscodeConfig
816
+ waveform?: boolean | WaveformConfig
817
+ onProcessProgress?: (progress: {
818
+ percentage: number
819
+ currentTime: number
820
+ duration: number
821
+ stage: 'analyzing' | 'transcoding' | 'generating-manifests' | 'complete'
822
+ }) => void
823
+ outputPattern?: string
824
+ skipProcessing?: boolean
825
+ title?: string
826
+ }
827
+ /**
828
+ * Result from generating a thumbnail
829
+ */
830
+ export declare interface ThumbnailResult {
831
+ path: string
832
+ url: string
833
+ width: number
834
+ height: number
835
+ timestamp: number
836
+ size: number
837
+ }
838
+ /**
839
+ * Result from generating HLS manifest
840
+ */
841
+ export declare interface HLSResult {
842
+ manifestUrl: string
843
+ manifestPath: string
844
+ playlists: Array<{
845
+ quality: StreamingQualityLevel
846
+ url: string
847
+ path: string
848
+ }>
849
+ segmentCount: number
850
+ duration: number
851
+ }
852
+ /**
853
+ * Result from generating DASH manifest
854
+ */
855
+ export declare interface DASHResult {
856
+ manifestUrl: string
857
+ manifestPath: string
858
+ adaptationSets: Array<{
859
+ type: 'video' | 'audio'
860
+ representations: Array<{
861
+ bandwidth: number
862
+ width?: number
863
+ height?: number
864
+ url: string
865
+ }>
866
+ }>
867
+ duration: number
868
+ }
869
+ /**
870
+ * Result from video transcoding
871
+ */
872
+ export declare interface TranscodeResult {
873
+ path: string
874
+ url: string
875
+ duration: number
876
+ size: number
877
+ video: {
878
+ codec: VideoCodec
879
+ width: number
880
+ height: number
881
+ bitrate: number
882
+ frameRate: number
883
+ }
884
+ audio?: {
885
+ codec: AudioCodec
886
+ bitrate: number
887
+ sampleRate: number
888
+ channels: number
889
+ }
890
+ }
891
+ /**
892
+ * Result from processing a video with ts-videos
893
+ */
894
+ export declare interface ProcessedVideoResult {
895
+ src: string
896
+ processed: boolean
897
+ transcoded?: TranscodeResult
898
+ poster?: ThumbnailResult
899
+ thumbnails?: ThumbnailResult[]
900
+ spriteSheet?: {
901
+ url: string
902
+ path: string
903
+ columns: number
904
+ rows: number
905
+ thumbnailWidth: number
906
+ thumbnailHeight: number
907
+ interval: number
908
+ totalFrames: number
909
+ }
910
+ streaming?: {
911
+ hls?: HLSResult
912
+ dash?: DASHResult
913
+ }
914
+ waveform?: {
915
+ url: string
916
+ path: string
917
+ data?: number[]
918
+ }
919
+ metadata?: {
920
+ duration: number
921
+ width: number
922
+ height: number
923
+ frameRate: number
924
+ bitrate: number
925
+ codec: string
926
+ audioCodec?: string
927
+ }
928
+ hash?: string
929
+ errors?: string[]
930
+ }
931
+ /**
932
+ * STX Media Module Types
933
+ *
934
+ * Comprehensive type definitions for responsive images, video,
935
+ * content protection, file upload, and media management.
936
+ *
937
+ * @module media/types
938
+ */
939
+ /**
940
+ * Placeholder generation strategies for lazy loading
941
+ */
942
+ export type PlaceholderStrategy = | 'blur' // Low-quality blurred image (LQIP)
943
+ | 'thumbhash' // Thumbhash-based placeholder
944
+ | 'blurhash' // Blurhash-based placeholder
945
+ | 'pixelate' // Pixelated low-res version
946
+ | 'dominant-color' // Solid dominant color
947
+ | 'none'
948
+ /**
949
+ * Supported image formats
950
+ */
951
+ export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png' | 'gif'
952
+ /**
953
+ * Image fit modes (similar to CSS object-fit)
954
+ */
955
+ export type ImageFit = 'clip' | 'crop' | 'fill' | 'max' | 'min' | 'scale' | 'cover' | 'contain'
956
+ /**
957
+ * Image crop positions
958
+ */
959
+ export type ImageCrop = | 'top'
960
+ | 'bottom'
961
+ | 'left'
962
+ | 'right'
963
+ | 'center'
964
+ | 'top-left'
965
+ | 'top-right'
966
+ | 'bottom-left'
967
+ | 'bottom-right'
968
+ | 'faces' // AI face detection
969
+ | 'entropy'
970
+ /**
971
+ * Video embed type
972
+ */
973
+ export type VideoEmbedType = 'video' | 'youtube' | 'vimeo' | 'dailymotion' | 'twitch'
974
+ /**
975
+ * Plyr.js control options
976
+ */
977
+ export type PlyrControl = | 'play-large'
978
+ | 'restart'
979
+ | 'rewind'
980
+ | 'play'
981
+ | 'fast-forward'
982
+ | 'progress'
983
+ | 'current-time'
984
+ | 'duration'
985
+ | 'mute'
986
+ | 'volume'
987
+ | 'captions'
988
+ | 'settings'
989
+ | 'pip'
990
+ | 'airplay'
991
+ | 'fullscreen'
992
+ /**
993
+ * Image optimization presets for ts-images
994
+ */
995
+ export type ImageOptimizationPreset = 'web' | 'quality' | 'performance'
996
+ /**
997
+ * Image transformation types supported by ts-images
998
+ */
999
+ export type ImageTransformation = | 'resize'
1000
+ | 'blur'
1001
+ | 'sharpen'
1002
+ | 'grayscale'
1003
+ | 'rotate'
1004
+ | 'flip'
1005
+ | 'flop'
1006
+ | 'brightness'
1007
+ | 'contrast'
1008
+ | 'saturation'
1009
+ /**
1010
+ * Watermark position options
1011
+ */
1012
+ export type WatermarkPosition = | 'center'
1013
+ | 'top'
1014
+ | 'bottom'
1015
+ | 'left'
1016
+ | 'right'
1017
+ | 'top-left'
1018
+ | 'top-right'
1019
+ | 'bottom-left'
1020
+ | 'bottom-right'
1021
+ /**
1022
+ * Video quality presets
1023
+ */
1024
+ export type VideoQualityPreset = | 'very-low'
1025
+ | 'low'
1026
+ | 'medium'
1027
+ | 'high'
1028
+ | 'very-high'
1029
+ | 'lossless'
1030
+ /**
1031
+ * Platform-specific video presets
1032
+ */
1033
+ export type VideoPlatformPreset = | 'youtube'
1034
+ | 'twitter'
1035
+ | 'instagram-feed'
1036
+ | 'instagram-story'
1037
+ | 'instagram-reels'
1038
+ | 'tiktok'
1039
+ | 'discord'
1040
+ | 'linkedin'
1041
+ | 'facebook'
1042
+ | 'web-progressive'
1043
+ | 'web-streaming'
1044
+ /**
1045
+ * Video codec options
1046
+ */
1047
+ export type VideoCodec = 'h264' | 'h265' | 'vp9' | 'av1'
1048
+ /**
1049
+ * Audio codec options
1050
+ */
1051
+ export type AudioCodec = 'aac' | 'opus' | 'mp3' | 'flac'