/** * PresetManager - Device-aware variant preset management * * Manages transformation presets for generating optimized file variants * based on device type, file category, and custom configurations. * * Features: * - Built-in presets (profile-picture, post-image, hero-banner, video-streaming) * - Custom preset registration * - Device-aware variant selection (mobile, tablet, desktop, 4K, TV, watch) * - Default variants by file category * - Preset composition (combine multiple presets) * - Variant resolution and merging * * @example * ```ts * const presetManager = new PresetManager({ * enableBuiltInPresets: true, * defaultDevice: STORAGE_DEVICE_TYPE.AUTO, * }); * * // Register custom preset * presetManager.registerPreset({ * name: 'custom-profile', * variants: ['thumbnail', 'medium', 'large'], * format: 'webp', * quality: 90, * }); * * // Resolve variants for upload * const variants = presetManager.resolveVariants({ * presets: ['profile-picture'], * device: STORAGE_DEVICE_TYPE.MOBILE, * category: FILE_CATEGORY.ProfileImage, * }); * ``` */ import type { FILE_CATEGORY, StoragePresetConfig, StorageVariantConfig, StoragePresetManagerConfig, StorageResolveVariantsOptions } from '@plyaz/types/storage'; /** * PresetManager class * Manages variant presets and device-aware optimization */ export declare class PresetManager { private presets; private defaultVariants; private config; private logger?; constructor(config?: StoragePresetManagerConfig); /** * Register a preset */ registerPreset(preset: StoragePresetConfig): void; /** * Get a preset by name */ getPreset(name: string): StoragePresetConfig | undefined; /** * Get all registered presets */ getAllPresets(): StoragePresetConfig[]; /** * Resolve variants from presets, custom variants, and device context * This is the main entry point for variant resolution */ resolveVariants(options: StorageResolveVariantsOptions): StorageVariantConfig[]; /** * Resolve preset names to variant configurations */ private resolvePresetsToVariants; /** * Resolve a single preset to variants */ private resolvePresetVariants; /** * Resolve variant names to variant configurations */ private resolveVariantNames; /** * Get variant configuration by name * Maps standard variant names to device-aware configurations */ private getVariantConfigByName; /** * Normalize variants (string[] or StorageVariantConfig[]) to StorageVariantConfig[] */ private normalizeVariants; /** * Get default variants for a file category */ getDefaultVariants(category: FILE_CATEGORY): string[]; /** * Set default variants for a category */ setDefaultVariants(category: FILE_CATEGORY, variantNames: string[]): void; /** * Register built-in presets */ private registerBuiltInPresets; /** * Load default variants by category */ private loadDefaultVariants; /** * Log helper */ private log; }