img-upload-kit 1.1.1 → 2.0.1

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 (111) hide show
  1. package/CHANGELOG.md +89 -74
  2. package/MIGRATION.md +192 -0
  3. package/README.md +243 -259
  4. package/dist/bin.js +1186 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/blur.cjs +40 -412
  7. package/dist/blur.cjs.map +1 -1
  8. package/dist/blur.d.cts +5 -5
  9. package/dist/blur.d.ts +5 -5
  10. package/dist/blur.js +39 -393
  11. package/dist/blur.js.map +1 -1
  12. package/dist/blurDataUtils-DveBRtqE.d.cts +43 -0
  13. package/dist/blurDataUtils-yx9Q6HlU.d.ts +43 -0
  14. package/dist/blurService-D5TpMNji.d.ts +83 -0
  15. package/dist/blurService-DacwylJx.d.cts +83 -0
  16. package/dist/chunk-25GYKQ6J.js +158 -0
  17. package/dist/chunk-25GYKQ6J.js.map +1 -0
  18. package/dist/chunk-34L4TEE3.cjs +226 -0
  19. package/dist/chunk-34L4TEE3.cjs.map +1 -0
  20. package/dist/chunk-DFCSN3X7.cjs +158 -0
  21. package/dist/chunk-DFCSN3X7.cjs.map +1 -0
  22. package/dist/chunk-EWVIL57J.js +294 -0
  23. package/dist/chunk-EWVIL57J.js.map +1 -0
  24. package/dist/chunk-FP5YIWG5.cjs +135 -0
  25. package/dist/chunk-FP5YIWG5.cjs.map +1 -0
  26. package/dist/chunk-HILELQGS.js +226 -0
  27. package/dist/chunk-HILELQGS.js.map +1 -0
  28. package/dist/chunk-IDLLCVGB.js +2370 -0
  29. package/dist/chunk-IDLLCVGB.js.map +1 -0
  30. package/dist/chunk-J6A44Y3W.js +514 -0
  31. package/dist/chunk-J6A44Y3W.js.map +1 -0
  32. package/dist/chunk-LOSVFO56.cjs +145 -0
  33. package/dist/chunk-LOSVFO56.cjs.map +1 -0
  34. package/dist/chunk-MBQJ6NVJ.cjs +294 -0
  35. package/dist/chunk-MBQJ6NVJ.cjs.map +1 -0
  36. package/dist/chunk-MHGQEBPW.js +145 -0
  37. package/dist/chunk-MHGQEBPW.js.map +1 -0
  38. package/dist/chunk-QHU7FUO4.cjs +37 -0
  39. package/dist/chunk-QHU7FUO4.cjs.map +1 -0
  40. package/dist/chunk-S2IFAWJK.js +37 -0
  41. package/dist/chunk-S2IFAWJK.js.map +1 -0
  42. package/dist/chunk-TA5Y64JM.cjs +2370 -0
  43. package/dist/chunk-TA5Y64JM.cjs.map +1 -0
  44. package/dist/chunk-VYVZVUNI.js +135 -0
  45. package/dist/chunk-VYVZVUNI.js.map +1 -0
  46. package/dist/chunk-XKQMCY5Z.cjs +514 -0
  47. package/dist/chunk-XKQMCY5Z.cjs.map +1 -0
  48. package/dist/cli.cjs +273 -76
  49. package/dist/cli.cjs.map +1 -1
  50. package/dist/cli.js +269 -73
  51. package/dist/cli.js.map +1 -1
  52. package/dist/headless.cjs +8 -1880
  53. package/dist/headless.cjs.map +1 -1
  54. package/dist/headless.d.cts +3 -1
  55. package/dist/headless.d.ts +3 -1
  56. package/dist/headless.js +25 -1886
  57. package/dist/headless.js.map +1 -1
  58. package/dist/index-BIdnqtW8.d.ts +234 -0
  59. package/dist/index-Brk_uHs6.d.cts +234 -0
  60. package/dist/{index-FVXXKf2v.d.ts → index-CPMlaQsC.d.ts} +76 -153
  61. package/dist/{index-FVXXKf2v.d.cts → index-DHINe-rA.d.cts} +76 -153
  62. package/dist/index.cjs +64 -532
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +7 -4
  65. package/dist/index.d.ts +7 -4
  66. package/dist/index.js +63 -504
  67. package/dist/index.js.map +1 -1
  68. package/dist/{memoryAdapter-CBu7_3Pp.d.ts → memoryAdapter-Ck0ccZbF.d.cts} +3 -2
  69. package/dist/{memoryAdapter-BJjyLR-1.d.cts → memoryAdapter-DxEKaG0b.d.ts} +3 -2
  70. package/dist/placeholders-C4ftwaII.d.ts +5 -0
  71. package/dist/placeholders-x_3rt65M.d.cts +5 -0
  72. package/dist/react.cjs +1952 -3257
  73. package/dist/react.cjs.map +1 -1
  74. package/dist/react.d.cts +188 -50
  75. package/dist/react.d.ts +188 -50
  76. package/dist/react.js +1763 -3013
  77. package/dist/react.js.map +1 -1
  78. package/dist/server-handler.cjs +14 -0
  79. package/dist/server-handler.cjs.map +1 -0
  80. package/dist/server-handler.d.cts +3 -0
  81. package/dist/server-handler.d.ts +3 -0
  82. package/dist/server-handler.js +14 -0
  83. package/dist/server-handler.js.map +1 -0
  84. package/dist/server.cjs +1096 -532
  85. package/dist/server.cjs.map +1 -1
  86. package/dist/server.d.cts +77 -154
  87. package/dist/server.d.ts +77 -154
  88. package/dist/server.js +1050 -448
  89. package/dist/server.js.map +1 -1
  90. package/dist/storage.cjs +239 -232
  91. package/dist/storage.cjs.map +1 -1
  92. package/dist/storage.d.cts +21 -5
  93. package/dist/storage.d.ts +21 -5
  94. package/dist/storage.js +227 -207
  95. package/dist/storage.js.map +1 -1
  96. package/dist/styles/animated-image.css +112 -0
  97. package/dist/styles/dropzone-and-tiles.css +247 -0
  98. package/dist/styles/modals-and-dock.css +248 -0
  99. package/dist/styles/primitives.css +197 -0
  100. package/dist/styles/quality-and-inputs.css +184 -0
  101. package/dist/styles/tokens.css +123 -0
  102. package/dist/styles.css +235 -220
  103. package/dist/types-BrP-o9nd.d.cts +85 -0
  104. package/dist/types-sZ3KoFQY.d.ts +85 -0
  105. package/dist/types-yShGNQnW.d.cts +61 -0
  106. package/dist/types-yShGNQnW.d.ts +61 -0
  107. package/dist/{types-CiLY0DwB.d.cts → upload-C5Trd6Dh.d.cts} +27 -53
  108. package/dist/{types-CiLY0DwB.d.ts → upload-C5Trd6Dh.d.ts} +27 -53
  109. package/package.json +92 -32
  110. package/dist/blurService-DqsnfPTd.d.cts +0 -172
  111. package/dist/blurService-DqsnfPTd.d.ts +0 -172
package/dist/server.d.ts CHANGED
@@ -1,44 +1,7 @@
1
- import { b as ImageOutputFormat, I as ImageDimensions, E as ExplicitOutputFormat, c as ImageUploadOptions, r as UploadedImageData, p as UploadPresetConfig, g as StandardPresetName, h as StorageAdapter, t as UploadRecordHook, n as StorageUploadResult } from './types-CiLY0DwB.js';
2
-
3
- interface OptimizedImageResult {
4
- buffer: Buffer;
5
- width: number;
6
- height: number;
7
- format: ImageOutputFormat;
8
- size: number;
9
- }
10
- interface BlurHashResult {
11
- dataURL: string;
12
- color: string;
13
- blurHash?: string;
14
- }
15
- interface OptimizeImageOptions {
16
- /** Max bounding box dimensions (fit: 'inside', withoutEnlargement: true). Defaults to 1920x1080. */
17
- maxDimensions?: ImageDimensions;
18
- /** Explicit output format; omit for smart size-guarded AVIF/WebP selection */
19
- outputFormat?: ExplicitOutputFormat;
20
- /** 1–100 compression quality. Defaults to smart photo/graphic heuristic (85–88). */
21
- quality?: number;
22
- }
23
- interface GenerateBlurOptions {
24
- width?: number;
25
- fallbackWidth?: number;
26
- quality?: number;
27
- maxDataUrlChars?: number;
28
- includeBlurHash?: boolean;
29
- }
30
- type ColorSamplingMode = 'balanced' | 'edge';
31
- type EdgeKey = 'top' | 'right' | 'bottom' | 'left';
32
- type EdgeColorSet = Record<EdgeKey, string>;
33
- declare const PRIMARY_AVIF_EFFORT = 6;
34
- declare const RETRY_AVIF_EFFORT = 5;
35
- declare const BLUR_PLACEHOLDER_WIDTH = 128;
36
- declare const BLUR_PLACEHOLDER_FALLBACK_WIDTH = 96;
37
- declare const BLUR_PLACEHOLDER_QUALITY = 80;
38
- declare const BLUR_PLACEHOLDER_MAX_CHARS = 8000;
39
- declare const EDGE_COLOR_FALLBACK = "#6B7280";
40
- declare const EDGE_WHITE_FALLBACK = "#F9FAFB";
41
- declare const WHITE_DOMINANCE_RATIO = 1.35;
1
+ import { O as OptimizeImageOptions, a as OptimizedImageResult, G as GenerateBlurOptions, B as BlurHashResult, E as EdgeColorSet, C as ColorSamplingMode, P as ProcessImageBufferOptions, b as ProcessedImageBufferResult, I as ImageUploaderOptions, c as ImageUploader, d as InferredPresetKey, S as StoragePathGenerator, e as StoragePathContext, f as GeneratedStorageTarget } from './index-BIdnqtW8.js';
2
+ export { A as AllowClientOverrides, g as AuthorizeContext, h as BLUR_PLACEHOLDER_FALLBACK_WIDTH, i as BLUR_PLACEHOLDER_MAX_CHARS, j as BLUR_PLACEHOLDER_QUALITY, k as BLUR_PLACEHOLDER_WIDTH, D as DEFAULT_LIMIT_INPUT_PIXELS, l as EDGE_COLOR_FALLBACK, m as EDGE_WHITE_FALLBACK, n as EdgeKey, o as PRIMARY_AVIF_EFFORT, R as RETRY_AVIF_EFFORT, U as UploadErrorContext, p as UploadHttpHandlerOptions, q as UploadValidationError, W as WHITE_DOMINANCE_RATIO, r as createUploadHandler, s as createUploadHttpHandler, t as isClientValidationError } from './index-BIdnqtW8.js';
3
+ import { k as UploadPresetConfig, c as ImageOutputFormat, e as ImageVariant } from './upload-C5Trd6Dh.js';
4
+ import { S as StorageAdapter, h as StorageUploadResult } from './types-sZ3KoFQY.js';
42
5
 
43
6
  declare function optimizeImage(buffer: Buffer, options?: OptimizeImageOptions): Promise<OptimizedImageResult>;
44
7
 
@@ -47,90 +10,11 @@ declare function generateBlurPlaceholder(buffer: Buffer, options?: GenerateBlurO
47
10
  declare const generateBlurHash: typeof generateBlurPlaceholder;
48
11
 
49
12
  declare function extractEdgeColorsFromBuffer(buffer: Buffer): Promise<EdgeColorSet>;
13
+ declare function computeEdgeColorSet(data: Buffer, width: number, height: number): EdgeColorSet;
50
14
  declare function blendEdgeColors(edgeColors: EdgeColorSet): string;
51
15
 
52
16
  declare function extractEnhancedColorFromBuffer(buffer: Buffer, mode?: ColorSamplingMode): Promise<string>;
53
17
 
54
- interface ProcessedImageBufferResult {
55
- optimized: OptimizedImageResult;
56
- blurData: BlurHashResult;
57
- contentHash: string;
58
- originalSize: number;
59
- }
60
- interface ProcessImageBufferOptions {
61
- maxDimensions?: ImageDimensions;
62
- outputFormat?: ExplicitOutputFormat;
63
- quality?: number;
64
- includeBlurHash?: boolean;
65
- optimizationTimeoutMs?: number;
66
- blurTimeoutMs?: number;
67
- }
68
- interface StoragePathContext {
69
- bucket: string;
70
- folder?: string;
71
- preset?: string;
72
- format: ImageOutputFormat;
73
- extension: string;
74
- customFilename?: string;
75
- contentHash: string;
76
- originalName?: string;
77
- metadata?: Record<string, string>;
78
- }
79
- interface GeneratedStorageTarget {
80
- bucket: string;
81
- path: string;
82
- filename: string;
83
- }
84
- type StoragePathGenerator = (context: StoragePathContext) => GeneratedStorageTarget;
85
- interface ImageUploaderOptions<TPresets extends Record<string, UploadPresetConfig> = Record<StandardPresetName, UploadPresetConfig>> {
86
- /** Pluggable storage backend (Supabase, S3, R2, Local FS, Memory, or custom) */
87
- storage: StorageAdapter;
88
- /** Default bucket name when neither `options.bucket` nor `preset.bucket` is provided (defaults to `'images'`) */
89
- defaultBucket?: string;
90
- /** Default folder prefix within the bucket (defaults to `''` or preset folder) */
91
- defaultFolder?: string;
92
- /** Default max input size in MB (defaults to `10`) */
93
- defaultMaxSizeMB?: number;
94
- /** Default allowed MIME formats */
95
- defaultAllowedFormats?: string[];
96
- /** Default max bounding box dimensions (defaults to `1920x1080`) */
97
- defaultMaxDimensions?: ImageDimensions;
98
- /**
99
- * Project-specific named presets (merged over universal `STANDARD_PRESETS` unless `includeStandardPresets: false`).
100
- * Preset names are automatically inferred in `uploader.uploadImage(file, { preset })`.
101
- */
102
- presets?: TPresets;
103
- /** Include universal visual role presets (`thumbnail`, `avatar`, `card`, `cover`, `hero`, `logo`, `original`). Defaults to `true`. */
104
- includeStandardPresets?: boolean;
105
- /** Custom storage path generator for full control over bucket/folder/filename layout */
106
- pathGenerator?: StoragePathGenerator;
107
- /** Optional database/analytics hook invoked after each successful upload */
108
- onUploadRecord?: UploadRecordHook;
109
- /** Wait for `onUploadRecord` before returning (defaults to `false` best-effort) */
110
- awaitRecordHook?: boolean;
111
- /** Max concurrent Sharp + LQIP image processing pipelines (defaults to `2`) */
112
- concurrency?: number;
113
- /** Timeout per Sharp optimization job in ms (defaults to `60000`) */
114
- optimizationTimeoutMs?: number;
115
- /** Timeout per LQIP/blur generation job in ms (defaults to `30000`) */
116
- blurTimeoutMs?: number;
117
- /** Generate compact BlurHash strings by default on every upload */
118
- includeBlurHash?: boolean;
119
- }
120
- type InferredPresetKey<TPresets extends Record<string, UploadPresetConfig>, TIncludeStandard extends boolean = true> = (keyof TPresets & string) | (TIncludeStandard extends false ? never : StandardPresetName) | (string & {});
121
- interface ImageUploader<TPreset extends string = string> {
122
- uploadImage(file: File | {
123
- buffer: Buffer;
124
- name?: string;
125
- type: string;
126
- size?: number;
127
- }, options?: ImageUploadOptions<TPreset>): Promise<UploadedImageData>;
128
- processBuffer(buffer: Buffer, options?: ProcessImageBufferOptions): Promise<ProcessedImageBufferResult>;
129
- deleteImage(path: string, bucket?: string): Promise<void>;
130
- deleteByUrl(url: string): Promise<boolean>;
131
- resolvePreset(presetName?: string): UploadPresetConfig | undefined;
132
- }
133
-
134
18
  declare function processImageBuffer(originalBuffer: Buffer, options?: ProcessImageBufferOptions): Promise<ProcessedImageBufferResult>;
135
19
 
136
20
  declare function createImageUploader<TPresets extends Record<string, UploadPresetConfig> = Record<string, UploadPresetConfig>>(options: ImageUploaderOptions<TPresets>): ImageUploader<InferredPresetKey<TPresets>>;
@@ -153,67 +37,106 @@ interface UploadWithCollisionRetryResult {
153
37
  }
154
38
  /**
155
39
  * Determines whether a storage error represents a filename or object collision.
156
- * Matches `already exists` or `EEXIST`, while strictly excluding `does not exist`
157
- * (e.g. non-existent buckets, directories, or missing keys).
40
+ * Matches `already exists`, `EEXIST`, or HTTP 412 Precondition Failed, while strictly
41
+ * excluding `does not exist` (e.g. non-existent buckets, directories, or missing keys).
158
42
  */
159
43
  declare function isCollisionError(e: unknown): boolean;
160
44
  /**
161
45
  * Uploads optimized image bytes to the storage backend with automatic filename
162
- * collision retries (or immediate `upsert: true` fallback when `customFilename` is set).
46
+ * collision retries. Server-side `customFilename` uses `upsert: true`, while
47
+ * client-supplied `customFilename` (`isClientFilename: true`) never upserts and
48
+ * appends a unique suffix on collision.
163
49
  */
164
50
  declare function uploadWithCollisionRetry(params: UploadWithCollisionRetryParams): Promise<UploadWithCollisionRetryResult>;
165
51
  interface MirrorBufferLocallyOptions {
166
52
  buffer: Buffer | Uint8Array;
167
53
  filename: string;
54
+ storagePath?: string;
168
55
  fallbackUrl: string;
169
56
  mirrorDir?: string;
170
57
  publicUrlBase?: string;
171
58
  }
172
59
  /**
173
60
  * Mirrors an uploaded image buffer to a local directory when `mirrorDir` is configured.
174
- * Safely swallows read-only filesystem errors on serverless runtimes and resolves
175
- * `publicUrlBase` when local mirroring succeeds.
61
+ * Uses non-blocking `fs/promises` I/O, safely swallows read-only filesystem errors on
62
+ * serverless runtimes, and resolves `publicUrlBase` when local mirroring succeeds.
176
63
  */
177
- declare function mirrorBufferLocally(options: MirrorBufferLocallyOptions): string;
64
+ declare function mirrorBufferLocally(options: MirrorBufferLocallyOptions): Promise<string>;
178
65
 
179
- interface UploadHttpHandlerOptions<TPreset extends string = string> {
180
- uploader: ImageUploader<TPreset>;
181
- /**
182
- * Optional authorization check. Return `false` or throw to reject with 401.
183
- */
184
- authorize?: (request: Request) => boolean | Promise<boolean>;
185
- /**
186
- * Optional whitelist of allowed preset names.
187
- */
188
- allowedPresets?: string[];
189
- /**
190
- * Allow clients to override `bucket` via FormData. Defaults to `false` for security.
191
- */
192
- allowClientBucketOverride?: boolean;
66
+ interface GenerateImageVariantsParams {
67
+ sourceBuffer: Buffer;
68
+ format: ImageOutputFormat;
69
+ quality?: number;
70
+ effort?: number;
71
+ limitInputPixels?: number;
72
+ mainWidth: number;
73
+ mainHeight: number;
74
+ mainUrl: string;
75
+ baseStoragePath: string;
76
+ baseFilename: string;
77
+ bucket: string;
78
+ storage: StorageAdapter;
79
+ variantWidths?: number[];
80
+ upsert?: boolean;
81
+ contentHash?: string;
82
+ metadata?: Record<string, string>;
83
+ mirrorDir?: string;
84
+ publicUrlBase?: string;
193
85
  }
194
- declare class UploadValidationError extends Error {
195
- readonly status = 400;
196
- constructor(message: string);
86
+ interface GeneratedVariantsResult {
87
+ variants: ImageVariant[];
88
+ srcSet?: string;
89
+ }
90
+ declare function buildVariantStoragePath(basePath: string, width: number): string;
91
+ declare function generateImageVariants(params: GenerateImageVariantsParams): Promise<GeneratedVariantsResult>;
92
+
93
+ type SniffedImageFormat = 'jpeg' | 'png' | 'gif' | 'webp' | 'avif' | 'heif' | 'tiff' | 'bmp' | 'ico' | 'svg';
94
+ interface SniffedFormatResult {
95
+ format: SniffedImageFormat;
96
+ mime: string;
197
97
  }
198
- declare function isClientValidationError(error: unknown): boolean;
199
98
  /**
200
- * Standard Web Fetch (`Request` -> `Response`) upload & delete route handlers.
201
- * Works across Next.js App Router, Remix, React Router, SvelteKit, Astro, Hono, and Node Fetch servers.
99
+ * Inspects magic bytes of a buffer to determine its true image format,
100
+ * independent of any client-supplied MIME type or file extension.
202
101
  */
203
- declare function createUploadHttpHandler<TPreset extends string = string>(options: UploadHttpHandlerOptions<TPreset>): {
204
- POST: (request: Request) => Promise<Response>;
205
- DELETE: (request: Request) => Promise<Response>;
206
- };
102
+ declare function sniffImageFormat(input: Buffer | Uint8Array): SniffedFormatResult | null;
103
+ declare function assertMagicBytesAllowed(buffer: Buffer | Uint8Array, allowedFormats: string[], allowSvg?: boolean): SniffedFormatResult;
207
104
 
105
+ declare const DEFAULT_MAX_SVG_BYTES: number;
106
+ interface SanitizeSvgOptions {
107
+ maxBytes?: number;
108
+ }
109
+ /**
110
+ * Dependency-free SVG sanitizer.
111
+ * Strips `<script>`, `<foreignObject>`, `<iframe|embed|object>`, `<!DOCTYPE>`/`<!ENTITY>`,
112
+ * custom XML entities, `on*` event attributes, and non-fragment / non-raster-data `href`s.
113
+ */
114
+ declare function sanitizeSvg(input: Buffer | string, options?: SanitizeSvgOptions): Buffer;
115
+
116
+ declare class SemaphoreQueueFullError extends Error {
117
+ readonly status = 503;
118
+ constructor(message?: string);
119
+ }
120
+ interface SemaphoreOptions {
121
+ maxQueue?: number;
122
+ }
123
+ interface SemaphoreRunOptions {
124
+ signal?: AbortSignal;
125
+ timeoutMs?: number;
126
+ label?: string;
127
+ }
208
128
  declare class AsyncSemaphore {
209
129
  private readonly concurrency;
210
130
  private activeCount;
131
+ private readonly maxQueue?;
211
132
  private readonly queue;
212
- constructor(concurrency: number);
213
- run<T>(task: () => Promise<T>): Promise<T>;
133
+ constructor(concurrency: number, options?: SemaphoreOptions | number);
134
+ get active(): number;
135
+ get pending(): number;
136
+ run<T>(task: () => Promise<T>, options?: SemaphoreRunOptions): Promise<T>;
214
137
  private acquire;
215
138
  private release;
216
139
  }
217
140
  declare function withTimeout<T>(task: Promise<T>, timeoutMs: number, label: string): Promise<T>;
218
141
 
219
- export { AsyncSemaphore, BLUR_PLACEHOLDER_FALLBACK_WIDTH, BLUR_PLACEHOLDER_MAX_CHARS, BLUR_PLACEHOLDER_QUALITY, BLUR_PLACEHOLDER_WIDTH, type BlurHashResult, type ColorSamplingMode, EDGE_COLOR_FALLBACK, EDGE_WHITE_FALLBACK, type EdgeColorSet, type EdgeKey, type GenerateBlurOptions, type GeneratedStorageTarget, type ImageUploader, type ImageUploaderOptions, type InferredPresetKey, type MirrorBufferLocallyOptions, type OptimizeImageOptions, type OptimizedImageResult, PRIMARY_AVIF_EFFORT, type ProcessImageBufferOptions, type ProcessedImageBufferResult, RETRY_AVIF_EFFORT, type StoragePathContext, type StoragePathGenerator, type UploadHttpHandlerOptions, UploadValidationError, type UploadWithCollisionRetryParams, type UploadWithCollisionRetryResult, WHITE_DOMINANCE_RATIO, blendEdgeColors, createDefaultPathGenerator, createImageUploader, createUploadHttpHandler, encodeBlurHashString, extractEdgeColorsFromBuffer, extractEnhancedColorFromBuffer, formatToExtension, generateBlurHash, generateBlurPlaceholder, isClientValidationError, isCollisionError, mirrorBufferLocally, optimizeImage, processImageBuffer, sanitizeSegment, uploadWithCollisionRetry, withTimeout };
142
+ export { AsyncSemaphore, BlurHashResult, ColorSamplingMode, DEFAULT_MAX_SVG_BYTES, EdgeColorSet, GenerateBlurOptions, type GenerateImageVariantsParams, GeneratedStorageTarget, type GeneratedVariantsResult, ImageUploader, ImageUploaderOptions, InferredPresetKey, type MirrorBufferLocallyOptions, OptimizeImageOptions, OptimizedImageResult, ProcessImageBufferOptions, ProcessedImageBufferResult, type SanitizeSvgOptions, type SemaphoreOptions, SemaphoreQueueFullError, type SemaphoreRunOptions, type SniffedFormatResult, type SniffedImageFormat, StoragePathContext, StoragePathGenerator, type UploadWithCollisionRetryParams, type UploadWithCollisionRetryResult, assertMagicBytesAllowed, blendEdgeColors, buildVariantStoragePath, computeEdgeColorSet, createDefaultPathGenerator, createImageUploader, encodeBlurHashString, extractEdgeColorsFromBuffer, extractEnhancedColorFromBuffer, formatToExtension, generateBlurHash, generateBlurPlaceholder, generateImageVariants, isCollisionError, mirrorBufferLocally, optimizeImage, processImageBuffer, sanitizeSegment, sanitizeSvg, sniffImageFormat, uploadWithCollisionRetry, withTimeout };