@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.
- package/dist/a11y.d.ts +87 -46
- package/dist/animation.d.ts +96 -42
- package/dist/appearance-bootstrap.d.ts +49 -15
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +9 -7
- package/dist/async-components.d.ts +78 -56
- package/dist/auth.d.ts +3 -0
- package/dist/build-externalize.d.ts +40 -0
- package/dist/build-externalize.js +63 -0
- package/dist/build-id.d.ts +22 -22
- package/dist/build-message.d.ts +73 -2
- package/dist/build-message.js +47 -8
- package/dist/builtins/attrs.d.ts +14 -0
- package/dist/builtins/drawer.d.ts +22 -0
- package/dist/builtins/icon.d.ts +16 -2
- package/dist/builtins/index.d.ts +5 -15
- package/dist/builtins/modal.d.ts +24 -0
- package/dist/builtins/safe-image.d.ts +42 -0
- package/dist/builtins/stx-image.d.ts +27 -0
- package/dist/builtins/stx-link.d.ts +9 -0
- package/dist/builtins/stx-loading-indicator.d.ts +11 -0
- package/dist/builtins/suspense.d.ts +28 -0
- package/dist/builtins/toast.d.ts +17 -0
- package/dist/builtins/transition-group.d.ts +25 -0
- package/dist/caching.d.ts +12 -15
- package/dist/cli.js +1798 -908
- package/dist/client/directive.d.ts +7 -0
- package/dist/client/index.d.ts +0 -1
- package/dist/client-script-bundler.d.ts +63 -5
- package/dist/client-script-bundler.js +30 -2
- package/dist/client-script.d.ts +102 -47
- package/dist/client-script.js +15 -3
- package/dist/codemod.d.ts +56 -0
- package/dist/codemod.js +192 -0
- package/dist/color-mode-boot.d.ts +83 -65
- package/dist/component-client-factories.d.ts +1 -6
- package/dist/component-processing.d.ts +58 -49
- package/dist/component-processing.js +1 -1
- package/dist/component-registry.d.ts +94 -31
- package/dist/component-renderer.d.ts +18 -0
- package/dist/composable-loader.d.ts +24 -0
- package/dist/composable-loader.js +12 -9
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-fetch.js +30 -2
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables.d.ts +64 -60
- package/dist/computed.d.ts +86 -92
- package/dist/conditionals.d.ts +24 -8
- package/dist/conditionals.js +16 -0
- package/dist/config.d.ts +34 -21
- package/dist/config.js +35 -14
- package/dist/craft.js +1476 -768
- package/dist/crosswind-config.d.ts +58 -0
- package/dist/crosswind-config.js +40 -0
- package/dist/csp.d.ts +107 -41
- package/dist/defer.d.ts +24 -0
- package/dist/dev-server/crosswind.d.ts +35 -26
- package/dist/dev-server/crosswind.js +2 -18
- package/dist/dev-server/serve-app.js +4 -3
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/directive-api.d.ts +86 -43
- package/dist/document-shell.d.ts +54 -41
- package/dist/dynamic-components.d.ts +9 -0
- package/dist/error-boundaries.d.ts +47 -41
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +51 -43
- package/dist/errors/formatter.d.ts +58 -38
- package/dist/errors/index.d.ts +5 -61
- package/dist/errors/logger.d.ts +114 -40
- package/dist/errors/sanitizer.d.ts +53 -23
- package/dist/errors/types.d.ts +44 -31
- package/dist/events.d.ts +86 -25
- package/dist/expressions.d.ts +50 -42
- package/dist/forms-validation.d.ts +138 -123
- package/dist/forms-validation.js +1 -90
- package/dist/forms.d.ts +120 -66
- package/dist/forms.js +31 -11
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +109 -0
- package/dist/framework-composables.d.ts +32 -0
- package/dist/head.d.ts +156 -114
- package/dist/heatmap.d.ts +152 -72
- package/dist/html-masking.d.ts +40 -34
- package/dist/hydration-runtime.d.ts +20 -24
- package/dist/i18n.d.ts +93 -32
- package/dist/image-optimization/auto-sibling.d.ts +32 -4
- package/dist/includes.d.ts +69 -7
- package/dist/index.d.ts +66 -0
- package/dist/index.js +23 -0
- package/dist/internal-markdown.d.ts +12 -8
- package/dist/island-chunking.d.ts +30 -13
- package/dist/keep-alive.d.ts +72 -52
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-module.d.ts +10 -0
- package/dist/loops.d.ts +66 -0
- package/dist/loops.js +47 -6
- package/dist/markdown.d.ts +0 -1
- package/dist/media/image/component.d.ts +25 -9
- package/dist/media/image/directive.d.ts +15 -1
- package/dist/media/image/placeholder.d.ts +20 -9
- package/dist/media/image/processor/cache.d.ts +40 -18
- package/dist/media/image/processor/index.d.ts +1 -10
- package/dist/media/image/processor/optimizer.d.ts +12 -1
- package/dist/media/image/processor/responsive.d.ts +16 -6
- package/dist/media/image/srcset.d.ts +47 -50
- package/dist/media/shared/cache.d.ts +51 -31
- package/dist/media/shared/hash.d.ts +7 -0
- package/dist/media/types.d.ts +1235 -754
- package/dist/media/video/directive.d.ts +15 -1
- package/dist/media/video/index.d.ts +39 -17
- package/dist/media/video/processor/cache.d.ts +42 -19
- package/dist/media/video/processor/index.d.ts +1 -18
- package/dist/media/video/processor/streaming.d.ts +17 -10
- package/dist/media/video/processor/thumbnail.d.ts +21 -15
- package/dist/media/video/processor/transcoder.d.ts +11 -1
- package/dist/method-spoofing.d.ts +7 -0
- package/dist/middleware.d.ts +60 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/parser/directive-parser.d.ts +57 -45
- package/dist/parser/expression-parser.d.ts +33 -35
- package/dist/parser/index.d.ts +4 -39
- package/dist/parser/tokenizer.d.ts +61 -49
- package/dist/partial-hydration.d.ts +82 -50
- package/dist/performance-utils.d.ts +217 -124
- package/dist/placeholder.d.ts +18 -9
- package/dist/plugin-system.d.ts +264 -115
- package/dist/process.d.ts +11 -6
- package/dist/process.js +21 -4
- package/dist/production-builder.js +7 -0
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +14 -0
- package/dist/pwa/directives.d.ts +12 -3
- package/dist/pwa/inject.d.ts +10 -0
- package/dist/pwa/precache.d.ts +22 -16
- package/dist/pwa/service-worker.d.ts +12 -0
- package/dist/pwa.js +1318 -610
- package/dist/reactive-bindings.d.ts +34 -11
- package/dist/reactive.d.ts +58 -30
- package/dist/reactive.js +56 -31
- package/dist/render.d.ts +0 -14
- package/dist/render.js +17 -0
- package/dist/route-middleware.d.ts +2 -35
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +5 -7
- package/dist/routes.d.ts +1 -3
- package/dist/runtime-globals.d.ts +147 -24
- package/dist/runtime-globals.js +16 -1
- package/dist/runtime-injection.d.ts +8 -0
- package/dist/runtime-injection.js +33 -24
- package/dist/script-emit.d.ts +30 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +21 -4
- package/dist/seo.d.ts +118 -47
- package/dist/server-bindings.d.ts +21 -0
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +35 -15
- package/dist/signals-api.d.ts +117 -58
- package/dist/signals-api.js +7 -4
- package/dist/signals.d.ts +24 -17
- package/dist/signals.js +765 -60
- package/dist/site-builder/build.js +8 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +86 -20
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/ssg.d.ts +285 -142
- package/dist/ssg.js +1268 -556
- package/dist/state-dir.d.ts +4 -4
- package/dist/state-management.d.ts +0 -12
- package/dist/state-management.js +8 -25
- package/dist/store-imports.d.ts +23 -0
- package/dist/store-imports.js +3 -0
- package/dist/store-loader.d.ts +10 -0
- package/dist/store-loader.js +10 -9
- package/dist/story/analytics.d.ts +138 -60
- package/dist/story/bookmarks.d.ts +87 -34
- package/dist/story/cli.d.ts +123 -69
- package/dist/story/collect/scanner.d.ts +4 -0
- package/dist/story/collect/tree.d.ts +8 -1
- package/dist/story/commands/build.d.ts +11 -6
- package/dist/story/commands/dev.d.ts +15 -8
- package/dist/story/commands/preview.d.ts +13 -7
- package/dist/story/config-watcher.d.ts +20 -13
- package/dist/story/config.d.ts +11 -8
- package/dist/story/context.d.ts +14 -8
- package/dist/story/hmr.d.ts +24 -26
- package/dist/story/hot-swap.d.ts +34 -23
- package/dist/story/keyboard-shortcuts.d.ts +23 -18
- package/dist/story/output.d.ts +46 -44
- package/dist/story/performance.d.ts +107 -45
- package/dist/story/presets.d.ts +107 -41
- package/dist/story/renderer.d.ts +41 -27
- package/dist/story/search.d.ts +23 -12
- package/dist/story/server.d.ts +21 -11
- package/dist/story/setup.d.ts +23 -15
- package/dist/story/testing.d.ts +65 -40
- package/dist/story/types.d.ts +262 -160
- package/dist/streaming.d.ts +119 -57
- package/dist/stx-virtual-ts.d.ts +165 -0
- package/dist/stx-virtual-ts.js +372 -0
- package/dist/stx.d.ts +78 -1
- package/dist/style-scoping.d.ts +17 -4
- package/dist/suspense.d.ts +67 -52
- package/dist/teleport.d.ts +22 -0
- package/dist/template-tag-balance.d.ts +22 -6
- package/dist/transitions.d.ts +66 -55
- package/dist/typecheck.d.ts +77 -0
- package/dist/typecheck.js +156 -0
- package/dist/types/component-types.d.ts +187 -122
- package/dist/types/config-types.d.ts +758 -297
- package/dist/types/context-types.d.ts +46 -24
- package/dist/types/csp-types.d.ts +70 -66
- package/dist/types/directive-types.d.ts +211 -155
- package/dist/types/index.d.ts +6 -109
- package/dist/types/pwa-types.d.ts +273 -148
- package/dist/types.d.ts +0 -1
- package/dist/typescript-templates.d.ts +11 -0
- package/dist/unresolved-identifiers.d.ts +24 -22
- package/dist/unresolved-identifiers.js +2 -0
- package/dist/utils.d.ts +24 -21
- package/dist/validator.d.ts +28 -26
- package/dist/variable-extractor.d.ts +48 -13
- package/dist/variable-extractor.js +27 -4
- package/dist/view-composers.d.ts +80 -81
- package/dist/virtual-scrolling.d.ts +101 -81
- package/dist/vue-template.d.ts +23 -0
- package/dist/web-components/css-scoping.d.ts +21 -11
- package/dist/web-components.d.ts +81 -58
- package/dist/x-element.d.ts +0 -1
- package/package.json +5 -5
- package/stx.d.ts +78 -1
package/dist/media/types.d.ts
CHANGED
|
@@ -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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
|
126
|
-
|
|
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
|
421
|
+
export interface VideoDirectiveOptions extends Omit<VideoProps, 'src'> {
|
|
422
|
+
}
|
|
213
423
|
/**
|
|
214
424
|
* Video render result
|
|
215
425
|
*/
|
|
216
|
-
export
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
|
326
|
-
|
|
327
|
-
|
|
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
|
|
333
|
-
|
|
334
|
-
|
|
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
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
|
648
|
+
export interface ProtectedDirectiveOptions extends Omit<ProtectedMediaProps, 'src' | 'alt'> {
|
|
649
|
+
}
|
|
363
650
|
/**
|
|
364
651
|
* Media manager configuration
|
|
365
652
|
*/
|
|
366
|
-
export
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
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
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
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
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
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
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
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
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
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
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
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
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
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
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
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
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
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
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
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
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
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
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
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
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
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
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
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
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
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
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
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';
|