import { RenditionEntry } from '@alfresco/js-api'; import { default as QuickLRU } from 'quick-lru'; declare const _default: AlfrescoFileService; export default _default; /** * Service class for managing files and renditions in Alfresco. */ declare class AlfrescoFileService { lruUrls: QuickLRU; pendingRenditions: Set; failedRenditions: QuickLRU; getThumbnailUrl(nodeId: any): any; getPreviewUrl(nodeId: any): any; getContentUrl(nodeId: any): any; getVersionContentUrl(nodeId: any, versionId: any): any; uploadFile(nodeId: any, opts: any, file: any): any; createRendition(nodeId: any, rendition: any): Promise; createAllRendition(nodeId: any): Promise; /** * Request creation of the wanted renditions, but only those that are both * applicable to the node (present in listRenditions) and not yet created. * * Unlike {@link createAllRendition}, this never asks Alfresco to transform a * type that cannot produce the rendition (archives, binaries, ...), avoiding * the failed createRendition calls that polluted the logs. * * @param nodeId * @param wanted rendition ids to ensure, default ["doclib", "imgpreview"] * @returns {Promise<*>} */ createMissingRenditions(nodeId: any, wanted?: string[]): Promise; _createRendition(nodeId: any, renditionBodyCreate: any): Promise; createVersionRendition(nodeId: any, versionId: any, rendition: any): Promise; getVersionRendition(nodeId: any, versionId: any, renditionId: any): Promise< RenditionEntry>; /** * Safely handles thumbnail fallback by hiding the image container * and showing the fallback icon. Uses requestAnimationFrame to avoid * blocking the main thread during Vue's render cycle. * @param {Event} event - The error event from the image element */ handleThumbnailFallback(event: Event): void; /** * Handles image load failures by showing a fallback icon and optionally * requesting rendition creation. Includes deduplication to prevent * cascading API calls when many images fail simultaneously. * @param {Event} event - The error event from the image element * @param {Object} node - The Alfresco node object */ onImageLoadFailure(event: Event, node: any): void; isThumbnailSupported(node: any): any; /** * Status of a rendition from a listRenditions/listVersionRenditions response. * @param paging RenditionPaging response * @param rendition the rendition id (e.g. "pdf") * @returns {string|null} "CREATED" / "NOT_CREATED", or null when the rendition * is not applicable to the node (i.e. cannot be produced for its mimetype) */ _findRenditionStatus(paging: any, rendition: any): string | null; /** * Build the error thrown when a rendition cannot be produced for a node. * Callers can detect it via `error.code === "RENDITION_NOT_AVAILABLE"` to * show the default icon / a download-only view instead of retrying. */ _renditionNotAvailable(nodeId: any, rendition: any): Error; /** * Poll a not-yet-created rendition until it becomes CREATED, then resolve its * content URL. Rejects once retries are exhausted. * @param getRendition () => Promise * @param getUrl () => string content URL once the rendition is ready * @param rendition the rendition id, for logging */ _waitForRendition(getRendition: any, getUrl: any, rendition: any): any; /** * Resolve the content URL of a node rendition. * * Lists the renditions applicable to the node first: listRenditions returns * every rendition *possible* for the node's source mimetype, each with a * status (CREATED / NOT_CREATED). We decide up-front instead of blindly * requesting a rendition for a type that cannot produce it (which only * generated errors and log noise): * - rendition absent from the list -> reject with RENDITION_NOT_AVAILABLE * - CREATED -> return its content URL * - NOT_CREATED -> request creation, then wait until ready * * @param nodeId * @param rendition default "pdf" * @returns {Promise} the rendition content URL */ getRenditionUrl(nodeId: any, rendition?: string): Promise; /** * Resolve the content URL of a version rendition. Same strategy as * {@link getRenditionUrl}, using the version rendition endpoints. * * @param nodeId * @param versionId * @param rendition default "pdf" * @returns {Promise} the rendition content URL */ getVersionRenditionUrl(nodeId: any, versionId: any, rendition?: string): Promise; getProtocolForFileExtension(fileExtension: any): any; getFileExtension(fileName: any): any; isDoc(item: any): boolean; toggleMSOfficeVue(node: any): void; canOpenWithMSOffice(item: any): boolean; triggerEditOnlineAos(node: any): void; aos_tryToLaunchOfficeByMsProtocolHandler(protocolHandler: any, url: any): void; isWindows(): boolean; isMacOs(): boolean; getUserAgent(): string; isMSOfficeDoc(item: any): boolean; /** * Gère un upload de fichier unique avec suivi de progression. * @param {string} nodeId - L'ID du noeud parent où uploader. * @param {object} opts - Les options pour l'API Alfresco. * @param {File} file - Le fichier à uploader. * @returns {Promise} Une promesse qui se résout avec la réponse de l'API. */ uploadFileWithProgress(nodeId: string, opts: object, file: File): Promise; /** * Génère le contenu du tooltip pour un nœud verrouillé en fonction de son type de lock. * * Utilise les traductions i18n définies dans le namespace `lock.*` : * - lock.nodeLock * - lock.readOnlyLock * - lock.writeLock * * Chaque traduction reçoit en paramètre l'owner du lock (displayName ou id). * * @param {Object} node - Le nœud concerné. * @param {Object} node.properties - Propriétés du nœud. * @param {string} node.properties["cm:lockType"] - Type de verrou appliqué au nœud. * Peut être : * - "NODE_LOCK" → Personne ne peut mettre à jour ou supprimer le nœud. * - "READ_ONLY_LOCK" → Personne ne peut mettre à jour/supprimer le nœud, ni ajouter d'enfants. * - "WRITE_LOCK" → Seul le propriétaire peut modifier, supprimer ou ajouter des enfants. * @param {Object} [node.properties["cm:lockOwner"]] - Informations sur le propriétaire du lock. * @param {string} [node.properties["cm:lockOwner"].displayName] - Nom affiché du propriétaire. * @param {string} [node.properties["cm:lockOwner"].id] - Identifiant du propriétaire si `displayName` est absent. * * @returns {string} - Message formaté pour affichage dans le tooltip. * Retourne une traduction i18n si le lockType est reconnu, * sinon un message générique avec le type et le propriétaire. */ tooltipLockContent(node: { properties: any; properties: any; properties?: any; properties?: any; properties?: any; }): string; /** * Filter predicate for path elements, skipping the root folder * (whose name is locale-dependent) and other system nodes. * Designed to be used with Array.filter() on node.path.elements. */ isPathElementVisible(item: any, index: any): boolean; } //# sourceMappingURL=AlfrescoFileService.d.ts.map