@stacksjs/stx 0.2.155 → 0.2.157

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 (241) hide show
  1. package/dist/a11y.d.ts +87 -46
  2. package/dist/animation.d.ts +96 -42
  3. package/dist/appearance-bootstrap.d.ts +49 -15
  4. package/dist/asset-roots.d.ts +32 -0
  5. package/dist/asset-roots.js +7 -0
  6. package/dist/assets.d.ts +9 -7
  7. package/dist/async-components.d.ts +78 -56
  8. package/dist/auth.d.ts +3 -0
  9. package/dist/build-externalize.d.ts +40 -0
  10. package/dist/build-externalize.js +63 -0
  11. package/dist/build-id.d.ts +22 -22
  12. package/dist/build-message.d.ts +73 -2
  13. package/dist/build-message.js +47 -8
  14. package/dist/builtins/attrs.d.ts +14 -0
  15. package/dist/builtins/drawer.d.ts +22 -0
  16. package/dist/builtins/icon.d.ts +16 -2
  17. package/dist/builtins/index.d.ts +5 -15
  18. package/dist/builtins/modal.d.ts +24 -0
  19. package/dist/builtins/safe-image.d.ts +42 -0
  20. package/dist/builtins/stx-image.d.ts +27 -0
  21. package/dist/builtins/stx-link.d.ts +9 -0
  22. package/dist/builtins/stx-loading-indicator.d.ts +11 -0
  23. package/dist/builtins/suspense.d.ts +28 -0
  24. package/dist/builtins/toast.d.ts +17 -0
  25. package/dist/builtins/transition-group.d.ts +25 -0
  26. package/dist/caching.d.ts +12 -15
  27. package/dist/cli.js +1798 -908
  28. package/dist/client/directive.d.ts +7 -0
  29. package/dist/client/index.d.ts +0 -1
  30. package/dist/client-script-bundler.d.ts +63 -5
  31. package/dist/client-script-bundler.js +30 -2
  32. package/dist/client-script.d.ts +102 -47
  33. package/dist/client-script.js +15 -3
  34. package/dist/codemod.d.ts +56 -0
  35. package/dist/codemod.js +192 -0
  36. package/dist/color-mode-boot.d.ts +83 -65
  37. package/dist/component-client-factories.d.ts +1 -6
  38. package/dist/component-processing.d.ts +58 -49
  39. package/dist/component-processing.js +1 -1
  40. package/dist/component-registry.d.ts +94 -31
  41. package/dist/component-renderer.d.ts +18 -0
  42. package/dist/composable-loader.d.ts +24 -0
  43. package/dist/composable-loader.js +12 -9
  44. package/dist/composables/index.d.ts +7 -0
  45. package/dist/composables/index.js +1 -0
  46. package/dist/composables/use-fetch.js +30 -2
  47. package/dist/composables/use-form.d.ts +91 -0
  48. package/dist/composables/use-form.js +112 -0
  49. package/dist/composables.d.ts +64 -60
  50. package/dist/computed.d.ts +86 -92
  51. package/dist/conditionals.d.ts +24 -8
  52. package/dist/conditionals.js +16 -0
  53. package/dist/config.d.ts +34 -21
  54. package/dist/config.js +35 -14
  55. package/dist/craft.js +1476 -768
  56. package/dist/crosswind-config.d.ts +58 -0
  57. package/dist/crosswind-config.js +40 -0
  58. package/dist/csp.d.ts +107 -41
  59. package/dist/defer.d.ts +24 -0
  60. package/dist/dev-server/crosswind.d.ts +35 -26
  61. package/dist/dev-server/crosswind.js +2 -18
  62. package/dist/dev-server/serve-app.js +4 -3
  63. package/dist/dev-server/terminal-colors.d.ts +32 -32
  64. package/dist/directive-api.d.ts +86 -43
  65. package/dist/document-shell.d.ts +54 -41
  66. package/dist/dynamic-components.d.ts +9 -0
  67. package/dist/error-boundaries.d.ts +47 -41
  68. package/dist/error-handling.d.ts +1 -1
  69. package/dist/errors/codes.d.ts +51 -43
  70. package/dist/errors/formatter.d.ts +58 -38
  71. package/dist/errors/index.d.ts +5 -61
  72. package/dist/errors/logger.d.ts +114 -40
  73. package/dist/errors/sanitizer.d.ts +53 -23
  74. package/dist/errors/types.d.ts +44 -31
  75. package/dist/events.d.ts +86 -25
  76. package/dist/expressions.d.ts +50 -42
  77. package/dist/forms-validation.d.ts +138 -123
  78. package/dist/forms-validation.js +1 -90
  79. package/dist/forms.d.ts +120 -66
  80. package/dist/forms.js +31 -11
  81. package/dist/fragment-container.d.ts +57 -0
  82. package/dist/fragment-container.js +109 -0
  83. package/dist/framework-composables.d.ts +32 -0
  84. package/dist/head.d.ts +156 -114
  85. package/dist/heatmap.d.ts +152 -72
  86. package/dist/html-masking.d.ts +40 -34
  87. package/dist/hydration-runtime.d.ts +20 -24
  88. package/dist/i18n.d.ts +93 -32
  89. package/dist/image-optimization/auto-sibling.d.ts +32 -4
  90. package/dist/includes.d.ts +69 -7
  91. package/dist/index.d.ts +66 -0
  92. package/dist/index.js +23 -0
  93. package/dist/internal-markdown.d.ts +12 -8
  94. package/dist/island-chunking.d.ts +30 -13
  95. package/dist/keep-alive.d.ts +72 -52
  96. package/dist/layout-types.d.ts +45 -0
  97. package/dist/layout-types.js +56 -0
  98. package/dist/lazy-module.d.ts +10 -0
  99. package/dist/loops.d.ts +66 -0
  100. package/dist/loops.js +47 -6
  101. package/dist/markdown.d.ts +0 -1
  102. package/dist/media/image/component.d.ts +25 -9
  103. package/dist/media/image/directive.d.ts +15 -1
  104. package/dist/media/image/placeholder.d.ts +20 -9
  105. package/dist/media/image/processor/cache.d.ts +40 -18
  106. package/dist/media/image/processor/index.d.ts +1 -10
  107. package/dist/media/image/processor/optimizer.d.ts +12 -1
  108. package/dist/media/image/processor/responsive.d.ts +16 -6
  109. package/dist/media/image/srcset.d.ts +47 -50
  110. package/dist/media/shared/cache.d.ts +51 -31
  111. package/dist/media/shared/hash.d.ts +7 -0
  112. package/dist/media/types.d.ts +1235 -754
  113. package/dist/media/video/directive.d.ts +15 -1
  114. package/dist/media/video/index.d.ts +39 -17
  115. package/dist/media/video/processor/cache.d.ts +42 -19
  116. package/dist/media/video/processor/index.d.ts +1 -18
  117. package/dist/media/video/processor/streaming.d.ts +17 -10
  118. package/dist/media/video/processor/thumbnail.d.ts +21 -15
  119. package/dist/media/video/processor/transcoder.d.ts +11 -1
  120. package/dist/method-spoofing.d.ts +7 -0
  121. package/dist/middleware.d.ts +60 -0
  122. package/dist/owned-routes.d.ts +42 -0
  123. package/dist/owned-routes.js +26 -0
  124. package/dist/page-meta.d.ts +38 -0
  125. package/dist/page-meta.js +16 -0
  126. package/dist/parser/directive-parser.d.ts +57 -45
  127. package/dist/parser/expression-parser.d.ts +33 -35
  128. package/dist/parser/index.d.ts +4 -39
  129. package/dist/parser/tokenizer.d.ts +61 -49
  130. package/dist/partial-hydration.d.ts +82 -50
  131. package/dist/performance-utils.d.ts +217 -124
  132. package/dist/placeholder.d.ts +18 -9
  133. package/dist/plugin-system.d.ts +264 -115
  134. package/dist/process.d.ts +11 -6
  135. package/dist/process.js +21 -4
  136. package/dist/production-builder.js +7 -0
  137. package/dist/prop-sentinels.d.ts +11 -11
  138. package/dist/public-env.d.ts +14 -0
  139. package/dist/pwa/directives.d.ts +12 -3
  140. package/dist/pwa/inject.d.ts +10 -0
  141. package/dist/pwa/precache.d.ts +22 -16
  142. package/dist/pwa/service-worker.d.ts +12 -0
  143. package/dist/pwa.js +1318 -610
  144. package/dist/reactive-bindings.d.ts +34 -11
  145. package/dist/reactive.d.ts +58 -30
  146. package/dist/reactive.js +56 -31
  147. package/dist/render.d.ts +0 -14
  148. package/dist/render.js +17 -0
  149. package/dist/route-middleware.d.ts +2 -35
  150. package/dist/route-types.d.ts +134 -0
  151. package/dist/route-types.js +24 -0
  152. package/dist/router.d.ts +5 -7
  153. package/dist/routes.d.ts +1 -3
  154. package/dist/runtime-globals.d.ts +147 -24
  155. package/dist/runtime-globals.js +16 -1
  156. package/dist/runtime-injection.d.ts +8 -0
  157. package/dist/runtime-injection.js +33 -24
  158. package/dist/script-emit.d.ts +30 -0
  159. package/dist/script-json.d.ts +36 -0
  160. package/dist/script-json.js +6 -0
  161. package/dist/script-validation.d.ts +21 -4
  162. package/dist/seo.d.ts +118 -47
  163. package/dist/server-bindings.d.ts +21 -0
  164. package/dist/sfc-template.d.ts +8 -8
  165. package/dist/signal-processing.d.ts +35 -15
  166. package/dist/signals-api.d.ts +117 -58
  167. package/dist/signals-api.js +7 -4
  168. package/dist/signals.d.ts +24 -17
  169. package/dist/signals.js +765 -60
  170. package/dist/site-builder/build.js +8 -0
  171. package/dist/site-url.d.ts +46 -0
  172. package/dist/site-url.js +70 -0
  173. package/dist/slots.d.ts +86 -20
  174. package/dist/source-signature.d.ts +45 -0
  175. package/dist/source-signature.js +20 -0
  176. package/dist/ssg.d.ts +285 -142
  177. package/dist/ssg.js +1268 -556
  178. package/dist/state-dir.d.ts +4 -4
  179. package/dist/state-management.d.ts +0 -12
  180. package/dist/state-management.js +8 -25
  181. package/dist/store-imports.d.ts +23 -0
  182. package/dist/store-imports.js +3 -0
  183. package/dist/store-loader.d.ts +10 -0
  184. package/dist/store-loader.js +10 -9
  185. package/dist/story/analytics.d.ts +138 -60
  186. package/dist/story/bookmarks.d.ts +87 -34
  187. package/dist/story/cli.d.ts +123 -69
  188. package/dist/story/collect/scanner.d.ts +4 -0
  189. package/dist/story/collect/tree.d.ts +8 -1
  190. package/dist/story/commands/build.d.ts +11 -6
  191. package/dist/story/commands/dev.d.ts +15 -8
  192. package/dist/story/commands/preview.d.ts +13 -7
  193. package/dist/story/config-watcher.d.ts +20 -13
  194. package/dist/story/config.d.ts +11 -8
  195. package/dist/story/context.d.ts +14 -8
  196. package/dist/story/hmr.d.ts +24 -26
  197. package/dist/story/hot-swap.d.ts +34 -23
  198. package/dist/story/keyboard-shortcuts.d.ts +23 -18
  199. package/dist/story/output.d.ts +46 -44
  200. package/dist/story/performance.d.ts +107 -45
  201. package/dist/story/presets.d.ts +107 -41
  202. package/dist/story/renderer.d.ts +41 -27
  203. package/dist/story/search.d.ts +23 -12
  204. package/dist/story/server.d.ts +21 -11
  205. package/dist/story/setup.d.ts +23 -15
  206. package/dist/story/testing.d.ts +65 -40
  207. package/dist/story/types.d.ts +262 -160
  208. package/dist/streaming.d.ts +119 -57
  209. package/dist/stx-virtual-ts.d.ts +165 -0
  210. package/dist/stx-virtual-ts.js +372 -0
  211. package/dist/stx.d.ts +78 -1
  212. package/dist/style-scoping.d.ts +17 -4
  213. package/dist/suspense.d.ts +67 -52
  214. package/dist/teleport.d.ts +22 -0
  215. package/dist/template-tag-balance.d.ts +22 -6
  216. package/dist/transitions.d.ts +66 -55
  217. package/dist/typecheck.d.ts +77 -0
  218. package/dist/typecheck.js +156 -0
  219. package/dist/types/component-types.d.ts +187 -122
  220. package/dist/types/config-types.d.ts +758 -297
  221. package/dist/types/context-types.d.ts +46 -24
  222. package/dist/types/csp-types.d.ts +70 -66
  223. package/dist/types/directive-types.d.ts +211 -155
  224. package/dist/types/index.d.ts +6 -109
  225. package/dist/types/pwa-types.d.ts +273 -148
  226. package/dist/types.d.ts +0 -1
  227. package/dist/typescript-templates.d.ts +11 -0
  228. package/dist/unresolved-identifiers.d.ts +24 -22
  229. package/dist/unresolved-identifiers.js +2 -0
  230. package/dist/utils.d.ts +24 -21
  231. package/dist/validator.d.ts +28 -26
  232. package/dist/variable-extractor.d.ts +48 -13
  233. package/dist/variable-extractor.js +27 -4
  234. package/dist/view-composers.d.ts +80 -81
  235. package/dist/virtual-scrolling.d.ts +101 -81
  236. package/dist/vue-template.d.ts +23 -0
  237. package/dist/web-components/css-scoping.d.ts +21 -11
  238. package/dist/web-components.d.ts +81 -58
  239. package/dist/x-element.d.ts +0 -1
  240. package/package.json +5 -5
  241. package/stx.d.ts +78 -1
@@ -1,996 +1,1477 @@
1
+ /**
2
+ * STX Media Module Types
3
+ *
4
+ * Comprehensive type definitions for responsive images, video,
5
+ * content protection, file upload, and media management.
6
+ *
7
+ * @module media/types
8
+ */
9
+ /**
10
+ * Placeholder generation strategies for lazy loading
11
+ */
12
+ export type PlaceholderStrategy = 'blur' | 'thumbhash' | 'blurhash' | 'pixelate' | 'dominant-color' | 'none';
1
13
  /**
2
14
  * Options for placeholder generation
3
15
  */
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
16
+ export interface PlaceholderOptions {
17
+ /** Strategy for generating placeholder */
18
+ strategy: PlaceholderStrategy;
19
+ /** Width of placeholder image (default: 20) */
20
+ width?: number;
21
+ /** Height of placeholder image */
22
+ height?: number;
23
+ /** Quality for blur strategy (1-100) */
24
+ quality?: number;
25
+ /** Blur level for blur strategy (0-100) */
26
+ blurLevel?: number;
27
+ /** CSS transition duration in ms */
28
+ transitionDuration?: number;
29
+ /** CSS transition easing function */
30
+ easing?: string;
12
31
  }
13
32
  /**
14
33
  * Result from placeholder generation
15
34
  */
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
35
+ export interface PlaceholderResult {
36
+ /** Base64 data URL for the placeholder */
37
+ dataURL: string;
38
+ /** Placeholder width */
39
+ width: number;
40
+ /** Placeholder height */
41
+ height: number;
42
+ /** Original image aspect ratio */
43
+ aspectRatio: number;
44
+ /** Original image width */
45
+ originalWidth: number;
46
+ /** Original image height */
47
+ originalHeight: number;
48
+ /** Strategy used */
49
+ strategy: PlaceholderStrategy;
50
+ /** Dominant color (for dominant-color strategy) */
51
+ dominantColor?: string;
52
+ /** Optional CSS for the placeholder */
53
+ css?: string;
26
54
  }
55
+ /**
56
+ * Supported image formats
57
+ */
58
+ export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png' | 'gif';
59
+ /**
60
+ * Image fit modes (similar to CSS object-fit)
61
+ */
62
+ export type ImageFit = 'clip' | 'crop' | 'fill' | 'max' | 'min' | 'scale' | 'cover' | 'contain';
63
+ /**
64
+ * Image crop positions
65
+ */
66
+ export type ImageCrop = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'faces' | 'entropy';
27
67
  /**
28
68
  * imgix-style image transformation parameters
29
69
  */
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
70
+ export interface ImageParams {
71
+ /** Width in pixels */
72
+ w?: number;
73
+ /** Height in pixels */
74
+ h?: number;
75
+ /** Fit mode */
76
+ fit?: ImageFit;
77
+ /** Crop position */
78
+ crop?: ImageCrop;
79
+ /** Aspect ratio (e.g., "16:9") */
80
+ ar?: string;
81
+ /** Output format */
82
+ fm?: ImageFormat;
83
+ /** Quality (1-100) */
84
+ q?: number;
85
+ /** Lossless compression */
86
+ lossless?: boolean;
87
+ /** Progressive rendering */
88
+ progressive?: boolean;
89
+ /** Blur radius (0-2000) */
90
+ blur?: number;
91
+ /** Sharpen amount (0-100) */
92
+ sharp?: number;
93
+ /** Brightness (-100 to 100) */
94
+ bri?: number;
95
+ /** Contrast (-100 to 100) */
96
+ con?: number;
97
+ /** Saturation (-100 to 100) */
98
+ sat?: number;
99
+ /** Hue rotation (0-360) */
100
+ hue?: number;
101
+ /** Exposure (-100 to 100) */
102
+ exp?: number;
103
+ /** Vibrance (-100 to 100) */
104
+ vib?: number;
105
+ /** Highlight (-100 to 100) */
106
+ high?: number;
107
+ /** Shadow (-100 to 100) */
108
+ shad?: number;
109
+ /** Gamma (0.1 to 10) */
110
+ gam?: number;
111
+ /** Rotation degrees (0-359) */
112
+ rot?: number;
113
+ /** Flip: h (horizontal), v (vertical), hv (both) */
114
+ flip?: 'h' | 'v' | 'hv';
115
+ /** Orientation (auto-rotate based on EXIF) */
116
+ orient?: number;
117
+ /** Watermark image URL */
118
+ mark?: string;
119
+ /** Watermark X position */
120
+ markx?: number;
121
+ /** Watermark Y position */
122
+ marky?: number;
123
+ /** Watermark opacity (0-1) */
124
+ markalpha?: number;
125
+ /** Watermark scale (0-1) */
126
+ markscale?: number;
127
+ /** Watermark alignment */
128
+ markalign?: 'top' | 'middle' | 'bottom' | 'left' | 'center' | 'right';
129
+ /** Apply sepia tone (0-100) */
130
+ sepia?: number;
131
+ /** Apply pixelate effect (1-100) */
132
+ px?: number;
133
+ /** Monochrome with tint color */
134
+ mono?: string;
135
+ /** Duotone colors (highlight,shadow) */
136
+ duotone?: string;
137
+ /** Invert colors */
138
+ invert?: boolean;
139
+ /** Auto-enhance: format, compress, enhance */
140
+ auto?: string | string[];
141
+ /** Device pixel ratio (1-5) */
142
+ dpr?: number;
67
143
  }
68
144
  /**
69
145
  * Image variant generated at a specific size/format
70
146
  */
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
147
+ export interface ImageVariant {
148
+ /** Output file path */
149
+ path: string;
150
+ /** URL for srcset */
151
+ url: string;
152
+ /** Width in pixels */
153
+ width: number;
154
+ /** Height in pixels */
155
+ height: number;
156
+ /** Output format */
157
+ format: ImageFormat;
158
+ /** File size in bytes */
159
+ size: number;
160
+ /** Device pixel ratio (for DPR-based srcsets) */
161
+ dpr?: number;
79
162
  }
80
163
  /**
81
164
  * Processed image with all variants
82
165
  */
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
166
+ export interface ProcessedImage {
167
+ /** Original source path */
168
+ src: string;
169
+ /** Generated variants */
170
+ variants: ImageVariant[];
171
+ /** Placeholder data */
172
+ placeholder?: PlaceholderResult;
173
+ /** Original width */
174
+ width: number;
175
+ /** Original height */
176
+ height: number;
177
+ /** Aspect ratio */
178
+ aspectRatio: number;
179
+ /** Content hash for caching */
180
+ hash: string;
91
181
  }
92
182
  /**
93
183
  * <Img> component props
94
184
  */
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
185
+ export interface ImgProps {
186
+ /** Image source URL or path */
187
+ src: string;
188
+ /** Alternative text (required for accessibility) */
189
+ alt: string;
190
+ /** Display width */
191
+ width?: number | string;
192
+ /** Display height */
193
+ height?: number | string;
194
+ /** Responsive sizes attribute */
195
+ sizes?: string;
196
+ /** Custom breakpoint widths for srcset */
197
+ widths?: number[];
198
+ /** Device pixel ratios for fixed-width images */
199
+ dpr?: number[];
200
+ /** Output formats (default: ['avif', 'webp', 'jpeg']) */
201
+ formats?: ImageFormat[];
202
+ /** Output quality (1-100) */
203
+ quality?: number;
204
+ /** imgix-style transformation params */
205
+ params?: ImageParams;
206
+ /** Placeholder strategy */
207
+ placeholder?: PlaceholderStrategy;
208
+ /** Placeholder options */
209
+ placeholderOptions?: Partial<PlaceholderOptions>;
210
+ /** Enable lazy loading (default: true) */
211
+ lazy?: boolean;
212
+ /** High priority (preload, fetchpriority=high) */
213
+ priority?: boolean;
214
+ /** Loading attribute */
215
+ loading?: 'lazy' | 'eager';
216
+ /** Decoding hint */
217
+ decoding?: 'sync' | 'async' | 'auto';
218
+ /** Fetch priority */
219
+ fetchpriority?: 'high' | 'low' | 'auto';
220
+ /** Object fit */
221
+ objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
222
+ /** Object position */
223
+ objectPosition?: string;
224
+ /** CSS class */
225
+ class?: string;
226
+ /** Inline styles */
227
+ style?: string;
228
+ /** ID attribute */
229
+ id?: string;
230
+ /** Data attributes */
231
+ data?: Record<string, string>;
232
+ /** Cross-origin setting */
233
+ crossorigin?: 'anonymous' | 'use-credentials';
234
+ /** Referrer policy */
235
+ referrerpolicy?: string;
121
236
  }
122
237
  /**
123
238
  * @img directive options
124
239
  */
125
- export declare interface ImgDirectiveOptions extends Omit<ImgProps, 'src' | 'alt'> {
126
- srcset?: string
240
+ export interface ImgDirectiveOptions extends Omit<ImgProps, 'src' | 'alt'> {
241
+ /** Custom srcset string (overrides auto-generation) */
242
+ srcset?: string;
127
243
  }
128
244
  /**
129
245
  * Image render context
130
246
  */
131
- export declare interface ImageRenderContext {
132
- processedImage?: ProcessedImage
133
- optimize?: boolean
134
- isDev?: boolean
135
- baseUrl?: string
136
- outputDir?: string
247
+ export interface ImageRenderContext {
248
+ /** Pre-processed image data */
249
+ processedImage?: ProcessedImage;
250
+ /** Whether optimization is enabled */
251
+ optimize?: boolean;
252
+ /** Development mode flag */
253
+ isDev?: boolean;
254
+ /** Base URL for generated images */
255
+ baseUrl?: string;
256
+ /** Output directory */
257
+ outputDir?: string;
137
258
  }
138
259
  /**
139
260
  * Image render result
140
261
  */
141
- export declare interface ImageRenderResult {
142
- html: string
143
- preloadLink?: string
144
- css?: string
145
- script?: string
262
+ export interface ImageRenderResult {
263
+ /** Generated HTML */
264
+ html: string;
265
+ /** Preload link tag (for priority images) */
266
+ preloadLink?: string;
267
+ /** CSS for placeholder */
268
+ css?: string;
269
+ /** Client-side script */
270
+ script?: string;
146
271
  }
147
272
  /**
148
273
  * Video source definition
149
274
  */
150
- export declare interface VideoSource {
151
- src: string
152
- type: string
153
- media?: string
154
- codecs?: string
275
+ export interface VideoSource {
276
+ /** Video URL */
277
+ src: string;
278
+ /** MIME type (e.g., 'video/mp4') */
279
+ type: string;
280
+ /** Media query for adaptive sources */
281
+ media?: string;
282
+ /** Codec specification */
283
+ codecs?: string;
155
284
  }
285
+ /**
286
+ * Video embed type
287
+ */
288
+ export type VideoEmbedType = 'video' | 'youtube' | 'vimeo' | 'dailymotion' | 'twitch';
289
+ /**
290
+ * Plyr.js control options
291
+ */
292
+ export type PlyrControl = 'play-large' | 'restart' | 'rewind' | 'play' | 'fast-forward' | 'progress' | 'current-time' | 'duration' | 'mute' | 'volume' | 'captions' | 'settings' | 'pip' | 'airplay' | 'fullscreen';
156
293
  /**
157
294
  * Plyr.js configuration options
158
295
  */
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>
296
+ export interface PlyrOptions {
297
+ /** Enable/disable controls */
298
+ controls?: PlyrControl[] | boolean;
299
+ /** Autoplay on load */
300
+ autoplay?: boolean;
301
+ /** Mute by default */
302
+ muted?: boolean;
303
+ /** Loop playback */
304
+ loop?: {
305
+ active: boolean;
306
+ };
307
+ /** Seek time in seconds */
308
+ seekTime?: number;
309
+ /** Volume (0-1) */
310
+ volume?: number;
311
+ /** Click to play/pause */
312
+ clickToPlay?: boolean;
313
+ /** Hide controls timeout (ms) */
314
+ hideControls?: number;
315
+ /** Reset to start when playback ends */
316
+ resetOnEnd?: boolean;
317
+ /** Disable context menu */
318
+ disableContextMenu?: boolean;
319
+ /** Keyboard shortcuts */
320
+ keyboard?: {
321
+ focused: boolean;
322
+ global: boolean;
323
+ };
324
+ /** Tooltips */
325
+ tooltips?: {
326
+ controls: boolean;
327
+ seek: boolean;
328
+ };
329
+ /** Quality selector options */
330
+ quality?: {
331
+ default: number;
332
+ options: number[];
333
+ forced: boolean;
334
+ };
335
+ /** Captions settings */
336
+ captions?: {
337
+ active: boolean;
338
+ language: string;
339
+ update: boolean;
340
+ };
341
+ /** Storage settings */
342
+ storage?: {
343
+ enabled: boolean;
344
+ key: string;
345
+ };
346
+ /** Speed settings */
347
+ speed?: {
348
+ selected: number;
349
+ options: number[];
350
+ };
351
+ /** Ratio for responsive sizing */
352
+ ratio?: string;
353
+ /** Full screen settings */
354
+ fullscreen?: {
355
+ enabled: boolean;
356
+ fallback: boolean;
357
+ iosNative: boolean;
358
+ };
359
+ /** Preview thumbnails */
360
+ previewThumbnails?: {
361
+ enabled: boolean;
362
+ src: string;
363
+ };
364
+ /** i18n strings */
365
+ i18n?: Record<string, string>;
180
366
  }
181
367
  /**
182
368
  * <Video> component props
183
369
  */
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
370
+ export interface VideoProps {
371
+ /** Video source URL */
372
+ src?: string;
373
+ /** Multiple video sources */
374
+ sources?: VideoSource[];
375
+ /** Poster image URL */
376
+ poster?: string;
377
+ /** Placeholder for poster image */
378
+ posterPlaceholder?: PlaceholderStrategy;
379
+ /** Show controls */
380
+ controls?: boolean;
381
+ /** Autoplay on load */
382
+ autoplay?: boolean;
383
+ /** Mute audio */
384
+ muted?: boolean;
385
+ /** Loop playback */
386
+ loop?: boolean;
387
+ /** Preload behavior */
388
+ preload?: 'none' | 'metadata' | 'auto';
389
+ /** Inline playback (iOS) */
390
+ playsinline?: boolean;
391
+ /** Enable lazy loading */
392
+ lazy?: boolean;
393
+ /** Video player type */
394
+ player?: 'native' | 'plyr' | 'ts-video';
395
+ /** Video title for accessibility and metadata */
396
+ title?: string;
397
+ /** Plyr.js options */
398
+ plyrOptions?: PlyrOptions;
399
+ /** Embed type */
400
+ type?: VideoEmbedType;
401
+ /** Width */
402
+ width?: number | string;
403
+ /** Height */
404
+ height?: number | string;
405
+ /** CSS class */
406
+ class?: string;
407
+ /** Inline styles */
408
+ style?: string;
409
+ /** ID attribute */
410
+ id?: string;
411
+ /** Cross-origin setting */
412
+ crossorigin?: 'anonymous' | 'use-credentials';
413
+ /** Disable picture-in-picture */
414
+ disablePictureInPicture?: boolean;
415
+ /** Disable remote playback */
416
+ disableRemotePlayback?: boolean;
208
417
  }
209
418
  /**
210
419
  * @video directive options
211
420
  */
212
- export declare interface VideoDirectiveOptions extends Omit<VideoProps, 'src'> {}
421
+ export interface VideoDirectiveOptions extends Omit<VideoProps, 'src'> {
422
+ }
213
423
  /**
214
424
  * Video render result
215
425
  */
216
- export declare interface VideoRenderResult {
217
- html: string
218
- script?: string
219
- css?: string
426
+ export interface VideoRenderResult {
427
+ /** Generated HTML */
428
+ html: string;
429
+ /** Script tags for player initialization */
430
+ script?: string;
431
+ /** CSS styles */
432
+ css?: string;
220
433
  }
221
434
  /**
222
435
  * File validation result
223
436
  */
224
- export declare interface FileValidationResult {
225
- valid: boolean
226
- error?: string
227
- code?: 'INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL' | 'INVALID_DIMENSIONS'
437
+ export interface FileValidationResult {
438
+ /** Whether the file is valid */
439
+ valid: boolean;
440
+ /** Error message if invalid */
441
+ error?: string;
442
+ /** Validation error code */
443
+ code?: 'INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL' | 'INVALID_DIMENSIONS';
228
444
  }
229
445
  /**
230
446
  * Upload progress information
231
447
  */
232
- export declare interface UploadProgress {
233
- file: File
234
- loaded: number
235
- total: number
236
- percent: number
237
- speed?: number
238
- timeRemaining?: number
448
+ export interface UploadProgress {
449
+ /** File being uploaded */
450
+ file: File;
451
+ /** Bytes loaded */
452
+ loaded: number;
453
+ /** Total bytes */
454
+ total: number;
455
+ /** Percentage complete (0-100) */
456
+ percent: number;
457
+ /** Upload speed in bytes/sec */
458
+ speed?: number;
459
+ /** Estimated time remaining in ms */
460
+ timeRemaining?: number;
239
461
  }
240
462
  /**
241
463
  * Upload result
242
464
  */
243
- export declare interface UploadResult {
244
- success: boolean
245
- url?: string
246
- id?: string
247
- name?: string
248
- size?: number
249
- type?: string
250
- error?: string
251
- errorCode?: string
252
- data?: Record<string, unknown>
465
+ export interface UploadResult {
466
+ /** Whether upload succeeded */
467
+ success: boolean;
468
+ /** Uploaded file URL */
469
+ url?: string;
470
+ /** File ID from server */
471
+ id?: string;
472
+ /** File name */
473
+ name?: string;
474
+ /** File size */
475
+ size?: number;
476
+ /** MIME type */
477
+ type?: string;
478
+ /** Error message if failed */
479
+ error?: string;
480
+ /** Error code */
481
+ errorCode?: string;
482
+ /** Server response data */
483
+ data?: Record<string, unknown>;
253
484
  }
254
485
  /**
255
486
  * Upload configuration
256
487
  */
257
- export declare interface UploadConfig {
258
- endpoint: string
259
- method?: 'POST' | 'PUT' | 'PATCH'
260
- headers?: Record<string, string>
261
- fieldName?: string
262
- maxSize?: number
263
- minSize?: number
264
- maxFiles?: number
265
- accept?: string[]
266
- chunkSize?: number
267
- retries?: number
268
- timeout?: number
269
- withCredentials?: boolean
270
- formData?: Record<string, string>
271
- validateDimensions?: {
272
- minWidth?: number
273
- maxWidth?: number
274
- minHeight?: number
275
- maxHeight?: number
276
- }
488
+ export interface UploadConfig {
489
+ /** Upload endpoint URL */
490
+ endpoint: string;
491
+ /** HTTP method (default: POST) */
492
+ method?: 'POST' | 'PUT' | 'PATCH';
493
+ /** Request headers */
494
+ headers?: Record<string, string>;
495
+ /** Form field name (default: 'file') */
496
+ fieldName?: string;
497
+ /** Maximum file size in bytes */
498
+ maxSize?: number;
499
+ /** Minimum file size in bytes */
500
+ minSize?: number;
501
+ /** Maximum number of files */
502
+ maxFiles?: number;
503
+ /** Accepted MIME types */
504
+ accept?: string[];
505
+ /** Chunk size for chunked uploads (bytes) */
506
+ chunkSize?: number;
507
+ /** Number of retry attempts */
508
+ retries?: number;
509
+ /** Timeout in ms */
510
+ timeout?: number;
511
+ /** With credentials (cookies) */
512
+ withCredentials?: boolean;
513
+ /** Additional form data */
514
+ formData?: Record<string, string>;
515
+ /** Validate image dimensions */
516
+ validateDimensions?: {
517
+ minWidth?: number;
518
+ maxWidth?: number;
519
+ minHeight?: number;
520
+ maxHeight?: number;
521
+ };
277
522
  }
278
523
  /**
279
524
  * <MediaUpload> component props
280
525
  */
281
- export declare interface MediaUploadProps extends UploadConfig {
282
- preview?: boolean
283
- dropzone?: boolean
284
- multiple?: boolean
285
- autoUpload?: boolean
286
- showProgress?: boolean
287
- disabled?: boolean
288
- class?: string
289
- style?: string
290
- id?: string
291
- placeholder?: string
292
- label?: string
526
+ export interface MediaUploadProps extends UploadConfig {
527
+ /** Show file preview */
528
+ preview?: boolean;
529
+ /** Enable drag and drop */
530
+ dropzone?: boolean;
531
+ /** Multiple file selection */
532
+ multiple?: boolean;
533
+ /** Auto-upload on file selection */
534
+ autoUpload?: boolean;
535
+ /** Show progress bar */
536
+ showProgress?: boolean;
537
+ /** Disabled state */
538
+ disabled?: boolean;
539
+ /** CSS class */
540
+ class?: string;
541
+ /** Inline styles */
542
+ style?: string;
543
+ /** ID attribute */
544
+ id?: string;
545
+ /** Placeholder text */
546
+ placeholder?: string;
547
+ /** Label text */
548
+ label?: string;
293
549
  }
294
550
  /**
295
551
  * @upload directive options
296
552
  */
297
- export declare interface UploadDirectiveOptions extends Omit<MediaUploadProps, 'endpoint'> {
298
- onProgress?: string
299
- onComplete?: string
300
- onError?: string
553
+ export interface UploadDirectiveOptions extends Omit<MediaUploadProps, 'endpoint'> {
554
+ /** Progress callback variable name */
555
+ onProgress?: string;
556
+ /** Complete callback variable name */
557
+ onComplete?: string;
558
+ /** Error callback variable name */
559
+ onError?: string;
301
560
  }
302
561
  /**
303
562
  * Signed URL result
304
563
  */
305
- export declare interface SignedUrl {
306
- url: string
307
- signature: string
308
- expires: number
309
- oneTimeUse?: boolean
564
+ export interface SignedUrl {
565
+ /** Signed URL */
566
+ url: string;
567
+ /** Signature token */
568
+ signature: string;
569
+ /** Expiration timestamp (ms) */
570
+ expires: number;
571
+ /** Whether URL is one-time use */
572
+ oneTimeUse?: boolean;
310
573
  }
311
574
  /**
312
575
  * Signature request configuration
313
576
  */
314
- export declare interface SignatureConfig {
315
- endpoint: string
316
- method?: 'GET' | 'POST'
317
- headers?: Record<string, string>
318
- expirationSeconds?: number
319
- oneTimeUse?: boolean
320
- params?: Record<string, unknown>
577
+ export interface SignatureConfig {
578
+ /** Signature endpoint URL */
579
+ endpoint: string;
580
+ /** HTTP method (default: POST) */
581
+ method?: 'GET' | 'POST';
582
+ /** Request headers */
583
+ headers?: Record<string, string>;
584
+ /** Expiration time in seconds */
585
+ expirationSeconds?: number;
586
+ /** Generate one-time use URL */
587
+ oneTimeUse?: boolean;
588
+ /** Custom parameters to include */
589
+ params?: Record<string, unknown>;
321
590
  }
322
591
  /**
323
592
  * Batch signature request
324
593
  */
325
- export declare interface BatchSignatureRequest {
326
- sources: string[]
327
- config: SignatureConfig
594
+ export interface BatchSignatureRequest {
595
+ /** Array of source URLs to sign */
596
+ sources: string[];
597
+ /** Signature configuration */
598
+ config: SignatureConfig;
328
599
  }
329
600
  /**
330
601
  * Batch signature result
331
602
  */
332
- export declare interface BatchSignatureResult {
333
- signatures: Map<string, SignedUrl>
334
- errors: Map<string, string>
603
+ export interface BatchSignatureResult {
604
+ /** Map of source URL to signed URL */
605
+ signatures: Map<string, SignedUrl>;
606
+ /** Sources that failed to sign */
607
+ errors: Map<string, string>;
335
608
  }
336
609
  /**
337
610
  * Protected media authentication context
338
611
  */
339
- export declare interface ProtectedAuthContext {
340
- role?: string
341
- permission?: string
342
- userId?: string
343
- check?: () => boolean | Promise<boolean>
612
+ export interface ProtectedAuthContext {
613
+ /** Required role */
614
+ role?: string;
615
+ /** Required permission */
616
+ permission?: string;
617
+ /** User ID (for ownership check) */
618
+ userId?: string;
619
+ /** Custom auth function */
620
+ check?: () => boolean | Promise<boolean>;
344
621
  }
345
622
  /**
346
623
  * <ProtectedImg> component props
347
624
  */
348
- export declare interface ProtectedMediaProps {
349
- src: string
350
- alt?: string
351
- signatureEndpoint?: string
352
- signatureConfig?: Partial<SignatureConfig>
353
- auth?: ProtectedAuthContext
354
- fallback?: string
355
- oneTimeUse?: boolean
356
- class?: string
357
- style?: string
625
+ export interface ProtectedMediaProps {
626
+ /** Source URL (to be signed) */
627
+ src: string;
628
+ /** Alternative text */
629
+ alt?: string;
630
+ /** Signature endpoint */
631
+ signatureEndpoint?: string;
632
+ /** Signature configuration */
633
+ signatureConfig?: Partial<SignatureConfig>;
634
+ /** Authentication context */
635
+ auth?: ProtectedAuthContext;
636
+ /** Fallback image if unauthorized */
637
+ fallback?: string;
638
+ /** One-time use URL */
639
+ oneTimeUse?: boolean;
640
+ /** CSS class */
641
+ class?: string;
642
+ /** Inline styles */
643
+ style?: string;
358
644
  }
359
645
  /**
360
646
  * @protected directive options
361
647
  */
362
- export declare interface ProtectedDirectiveOptions extends Omit<ProtectedMediaProps, 'src' | 'alt'> {}
648
+ export interface ProtectedDirectiveOptions extends Omit<ProtectedMediaProps, 'src' | 'alt'> {
649
+ }
363
650
  /**
364
651
  * Media manager configuration
365
652
  */
366
- export declare interface MediaManagerConfig {
367
- src: string
368
- apiKey?: string
369
- bucket?: string
370
- allowedTypes?: string[]
371
- maxFileSize?: number
372
- multiple?: boolean
373
- customStyles?: Record<string, string>
374
- callbacks?: {
375
- onSelect?: string
376
- onUpload?: string
377
- onDelete?: string
378
- onError?: string
379
- }
653
+ export interface MediaManagerConfig {
654
+ /** CDN script URL */
655
+ src: string;
656
+ /** API key */
657
+ apiKey?: string;
658
+ /** Storage bucket */
659
+ bucket?: string;
660
+ /** Allowed file types */
661
+ allowedTypes?: string[];
662
+ /** Maximum file size */
663
+ maxFileSize?: number;
664
+ /** Allow multiple selection */
665
+ multiple?: boolean;
666
+ /** Custom styling */
667
+ customStyles?: Record<string, string>;
668
+ /** Callback variable names */
669
+ callbacks?: {
670
+ onSelect?: string;
671
+ onUpload?: string;
672
+ onDelete?: string;
673
+ onError?: string;
674
+ };
380
675
  }
381
676
  /**
382
677
  * Media item from manager
383
678
  */
384
- export declare interface MediaItem {
385
- id: string
386
- url: string
387
- name: string
388
- type: string
389
- size: number
390
- width?: number
391
- height?: number
392
- duration?: number
393
- createdAt: string
394
- updatedAt: string
395
- metadata?: Record<string, unknown>
679
+ export interface MediaItem {
680
+ /** Unique ID */
681
+ id: string;
682
+ /** File URL */
683
+ url: string;
684
+ /** File name */
685
+ name: string;
686
+ /** MIME type */
687
+ type: string;
688
+ /** File size in bytes */
689
+ size: number;
690
+ /** Width (for images/videos) */
691
+ width?: number;
692
+ /** Height (for images/videos) */
693
+ height?: number;
694
+ /** Duration in seconds (for audio/video) */
695
+ duration?: number;
696
+ /** Creation timestamp */
697
+ createdAt: string;
698
+ /** Last modified timestamp */
699
+ updatedAt: string;
700
+ /** Custom metadata */
701
+ metadata?: Record<string, unknown>;
396
702
  }
397
703
  /**
398
704
  * Image optimization configuration
399
705
  */
400
- export declare interface MediaImageConfig {
401
- enabled?: boolean
402
- defaultWidths?: number[]
403
- defaultFormats?: ImageFormat[]
404
- defaultQuality?: number
405
- placeholderStrategy?: PlaceholderStrategy
406
- lazyByDefault?: boolean
407
- editingEndpoint?: string | null
408
- outputDir?: string
409
- baseUrl?: string
410
- enableDpr?: boolean
411
- defaultDpr?: number[]
412
- tsImages?: Record<string, unknown>
413
- autoSiblings?: boolean
706
+ export interface MediaImageConfig {
707
+ /** Enable image optimization */
708
+ enabled?: boolean;
709
+ /** Default breakpoint widths */
710
+ defaultWidths?: number[];
711
+ /** Default output formats */
712
+ defaultFormats?: ImageFormat[];
713
+ /** Default quality (1-100) */
714
+ defaultQuality?: number;
715
+ /** Default placeholder strategy */
716
+ placeholderStrategy?: PlaceholderStrategy;
717
+ /** Lazy load by default */
718
+ lazyByDefault?: boolean;
719
+ /** URL-based editing endpoint */
720
+ editingEndpoint?: string | null;
721
+ /** Output directory for generated images */
722
+ outputDir?: string;
723
+ /** Base URL for generated images */
724
+ baseUrl?: string;
725
+ /** Enable device pixel ratio handling */
726
+ enableDpr?: boolean;
727
+ /** Default DPR values */
728
+ defaultDpr?: number[];
729
+ /** ts-images integration configuration */
730
+ tsImages?: Record<string, unknown>;
731
+ /**
732
+ * Auto-discover .webp / .avif siblings next to plain <img src="*.jpg">
733
+ * references in rendered HTML and wrap them in <picture> with <source>
734
+ * entries for each format that actually exists on disk. Works for ANY
735
+ * <img> tag without consumers having to change anything — drop the
736
+ * optimized format next to the original asset and capable browsers
737
+ * pick it up.
738
+ *
739
+ * Disabled by default (off-spec content negotiation has a non-zero cost
740
+ * on every render). Opt in via:
741
+ *
742
+ * media: { image: { autoSiblings: true } }
743
+ */
744
+ autoSiblings?: boolean;
414
745
  }
415
746
  /**
416
747
  * Video configuration
417
748
  */
418
- export declare interface MediaVideoConfig {
419
- enabled?: boolean
420
- plyrVersion?: string
421
- plyrTheme?: string
422
- lazyByDefault?: boolean
423
- defaultControls?: boolean
424
- defaultPlyrOptions?: Partial<PlyrOptions>
425
- tsVideos?: Record<string, unknown>
749
+ export interface MediaVideoConfig {
750
+ /** Enable video features */
751
+ enabled?: boolean;
752
+ /** Plyr.js CDN version */
753
+ plyrVersion?: string;
754
+ /** Plyr.js theme URL */
755
+ plyrTheme?: string;
756
+ /** Lazy load videos by default */
757
+ lazyByDefault?: boolean;
758
+ /** Default controls for native player */
759
+ defaultControls?: boolean;
760
+ /** Default Plyr options */
761
+ defaultPlyrOptions?: Partial<PlyrOptions>;
762
+ /** ts-videos integration configuration */
763
+ tsVideos?: Record<string, unknown>;
426
764
  }
427
765
  /**
428
766
  * Upload configuration
429
767
  */
430
- export declare interface MediaUploadConfig {
431
- enabled?: boolean
432
- defaultEndpoint?: string
433
- maxSize?: number
434
- allowedTypes?: string[]
435
- chunkSize?: number
436
- maxConcurrent?: number
768
+ export interface MediaUploadConfig {
769
+ /** Enable upload features */
770
+ enabled?: boolean;
771
+ /** Default upload endpoint */
772
+ defaultEndpoint?: string;
773
+ /** Default max file size (bytes) */
774
+ maxSize?: number;
775
+ /** Allowed file types */
776
+ allowedTypes?: string[];
777
+ /** Chunk size for large uploads */
778
+ chunkSize?: number;
779
+ /** Maximum concurrent uploads */
780
+ maxConcurrent?: number;
437
781
  }
438
782
  /**
439
783
  * Protected media configuration
440
784
  */
441
- export declare interface MediaProtectedConfig {
442
- enabled?: boolean
443
- signatureEndpoint?: string
444
- expirationSeconds?: number
445
- batchSize?: number
785
+ export interface MediaProtectedConfig {
786
+ /** Enable protected media */
787
+ enabled?: boolean;
788
+ /** Default signature endpoint */
789
+ signatureEndpoint?: string;
790
+ /** Default expiration time (seconds) */
791
+ expirationSeconds?: number;
792
+ /** Batch signature request size */
793
+ batchSize?: number;
446
794
  }
447
795
  /**
448
796
  * Media cache configuration
449
797
  */
450
- export declare interface MediaCacheConfig {
451
- enabled?: boolean
452
- directory?: string
453
- maxAge?: number
454
- maxSize?: number
798
+ export interface MediaCacheConfig {
799
+ /** Enable caching */
800
+ enabled?: boolean;
801
+ /** Cache directory */
802
+ directory?: string;
803
+ /** Max cache age in days */
804
+ maxAge?: number;
805
+ /** Max cache size in MB */
806
+ maxSize?: number;
455
807
  }
456
808
  /**
457
809
  * Complete media module configuration
458
810
  */
459
- export declare interface MediaConfig {
460
- enabled?: boolean
461
- image?: MediaImageConfig
462
- video?: MediaVideoConfig
463
- upload?: MediaUploadConfig
464
- protected?: MediaProtectedConfig
465
- cache?: MediaCacheConfig
811
+ export interface MediaConfig {
812
+ /** Enable media module */
813
+ enabled?: boolean;
814
+ /** Image configuration */
815
+ image?: MediaImageConfig;
816
+ /** Video configuration */
817
+ video?: MediaVideoConfig;
818
+ /** Upload configuration */
819
+ upload?: MediaUploadConfig;
820
+ /** Protected media configuration */
821
+ protected?: MediaProtectedConfig;
822
+ /** Cache configuration */
823
+ cache?: MediaCacheConfig;
466
824
  }
467
825
  /**
468
826
  * Lazy load observer options
469
827
  */
470
- export declare interface LazyLoadOptions {
471
- root?: Element | null
472
- rootMargin?: string
473
- threshold?: number | number[]
474
- useNative?: boolean
828
+ export interface LazyLoadOptions {
829
+ /** Root element for intersection observer */
830
+ root?: Element | null;
831
+ /** Root margin */
832
+ rootMargin?: string;
833
+ /** Intersection threshold(s) */
834
+ threshold?: number | number[];
835
+ /** Use native loading="lazy" when supported */
836
+ useNative?: boolean;
475
837
  }
476
838
  /**
477
839
  * Blur-up animation options
478
840
  */
479
- export declare interface BlurUpOptions {
480
- duration?: number
481
- easing?: string
482
- removePlaceholder?: boolean
483
- loadedClass?: string
841
+ export interface BlurUpOptions {
842
+ /** Transition duration in ms */
843
+ duration?: number;
844
+ /** CSS easing function */
845
+ easing?: string;
846
+ /** Remove placeholder after load */
847
+ removePlaceholder?: boolean;
848
+ /** Class to add when loaded */
849
+ loadedClass?: string;
484
850
  }
485
851
  /**
486
852
  * Breakpoint definition for responsive images
487
853
  */
488
- export declare interface Breakpoint {
489
- name: string
490
- minWidth?: number
491
- maxWidth?: number
492
- imageWidth: number | string
854
+ export interface Breakpoint {
855
+ /** Breakpoint name (e.g., 'sm', 'md', 'lg') */
856
+ name: string;
857
+ /** Min-width in pixels */
858
+ minWidth?: number;
859
+ /** Max-width in pixels */
860
+ maxWidth?: number;
861
+ /** Image width at this breakpoint */
862
+ imageWidth: number | string;
493
863
  }
494
864
  /**
495
865
  * Srcset generation options
496
866
  */
497
- export declare interface SrcsetOptions {
498
- src: string
499
- widths?: number[]
500
- dprValues?: number[]
501
- fixedWidth?: number
502
- formats?: ImageFormat[]
503
- baseUrl?: string
504
- params?: ImageParams
867
+ export interface SrcsetOptions {
868
+ /** Source image path */
869
+ src: string;
870
+ /** Widths for width-based srcset */
871
+ widths?: number[];
872
+ /** DPR values for fixed-width srcset */
873
+ dprValues?: number[];
874
+ /** Fixed width (enables DPR-based srcset) */
875
+ fixedWidth?: number;
876
+ /** Output formats */
877
+ formats?: ImageFormat[];
878
+ /** Base URL for paths */
879
+ baseUrl?: string;
880
+ /** Image transformation params */
881
+ params?: ImageParams;
505
882
  }
506
883
  /**
507
884
  * Generated srcset data
508
885
  */
509
- export declare interface SrcsetData {
510
- srcset: string
511
- format: ImageFormat
512
- mimeType: string
513
- variants: ImageVariant[]
886
+ export interface SrcsetData {
887
+ /** Srcset string */
888
+ srcset: string;
889
+ /** Format this srcset is for */
890
+ format: ImageFormat;
891
+ /** MIME type */
892
+ mimeType: string;
893
+ /** Array of variants included */
894
+ variants: ImageVariant[];
514
895
  }
896
+ /**
897
+ * Image optimization presets for ts-images
898
+ */
899
+ export type ImageOptimizationPreset = 'web' | 'quality' | 'performance';
900
+ /**
901
+ * Image transformation types supported by ts-images
902
+ */
903
+ export type ImageTransformation = 'resize' | 'blur' | 'sharpen' | 'grayscale' | 'rotate' | 'flip' | 'flop' | 'brightness' | 'contrast' | 'saturation';
904
+ /**
905
+ * Watermark position options
906
+ */
907
+ export type WatermarkPosition = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
515
908
  /**
516
909
  * Watermark configuration
517
910
  */
518
- export declare interface WatermarkConfig {
519
- image?: string
520
- text?: string
521
- position?: WatermarkPosition
522
- opacity?: number
523
- scale?: number
524
- font?: string
525
- fontSize?: number
526
- color?: string
911
+ export interface WatermarkConfig {
912
+ /** Watermark image path */
913
+ image?: string;
914
+ /** Watermark text */
915
+ text?: string;
916
+ /** Position of the watermark */
917
+ position?: WatermarkPosition;
918
+ /** Opacity (0-1) */
919
+ opacity?: number;
920
+ /** Scale factor (0-1) */
921
+ scale?: number;
922
+ /** Font for text watermark */
923
+ font?: string;
924
+ /** Font size for text watermark */
925
+ fontSize?: number;
926
+ /** Color for text watermark */
927
+ color?: string;
527
928
  }
528
929
  /**
529
930
  * Art direction configuration for responsive images
530
931
  */
531
- export declare interface ArtDirectionConfig {
532
- media: string
533
- src: string
534
- widths?: number[]
535
- crop?: ImageCrop
536
- aspectRatio?: string
932
+ export interface ArtDirectionConfig {
933
+ /** Media query (e.g., "(max-width: 768px)") */
934
+ media: string;
935
+ /** Source image for this breakpoint */
936
+ src: string;
937
+ /** Optional specific widths for this breakpoint */
938
+ widths?: number[];
939
+ /** Optional crop settings for this breakpoint */
940
+ crop?: ImageCrop;
941
+ /** Optional aspect ratio override */
942
+ aspectRatio?: string;
537
943
  }
538
944
  /**
539
945
  * Image transformation configuration
540
946
  */
541
- export declare interface ImageTransformationConfig {
542
- type: ImageTransformation
543
- options?: {
544
- width?: number
545
- height?: number
546
- fit?: ImageFit
547
- sigma?: number
548
- amount?: number
549
- angle?: number
550
- value?: number
551
- }
947
+ export interface ImageTransformationConfig {
948
+ /** Type of transformation */
949
+ type: ImageTransformation;
950
+ /** Transformation-specific options */
951
+ options?: {
952
+ width?: number;
953
+ height?: number;
954
+ fit?: ImageFit;
955
+ sigma?: number;
956
+ amount?: number;
957
+ angle?: number;
958
+ value?: number;
959
+ };
552
960
  }
553
961
  /**
554
962
  * Format-specific quality settings for ts-images
555
963
  */
556
- export declare interface FormatQualitySettings {
557
- jpeg?: {
558
- quality?: number
559
- mozjpeg?: boolean
560
- chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0'
561
- progressive?: boolean
562
- optimizeCoding?: boolean
563
- }
564
- png?: {
565
- quality?: number
566
- compressionLevel?: number
567
- palette?: boolean
568
- adaptiveFiltering?: boolean
569
- progressive?: boolean
570
- }
571
- webp?: {
572
- quality?: number
573
- lossless?: boolean
574
- effort?: number
575
- smartSubsample?: boolean
576
- nearLossless?: number
577
- }
578
- avif?: {
579
- quality?: number
580
- lossless?: boolean
581
- effort?: number
582
- chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0'
583
- }
584
- [format: string]: Record<string, unknown> | undefined
964
+ export interface FormatQualitySettings {
965
+ /** JPEG optimization settings */
966
+ jpeg?: {
967
+ /** Quality (1-100) */
968
+ quality?: number;
969
+ /** Use MozJPEG encoder */
970
+ mozjpeg?: boolean;
971
+ /** Chroma subsampling */
972
+ chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0';
973
+ /** Progressive encoding */
974
+ progressive?: boolean;
975
+ /** Optimize Huffman coding */
976
+ optimizeCoding?: boolean;
977
+ };
978
+ /** PNG optimization settings */
979
+ png?: {
980
+ /** Quality (1-100) */
981
+ quality?: number;
982
+ /** Compression level (0-9) */
983
+ compressionLevel?: number;
984
+ /** Use palette mode */
985
+ palette?: boolean;
986
+ /** Adaptive filtering */
987
+ adaptiveFiltering?: boolean;
988
+ /** Progressive scan */
989
+ progressive?: boolean;
990
+ };
991
+ /** WebP optimization settings */
992
+ webp?: {
993
+ /** Quality (1-100) */
994
+ quality?: number;
995
+ /** Lossless encoding */
996
+ lossless?: boolean;
997
+ /** Compression effort (0-6) */
998
+ effort?: number;
999
+ /** Smart chroma subsampling */
1000
+ smartSubsample?: boolean;
1001
+ /** Near-lossless mode (0-100) */
1002
+ nearLossless?: number;
1003
+ };
1004
+ /** AVIF optimization settings */
1005
+ avif?: {
1006
+ /** Quality (1-100) */
1007
+ quality?: number;
1008
+ /** Lossless encoding */
1009
+ lossless?: boolean;
1010
+ /** Compression effort (0-9) */
1011
+ effort?: number;
1012
+ /** Chroma subsampling */
1013
+ chromaSubsampling?: '4:4:4' | '4:2:2' | '4:2:0';
1014
+ };
1015
+ /** Allow indexing by any format string */
1016
+ [format: string]: Record<string, unknown> | undefined;
585
1017
  }
586
1018
  /**
587
1019
  * ts-images integration configuration
588
1020
  */
589
- export declare interface TsImagesConfig {
590
- enabled: boolean
591
- outputDir: string
592
- baseUrl?: string
593
- formatQuality?: FormatQualitySettings
594
- breakpoints?: number[]
595
- defaultFormats?: ImageFormat[]
596
- defaultQuality?: number
597
- batchOptions?: {
598
- concurrency?: number
599
- optimizationPreset?: ImageOptimizationPreset
600
- }
601
- placeholderStrategy?: string
602
- generateSprites?: boolean
603
- spriteOutputDir?: string
1021
+ export interface TsImagesConfig {
1022
+ /** Enable ts-images processing */
1023
+ enabled: boolean;
1024
+ /** Output directory for processed images */
1025
+ outputDir: string;
1026
+ /** Base URL for generated images (CDN prefix) */
1027
+ baseUrl?: string;
1028
+ /** Format-specific quality settings */
1029
+ formatQuality?: FormatQualitySettings;
1030
+ /** Default responsive breakpoints */
1031
+ breakpoints?: number[];
1032
+ /** Default output formats */
1033
+ defaultFormats?: ImageFormat[];
1034
+ /** Default quality (1-100) */
1035
+ defaultQuality?: number;
1036
+ /** Batch processing options */
1037
+ batchOptions?: {
1038
+ /** Max concurrent processing */
1039
+ concurrency?: number;
1040
+ /** Optimization preset */
1041
+ optimizationPreset?: ImageOptimizationPreset;
1042
+ };
1043
+ /** Default placeholder strategy */
1044
+ placeholderStrategy?: string;
1045
+ /** Generate sprite sheets for icons */
1046
+ generateSprites?: boolean;
1047
+ /** Sprite output directory */
1048
+ spriteOutputDir?: string;
604
1049
  }
605
1050
  /**
606
1051
  * Enhanced image props with ts-images integration
607
1052
  */
608
- export declare interface EnhancedImgProps extends ImgProps {
609
- preset?: ImageOptimizationPreset
610
- process?: boolean
611
- transformations?: ImageTransformationConfig[]
612
- responsiveWidths?: number[]
613
- watermark?: WatermarkConfig
614
- artDirection?: ArtDirectionConfig[]
615
- useDominantColor?: boolean
616
- embedThumbhash?: boolean
617
- blurAmount?: number
618
- outputPattern?: string
619
- skipOptimization?: boolean
620
- outputFormat?: ImageFormat
1053
+ export interface EnhancedImgProps extends ImgProps {
1054
+ /** ts-images optimization preset */
1055
+ preset?: ImageOptimizationPreset;
1056
+ /** Process at build time (true) or runtime URL generation (false) */
1057
+ process?: boolean;
1058
+ /** Custom transformations to apply */
1059
+ transformations?: ImageTransformationConfig[];
1060
+ /** Generate responsive variants at these widths (overrides config) */
1061
+ responsiveWidths?: number[];
1062
+ /** Watermark configuration */
1063
+ watermark?: WatermarkConfig;
1064
+ /** Art direction: different images for breakpoints */
1065
+ artDirection?: ArtDirectionConfig[];
1066
+ /** Extract and use dominant color as placeholder background */
1067
+ useDominantColor?: boolean;
1068
+ /** Generate and embed thumbhash at build time */
1069
+ embedThumbhash?: boolean;
1070
+ /** Blur amount for placeholder (when using blur strategy) */
1071
+ blurAmount?: number;
1072
+ /** Custom output filename pattern */
1073
+ outputPattern?: string;
1074
+ /** Skip optimization for this image */
1075
+ skipOptimization?: boolean;
1076
+ /** Force specific output format */
1077
+ outputFormat?: ImageFormat;
621
1078
  }
622
1079
  /**
623
1080
  * Result from processing an image with ts-images
624
1081
  */
625
- export declare interface ProcessedImageResult {
626
- src: string
627
- processed: boolean
628
- variants?: Array<{
629
- path: string
630
- url: string
631
- width: number
632
- height: number
633
- format: ImageFormat
634
- size: number
635
- dpr?: number
636
- }>
637
- placeholder?: string
638
- dominantColor?: string
639
- originalWidth?: number
640
- originalHeight?: number
641
- hash?: string
642
- errors?: string[]
1082
+ export interface ProcessedImageResult {
1083
+ /** Original source path */
1084
+ src: string;
1085
+ /** Whether processing was performed */
1086
+ processed: boolean;
1087
+ /** Generated variants by format and width */
1088
+ variants?: Array<{
1089
+ /** Output path */
1090
+ path: string;
1091
+ /** URL for srcset */
1092
+ url: string;
1093
+ /** Width in pixels */
1094
+ width: number;
1095
+ /** Height in pixels */
1096
+ height: number;
1097
+ /** Output format */
1098
+ format: ImageFormat;
1099
+ /** File size in bytes */
1100
+ size: number;
1101
+ /** Device pixel ratio (for DPR-based srcsets) */
1102
+ dpr?: number;
1103
+ }>;
1104
+ /** Placeholder data URL (thumbhash/blur) */
1105
+ placeholder?: string;
1106
+ /** Dominant color extracted */
1107
+ dominantColor?: string;
1108
+ /** Original dimensions */
1109
+ originalWidth?: number;
1110
+ originalHeight?: number;
1111
+ /** Content hash for cache invalidation */
1112
+ hash?: string;
1113
+ /** Processing errors if any */
1114
+ errors?: string[];
643
1115
  }
644
1116
  /**
645
1117
  * Responsive variant set result
646
1118
  */
647
- export declare interface ResponsiveVariantSet {
648
- src: string
649
- byFormat: Record<ImageFormat, ProcessedImageResult['variants']>
650
- srcsets: Record<ImageFormat, string>
651
- sizes?: string
652
- placeholder?: {
653
- dataURL: string
654
- width: number
655
- height: number
656
- strategy: PlaceholderStrategy
657
- }
1119
+ export interface ResponsiveVariantSet {
1120
+ /** Source image */
1121
+ src: string;
1122
+ /** Variants grouped by format */
1123
+ byFormat: Record<ImageFormat, ProcessedImageResult['variants']>;
1124
+ /** Generated srcset strings by format */
1125
+ srcsets: Record<ImageFormat, string>;
1126
+ /** Recommended sizes attribute */
1127
+ sizes?: string;
1128
+ /** Placeholder data */
1129
+ placeholder?: {
1130
+ dataURL: string;
1131
+ width: number;
1132
+ height: number;
1133
+ strategy: PlaceholderStrategy;
1134
+ };
658
1135
  }
1136
+ /**
1137
+ * Video quality presets
1138
+ */
1139
+ export type VideoQualityPreset = 'very-low' | 'low' | 'medium' | 'high' | 'very-high' | 'lossless';
1140
+ /**
1141
+ * Platform-specific video presets
1142
+ */
1143
+ export type VideoPlatformPreset = 'youtube' | 'twitter' | 'instagram-feed' | 'instagram-story' | 'instagram-reels' | 'tiktok' | 'discord' | 'linkedin' | 'facebook' | 'web-progressive' | 'web-streaming';
1144
+ /**
1145
+ * Video codec options
1146
+ */
1147
+ export type VideoCodec = 'h264' | 'h265' | 'vp9' | 'av1';
1148
+ /**
1149
+ * Audio codec options
1150
+ */
1151
+ export type AudioCodec = 'aac' | 'opus' | 'mp3' | 'flac';
659
1152
  /**
660
1153
  * Poster/thumbnail generation options
661
1154
  */
662
- export declare interface PosterGenerationConfig {
663
- timestamp?: number
664
- width?: number
665
- height?: number
666
- format?: 'jpeg' | 'png' | 'webp'
667
- quality?: number
1155
+ export interface PosterGenerationConfig {
1156
+ /** Timestamp in seconds to extract frame */
1157
+ timestamp?: number;
1158
+ /** Output width */
1159
+ width?: number;
1160
+ /** Output height (auto-calculated if not specified) */
1161
+ height?: number;
1162
+ /** Output format */
1163
+ format?: 'jpeg' | 'png' | 'webp';
1164
+ /** Quality (1-100) */
1165
+ quality?: number;
668
1166
  }
669
1167
  /**
670
1168
  * Sprite sheet configuration for video scrubbing preview
671
1169
  */
672
- export declare interface SpriteSheetConfig {
673
- columns?: number
674
- thumbnailWidth?: number
675
- thumbnailHeight?: number
676
- interval?: number
677
- format?: 'jpeg' | 'png' | 'webp'
678
- quality?: number
1170
+ export interface SpriteSheetConfig {
1171
+ /** Number of columns in sprite sheet */
1172
+ columns?: number;
1173
+ /** Thumbnail width */
1174
+ thumbnailWidth?: number;
1175
+ /** Thumbnail height */
1176
+ thumbnailHeight?: number;
1177
+ /** Interval between frames in seconds */
1178
+ interval?: number;
1179
+ /** Output format */
1180
+ format?: 'jpeg' | 'png' | 'webp';
1181
+ /** Quality (1-100) */
1182
+ quality?: number;
679
1183
  }
680
1184
  /**
681
1185
  * Streaming quality level configuration
682
1186
  */
683
- export declare interface StreamingQualityLevel {
684
- label: string
685
- width: number
686
- height?: number
687
- bitrate: number
688
- audioBitrate?: number
1187
+ export interface StreamingQualityLevel {
1188
+ /** Display label (e.g., "1080p") */
1189
+ label: string;
1190
+ /** Video width */
1191
+ width: number;
1192
+ /** Video height (auto-calculated if not specified) */
1193
+ height?: number;
1194
+ /** Video bitrate in bps */
1195
+ bitrate: number;
1196
+ /** Audio bitrate in bps */
1197
+ audioBitrate?: number;
689
1198
  }
690
1199
  /**
691
1200
  * Adaptive streaming configuration
692
1201
  */
693
- export declare interface StreamingConfig {
694
- format?: 'hls' | 'dash'
695
- segmentDuration?: number
696
- qualities?: StreamingQualityLevel[]
697
- encryption?: {
698
- enabled: boolean
699
- keyUrl?: string
700
- iv?: string
701
- }
1202
+ export interface StreamingConfig {
1203
+ /** Streaming format */
1204
+ format?: 'hls' | 'dash';
1205
+ /** Segment duration in seconds */
1206
+ segmentDuration?: number;
1207
+ /** Quality levels */
1208
+ qualities?: StreamingQualityLevel[];
1209
+ /** Enable encryption */
1210
+ encryption?: {
1211
+ enabled: boolean;
1212
+ keyUrl?: string;
1213
+ iv?: string;
1214
+ };
702
1215
  }
703
1216
  /**
704
1217
  * Video transcoding options
705
1218
  */
706
- export declare interface TranscodeConfig {
707
- codec?: VideoCodec
708
- bitrate?: number
709
- maxWidth?: number
710
- maxHeight?: number
711
- frameRate?: number
712
- audioCodec?: AudioCodec
713
- audioBitrate?: number
714
- sampleRate?: number
715
- channels?: number
716
- twoPass?: boolean
717
- speedPreset?: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow'
718
- crf?: number
1219
+ export interface TranscodeConfig {
1220
+ /** Video codec */
1221
+ codec?: VideoCodec;
1222
+ /** Video bitrate in bps */
1223
+ bitrate?: number;
1224
+ /** Maximum width */
1225
+ maxWidth?: number;
1226
+ /** Maximum height */
1227
+ maxHeight?: number;
1228
+ /** Frame rate */
1229
+ frameRate?: number;
1230
+ /** Audio codec */
1231
+ audioCodec?: AudioCodec;
1232
+ /** Audio bitrate in bps */
1233
+ audioBitrate?: number;
1234
+ /** Sample rate in Hz */
1235
+ sampleRate?: number;
1236
+ /** Number of audio channels */
1237
+ channels?: number;
1238
+ /** Two-pass encoding for better quality */
1239
+ twoPass?: boolean;
1240
+ /** Speed preset */
1241
+ speedPreset?: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow';
1242
+ /** CRF value (0-51 for H.264, lower = better quality) */
1243
+ crf?: number;
719
1244
  }
720
1245
  /**
721
1246
  * Waveform visualization configuration
722
1247
  */
723
- export declare interface WaveformConfig {
724
- width?: number
725
- height?: number
726
- color?: string
727
- backgroundColor?: string
728
- format?: 'png' | 'svg' | 'json'
729
- samples?: number
1248
+ export interface WaveformConfig {
1249
+ /** Output width */
1250
+ width?: number;
1251
+ /** Output height */
1252
+ height?: number;
1253
+ /** Waveform color */
1254
+ color?: string;
1255
+ /** Background color */
1256
+ backgroundColor?: string;
1257
+ /** Output format */
1258
+ format?: 'png' | 'svg' | 'json';
1259
+ /** Number of samples to render */
1260
+ samples?: number;
730
1261
  }
731
1262
  /**
732
1263
  * ts-videos integration configuration
733
1264
  */
734
- export declare interface TsVideosConfig {
735
- enabled: boolean
736
- outputDir: string
737
- baseUrl?: string
738
- defaultQuality?: VideoQualityPreset
739
- streaming?: {
740
- enabled: boolean
741
- format?: 'hls' | 'dash'
742
- segmentDuration?: number
743
- defaultQualities?: StreamingQualityLevel[]
744
- }
745
- thumbnails?: {
746
- enabled: boolean
747
- count?: number
748
- interval?: number
749
- format?: 'jpeg' | 'png' | 'webp'
750
- width?: number
751
- }
752
- transcoding?: {
753
- defaultCodec?: VideoCodec
754
- defaultAudioCodec?: AudioCodec
755
- speedPreset?: TranscodeConfig['speedPreset']
756
- }
1265
+ export interface TsVideosConfig {
1266
+ /** Enable ts-videos processing */
1267
+ enabled: boolean;
1268
+ /** Output directory for processed videos */
1269
+ outputDir: string;
1270
+ /** Base URL for video assets */
1271
+ baseUrl?: string;
1272
+ /** Default quality preset */
1273
+ defaultQuality?: VideoQualityPreset;
1274
+ /** Streaming configuration */
1275
+ streaming?: {
1276
+ /** Enable streaming manifest generation */
1277
+ enabled: boolean;
1278
+ /** Default format */
1279
+ format?: 'hls' | 'dash';
1280
+ /** Segment duration */
1281
+ segmentDuration?: number;
1282
+ /** Default quality levels */
1283
+ defaultQualities?: StreamingQualityLevel[];
1284
+ };
1285
+ /** Thumbnail generation configuration */
1286
+ thumbnails?: {
1287
+ /** Enable thumbnail generation */
1288
+ enabled: boolean;
1289
+ /** Number of thumbnails to generate */
1290
+ count?: number;
1291
+ /** Interval between thumbnails in seconds */
1292
+ interval?: number;
1293
+ /** Output format */
1294
+ format?: 'jpeg' | 'png' | 'webp';
1295
+ /** Thumbnail width */
1296
+ width?: number;
1297
+ };
1298
+ /** Default transcoding settings */
1299
+ transcoding?: {
1300
+ /** Default codec */
1301
+ defaultCodec?: VideoCodec;
1302
+ /** Default audio codec */
1303
+ defaultAudioCodec?: AudioCodec;
1304
+ /** Default speed preset */
1305
+ speedPreset?: TranscodeConfig['speedPreset'];
1306
+ };
757
1307
  }
758
1308
  /**
759
1309
  * Enhanced video props with ts-videos integration
760
1310
  */
761
- export declare interface EnhancedVideoProps extends VideoProps {
762
- quality?: VideoQualityPreset
763
- platform?: VideoPlatformPreset
764
- process?: boolean
765
- generatePoster?: boolean | PosterGenerationConfig
766
- spriteSheet?: boolean | SpriteSheetConfig
767
- streaming?: boolean | StreamingConfig
768
- transcode?: TranscodeConfig
769
- waveform?: boolean | WaveformConfig
770
- onProcessProgress?: (progress: {
771
- percentage: number
772
- currentTime: number
773
- duration: number
774
- stage: 'analyzing' | 'transcoding' | 'generating-manifests' | 'complete'
775
- }) => void
776
- outputPattern?: string
777
- skipProcessing?: boolean
778
- title?: string
1311
+ export interface EnhancedVideoProps extends VideoProps {
1312
+ /** ts-videos quality preset */
1313
+ quality?: VideoQualityPreset;
1314
+ /** Platform-specific optimization preset */
1315
+ platform?: VideoPlatformPreset;
1316
+ /** Process video at build time */
1317
+ process?: boolean;
1318
+ /** Generate poster from video frame */
1319
+ generatePoster?: boolean | PosterGenerationConfig;
1320
+ /** Generate sprite sheet for scrubbing preview */
1321
+ spriteSheet?: boolean | SpriteSheetConfig;
1322
+ /** Adaptive streaming configuration */
1323
+ streaming?: boolean | StreamingConfig;
1324
+ /** Transcoding options */
1325
+ transcode?: TranscodeConfig;
1326
+ /** Generate waveform for audio visualization */
1327
+ waveform?: boolean | WaveformConfig;
1328
+ /** Progress callback for video processing */
1329
+ onProcessProgress?: (progress: {
1330
+ percentage: number;
1331
+ currentTime: number;
1332
+ duration: number;
1333
+ stage: 'analyzing' | 'transcoding' | 'generating-manifests' | 'complete';
1334
+ }) => void;
1335
+ /** Custom output filename pattern */
1336
+ outputPattern?: string;
1337
+ /** Skip processing for this video */
1338
+ skipProcessing?: boolean;
1339
+ /** Title for accessibility and metadata */
1340
+ title?: string;
779
1341
  }
780
1342
  /**
781
1343
  * Result from generating a thumbnail
782
1344
  */
783
- export declare interface ThumbnailResult {
784
- path: string
785
- url: string
786
- width: number
787
- height: number
788
- timestamp: number
789
- size: number
1345
+ export interface ThumbnailResult {
1346
+ /** Output path */
1347
+ path: string;
1348
+ /** URL for use in poster attribute */
1349
+ url: string;
1350
+ /** Width in pixels */
1351
+ width: number;
1352
+ /** Height in pixels */
1353
+ height: number;
1354
+ /** Timestamp in seconds */
1355
+ timestamp: number;
1356
+ /** File size in bytes */
1357
+ size: number;
790
1358
  }
791
1359
  /**
792
1360
  * Result from generating HLS manifest
793
1361
  */
794
- export declare interface HLSResult {
795
- manifestUrl: string
796
- manifestPath: string
797
- playlists: Array<{
798
- quality: StreamingQualityLevel
799
- url: string
800
- path: string
801
- }>
802
- segmentCount: number
803
- duration: number
1362
+ export interface HLSResult {
1363
+ /** Master playlist URL */
1364
+ manifestUrl: string;
1365
+ /** Path to master playlist file */
1366
+ manifestPath: string;
1367
+ /** Individual quality level playlists */
1368
+ playlists: Array<{
1369
+ quality: StreamingQualityLevel;
1370
+ url: string;
1371
+ path: string;
1372
+ }>;
1373
+ /** Total segment count */
1374
+ segmentCount: number;
1375
+ /** Total duration in seconds */
1376
+ duration: number;
804
1377
  }
805
1378
  /**
806
1379
  * Result from generating DASH manifest
807
1380
  */
808
- export declare interface DASHResult {
809
- manifestUrl: string
810
- manifestPath: string
811
- adaptationSets: Array<{
812
- type: 'video' | 'audio'
813
- representations: Array<{
814
- bandwidth: number
815
- width?: number
816
- height?: number
817
- url: string
818
- }>
819
- }>
820
- duration: number
1381
+ export interface DASHResult {
1382
+ /** MPD manifest URL */
1383
+ manifestUrl: string;
1384
+ /** Path to MPD file */
1385
+ manifestPath: string;
1386
+ /** Adaptation sets */
1387
+ adaptationSets: Array<{
1388
+ type: 'video' | 'audio';
1389
+ representations: Array<{
1390
+ bandwidth: number;
1391
+ width?: number;
1392
+ height?: number;
1393
+ url: string;
1394
+ }>;
1395
+ }>;
1396
+ /** Total duration in seconds */
1397
+ duration: number;
821
1398
  }
822
1399
  /**
823
1400
  * Result from video transcoding
824
1401
  */
825
- export declare interface TranscodeResult {
826
- path: string
827
- url: string
828
- duration: number
829
- size: number
830
- video: {
831
- codec: VideoCodec
832
- width: number
833
- height: number
834
- bitrate: number
835
- frameRate: number
836
- }
837
- audio?: {
838
- codec: AudioCodec
839
- bitrate: number
840
- sampleRate: number
841
- channels: number
842
- }
1402
+ export interface TranscodeResult {
1403
+ /** Output file path */
1404
+ path: string;
1405
+ /** URL for use in video source */
1406
+ url: string;
1407
+ /** Duration in seconds */
1408
+ duration: number;
1409
+ /** File size in bytes */
1410
+ size: number;
1411
+ /** Video properties */
1412
+ video: {
1413
+ codec: VideoCodec;
1414
+ width: number;
1415
+ height: number;
1416
+ bitrate: number;
1417
+ frameRate: number;
1418
+ };
1419
+ /** Audio properties */
1420
+ audio?: {
1421
+ codec: AudioCodec;
1422
+ bitrate: number;
1423
+ sampleRate: number;
1424
+ channels: number;
1425
+ };
843
1426
  }
844
1427
  /**
845
1428
  * Result from processing a video with ts-videos
846
1429
  */
847
- export declare interface ProcessedVideoResult {
848
- src: string
849
- processed: boolean
850
- transcoded?: TranscodeResult
851
- poster?: ThumbnailResult
852
- thumbnails?: ThumbnailResult[]
853
- spriteSheet?: {
854
- url: string
855
- path: string
856
- columns: number
857
- rows: number
858
- thumbnailWidth: number
859
- thumbnailHeight: number
860
- interval: number
861
- totalFrames: number
862
- }
863
- streaming?: {
864
- hls?: HLSResult
865
- dash?: DASHResult
866
- }
867
- waveform?: {
868
- url: string
869
- path: string
870
- data?: number[]
871
- }
872
- metadata?: {
873
- duration: number
874
- width: number
875
- height: number
876
- frameRate: number
877
- bitrate: number
878
- codec: string
879
- audioCodec?: string
880
- }
881
- hash?: string
882
- errors?: string[]
1430
+ export interface ProcessedVideoResult {
1431
+ /** Original source path */
1432
+ src: string;
1433
+ /** Whether processing was performed */
1434
+ processed: boolean;
1435
+ /** Transcoded video result */
1436
+ transcoded?: TranscodeResult;
1437
+ /** Generated poster/thumbnail */
1438
+ poster?: ThumbnailResult;
1439
+ /** Additional thumbnails */
1440
+ thumbnails?: ThumbnailResult[];
1441
+ /** Sprite sheet for scrubbing */
1442
+ spriteSheet?: {
1443
+ url: string;
1444
+ path: string;
1445
+ columns: number;
1446
+ rows: number;
1447
+ thumbnailWidth: number;
1448
+ thumbnailHeight: number;
1449
+ interval: number;
1450
+ totalFrames: number;
1451
+ };
1452
+ /** Streaming manifests */
1453
+ streaming?: {
1454
+ hls?: HLSResult;
1455
+ dash?: DASHResult;
1456
+ };
1457
+ /** Waveform data */
1458
+ waveform?: {
1459
+ url: string;
1460
+ path: string;
1461
+ data?: number[];
1462
+ };
1463
+ /** Video metadata */
1464
+ metadata?: {
1465
+ duration: number;
1466
+ width: number;
1467
+ height: number;
1468
+ frameRate: number;
1469
+ bitrate: number;
1470
+ codec: string;
1471
+ audioCodec?: string;
1472
+ };
1473
+ /** Content hash for cache invalidation */
1474
+ hash?: string;
1475
+ /** Processing errors if any */
1476
+ errors?: string[];
883
1477
  }
884
- /**
885
- * Placeholder generation strategies for lazy loading
886
- */
887
- export type PlaceholderStrategy = | 'blur' // Low-quality blurred image (LQIP)
888
- | 'thumbhash' // Thumbhash-based placeholder
889
- | 'blurhash' // Blurhash-based placeholder
890
- | 'pixelate' // Pixelated low-res version
891
- | 'dominant-color' // Solid dominant color
892
- | 'none' // No placeholder;
893
- /**
894
- * Supported image formats
895
- */
896
- export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png' | 'gif';
897
- /**
898
- * Image fit modes (similar to CSS object-fit)
899
- */
900
- export type ImageFit = 'clip' | 'crop' | 'fill' | 'max' | 'min' | 'scale' | 'cover' | 'contain';
901
- /**
902
- * Image crop positions
903
- */
904
- export type ImageCrop = | 'top'
905
- | 'bottom'
906
- | 'left'
907
- | 'right'
908
- | 'center'
909
- | 'top-left'
910
- | 'top-right'
911
- | 'bottom-left'
912
- | 'bottom-right'
913
- | 'faces' // AI face detection
914
- | 'entropy' // Maximum entropy region;
915
- /**
916
- * Video embed type
917
- */
918
- export type VideoEmbedType = 'video' | 'youtube' | 'vimeo' | 'dailymotion' | 'twitch';
919
- /**
920
- * Plyr.js control options
921
- */
922
- export type PlyrControl = | 'play-large'
923
- | 'restart'
924
- | 'rewind'
925
- | 'play'
926
- | 'fast-forward'
927
- | 'progress'
928
- | 'current-time'
929
- | 'duration'
930
- | 'mute'
931
- | 'volume'
932
- | 'captions'
933
- | 'settings'
934
- | 'pip'
935
- | 'airplay'
936
- | 'fullscreen';
937
- /**
938
- * Image optimization presets for ts-images
939
- */
940
- export type ImageOptimizationPreset = 'web' | 'quality' | 'performance';
941
- /**
942
- * Image transformation types supported by ts-images
943
- */
944
- export type ImageTransformation = | 'resize'
945
- | 'blur'
946
- | 'sharpen'
947
- | 'grayscale'
948
- | 'rotate'
949
- | 'flip'
950
- | 'flop'
951
- | 'brightness'
952
- | 'contrast'
953
- | 'saturation';
954
- /**
955
- * Watermark position options
956
- */
957
- export type WatermarkPosition = | 'center'
958
- | 'top'
959
- | 'bottom'
960
- | 'left'
961
- | 'right'
962
- | 'top-left'
963
- | 'top-right'
964
- | 'bottom-left'
965
- | 'bottom-right';
966
- /**
967
- * Video quality presets
968
- */
969
- export type VideoQualityPreset = | 'very-low'
970
- | 'low'
971
- | 'medium'
972
- | 'high'
973
- | 'very-high'
974
- | 'lossless';
975
- /**
976
- * Platform-specific video presets
977
- */
978
- export type VideoPlatformPreset = | 'youtube'
979
- | 'twitter'
980
- | 'instagram-feed'
981
- | 'instagram-story'
982
- | 'instagram-reels'
983
- | 'tiktok'
984
- | 'discord'
985
- | 'linkedin'
986
- | 'facebook'
987
- | 'web-progressive'
988
- | 'web-streaming';
989
- /**
990
- * Video codec options
991
- */
992
- export type VideoCodec = 'h264' | 'h265' | 'vp9' | 'av1';
993
- /**
994
- * Audio codec options
995
- */
996
- export type AudioCodec = 'aac' | 'opus' | 'mp3' | 'flac';