import { injectable } from 'inversify';
import { inject } from '../../core/inject';
import { INhentaiApi } from './i-nhentai-api';
import { INhentaiAppWindow } from './i-nhentai-app-window';

@injectable()
export class NhentaiApi implements INhentaiApi {
  private readonly appWindow: INhentaiAppWindow;

  public constructor(@inject('nhentai-app-window') appWindow: INhentaiAppWindow) {
    this.appWindow = appWindow;
  }

  public getFavorites(): Promise<NodeJS.ReadableStream> {
    return this.appWindow.getFavorites();
  }
}
