import { Injectable, inject } from '@angular/core';
import { AttachmentManagerService } from '../services/attachment-manager.service';

@Injectable({ providedIn: 'root' })
export class AttachmentFacade {
  get updated() {
    return this.manager.updated;
  }

  private readonly manager = inject(AttachmentManagerService);

  getForMessage(
    ...args: Parameters<AttachmentManagerService['getForMessage']>
  ): ReturnType<AttachmentManagerService['getForMessage']> {
    return this.manager.getForMessage(...args);
  }

  rememberMessageRoom(
    ...args: Parameters<AttachmentManagerService['rememberMessageRoom']>
  ): ReturnType<AttachmentManagerService['rememberMessageRoom']> {
    return this.manager.rememberMessageRoom(...args);
  }

  queueAutoDownloadsForMessage(
    ...args: Parameters<AttachmentManagerService['queueAutoDownloadsForMessage']>
  ): ReturnType<AttachmentManagerService['queueAutoDownloadsForMessage']> {
    return this.manager.queueAutoDownloadsForMessage(...args);
  }

  requestAutoDownloadsForRoom(
    ...args: Parameters<AttachmentManagerService['requestAutoDownloadsForRoom']>
  ): ReturnType<AttachmentManagerService['requestAutoDownloadsForRoom']> {
    return this.manager.requestAutoDownloadsForRoom(...args);
  }

  deleteForMessage(
    ...args: Parameters<AttachmentManagerService['deleteForMessage']>
  ): ReturnType<AttachmentManagerService['deleteForMessage']> {
    return this.manager.deleteForMessage(...args);
  }

  getAttachmentMetasForMessages(
    ...args: Parameters<AttachmentManagerService['getAttachmentMetasForMessages']>
  ): ReturnType<AttachmentManagerService['getAttachmentMetasForMessages']> {
    return this.manager.getAttachmentMetasForMessages(...args);
  }

  registerSyncedAttachments(
    ...args: Parameters<AttachmentManagerService['registerSyncedAttachments']>
  ): ReturnType<AttachmentManagerService['registerSyncedAttachments']> {
    return this.manager.registerSyncedAttachments(...args);
  }

  requestFromAnyPeer(
    ...args: Parameters<AttachmentManagerService['requestFromAnyPeer']>
  ): ReturnType<AttachmentManagerService['requestFromAnyPeer']> {
    return this.manager.requestFromAnyPeer(...args);
  }

  handleFileNotFound(
    ...args: Parameters<AttachmentManagerService['handleFileNotFound']>
  ): ReturnType<AttachmentManagerService['handleFileNotFound']> {
    return this.manager.handleFileNotFound(...args);
  }

  requestImageFromAnyPeer(
    ...args: Parameters<AttachmentManagerService['requestImageFromAnyPeer']>
  ): ReturnType<AttachmentManagerService['requestImageFromAnyPeer']> {
    return this.manager.requestImageFromAnyPeer(...args);
  }

  tryRestoreAttachmentFromLocal(
    ...args: Parameters<AttachmentManagerService['tryRestoreAttachmentFromLocal']>
  ): ReturnType<AttachmentManagerService['tryRestoreAttachmentFromLocal']> {
    return this.manager.tryRestoreAttachmentFromLocal(...args);
  }

  requestFile(
    ...args: Parameters<AttachmentManagerService['requestFile']>
  ): ReturnType<AttachmentManagerService['requestFile']> {
    return this.manager.requestFile(...args);
  }

  publishAttachments(
    ...args: Parameters<AttachmentManagerService['publishAttachments']>
  ): ReturnType<AttachmentManagerService['publishAttachments']> {
    return this.manager.publishAttachments(...args);
  }

  handleFileAnnounce(
    ...args: Parameters<AttachmentManagerService['handleFileAnnounce']>
  ): ReturnType<AttachmentManagerService['handleFileAnnounce']> {
    return this.manager.handleFileAnnounce(...args);
  }

  handleFileChunk(
    ...args: Parameters<AttachmentManagerService['handleFileChunk']>
  ): ReturnType<AttachmentManagerService['handleFileChunk']> {
    return this.manager.handleFileChunk(...args);
  }

  handleFileRequest(
    ...args: Parameters<AttachmentManagerService['handleFileRequest']>
  ): ReturnType<AttachmentManagerService['handleFileRequest']> {
    return this.manager.handleFileRequest(...args);
  }

  cancelRequest(
    ...args: Parameters<AttachmentManagerService['cancelRequest']>
  ): ReturnType<AttachmentManagerService['cancelRequest']> {
    return this.manager.cancelRequest(...args);
  }

  handleFileCancel(
    ...args: Parameters<AttachmentManagerService['handleFileCancel']>
  ): ReturnType<AttachmentManagerService['handleFileCancel']> {
    return this.manager.handleFileCancel(...args);
  }

  fulfillRequestWithFile(
    ...args: Parameters<AttachmentManagerService['fulfillRequestWithFile']>
  ): ReturnType<AttachmentManagerService['fulfillRequestWithFile']> {
    return this.manager.fulfillRequestWithFile(...args);
  }
}
