import { files } from '@wix/media'; /** * Gets or creates the "My Brand Logos" folder and returns its ID. * If the folder already exists, returns its ID. Otherwise, creates it and returns the new folder ID. */ export declare function getOrCreateBrandLogosFolder(): Promise; export declare function isFileDuplicateInFolder(fileUrl: string, folderId: string): Promise; export declare function fetchLogoDataFromLogoMaker(): Promise<{ isPurchased: any; primaryLogoId: any; brandId: any; } | { isPurchased?: undefined; primaryLogoId?: undefined; brandId?: undefined; }>; export declare function fetchDesignFromLogoMaker(logoId: string): Promise; export declare const hasDataChanged: (data: string) => boolean; export declare function openLogoEditorInDashboardModal(logoId: string, brandId: string, siteColors: Record): Promise; export declare function handleOpenOnboardingFlowInDashboardModal(siteColors: Record): Promise; export declare function openWixMediaManager(): Promise; export declare function removeBackgroundFromImage(currentLogoUrl: string): Promise; /** * Imports a file from an external URL to the Wix Media Manager with retry logic and cancellation support. * * This function handles the complex process of importing external files to Media Manager, including: * - Automatic retry logic with exponential backoff * - AbortController integration for operation cancellation * - Proper error handling for different failure scenarios * - Timeout handling to prevent indefinite waiting * * @param fileUrl - The URL of the file to import to Media Manager * @param signal - Optional AbortSignal for cancelling the operation * * @returns Promise<{url: string, mediaUri?: string, width?: number, height?: number, fileName?: string} | undefined> - The Media Manager file data, or undefined if import failed * * @throws {DOMException} - Throws 'AbortError' when the operation is cancelled via AbortSignal * @throws {Error} - Throws with message 'Failed to import file to media manager' when the import operation fails * @throws {Error} - Throws with message 'Import to media manager timed out after retries' when all retries are exhausted * * @internal * **Implementation Details:** * * **Retry Logic:** * - Maximum retries: 6 attempts * - Retry delay: 300ms between attempts * - Retries occur when file status is 'PROCESSING' * - Operation fails immediately on 'FAILED' status * - Operation succeeds immediately on 'READY' status * * **AbortController Integration:** * - Checks for cancellation before each retry attempt * - Checks for cancellation during delay periods * - Properly cleans up timeouts when cancelled * - Throws DOMException with name 'AbortError' for consistency * * **Error Scenarios:** * 1. **Import Failure**: When `files.importFile()` fails * 2. **Processing Failure**: When file status becomes 'FAILED' * 3. **Timeout**: When file doesn't become 'READY' after 6 retries (1.8 seconds total) * 4. **Cancellation**: When AbortSignal is triggered * * **File Status Flow:** * ``` * INITIAL → PROCESSING → READY (Success) * ↘ FAILED (Error) * ``` */ export declare function importFileToMyLogosFolder(fileUrl: string, options?: { skipIfFileAlreadyExists: boolean; }): Promise<(files.ImportFileResponse & { __validationErrorsType?: files.ImportFileValidationErrors; }) | undefined>; export declare function importFileToMyLogosFolderAndWaitUntilReady(fileUrl: string, signal?: AbortSignal): Promise<{ url: string | undefined; mediaUri: string; width: number; height: number; fileName: undefined; }>; export declare const getFullUrlFromImageId: (imageId: string) => Promise; /** * Extracts the image ID from a Wix image URL. * The image ID is everything before the first '~' character. * * @param imageUrl - The Wix image URL (e.g., "810ffb_4dc51c68745f42d6851d6654be359f98~mv2.png") * @returns The image ID or empty string if not found */ export declare const extractImageIdFromUrl: (imageUrl: string) => string; /** * Gets image dimensions from a Wix image ID * * @param imageId - The Wix image id * @returns Promise<{width: number, height: number} | undefined> - Image dimensions or undefined if failed */ export declare const getImageDimensionsFromId: (imageId: string) => Promise<{ width: number; height: number; } | undefined>; export declare const buildAltTextFromBusinessName: (businessName: string) => string; /** * Determines if the alt text should be replaced with the business name. * Returns true if the alt text is empty/undefined or is still the default value. */ export declare const shouldUseBusinessNameForAltText: (existingAltText: string | undefined) => boolean; export declare const isSupportedForBackgroundRemoval: (fileUrl: string | undefined) => boolean;