2020-08-08 18:23:29 +02:00
|
|
|
import { injectable } from 'inversify';
|
2021-01-30 22:34:36 +01:00
|
|
|
import { Service } from '../../core/container';
|
2020-08-08 18:23:29 +02:00
|
|
|
import { inject } from '../../core/inject';
|
2021-01-06 02:35:46 +01:00
|
|
|
import type { NhentaiAppWindowInterface } from './nhentai-app-window-interface';
|
2020-02-08 23:26:57 +01:00
|
|
|
|
|
|
|
@injectable()
|
2021-01-06 02:35:46 +01:00
|
|
|
export class NhentaiApi implements NhentaiApiInterface {
|
|
|
|
private readonly appWindow: NhentaiAppWindowInterface;
|
2020-02-08 23:26:57 +01:00
|
|
|
|
2021-01-30 22:34:36 +01:00
|
|
|
public constructor(@inject(Service.NHENTAI_APP_WINDOW) appWindow: NhentaiAppWindowInterface) {
|
2020-11-09 18:15:30 +01:00
|
|
|
this.appWindow = appWindow;
|
2020-02-08 23:26:57 +01:00
|
|
|
}
|
|
|
|
|
2020-11-09 18:15:30 +01:00
|
|
|
public getFavorites(): Promise<NodeJS.ReadableStream> {
|
|
|
|
return this.appWindow.getFavorites();
|
2020-02-08 23:26:57 +01:00
|
|
|
}
|
2021-01-07 04:51:07 +01:00
|
|
|
|
|
|
|
public getGallery(identifier: string): Promise<Nhentai.Gallery> {
|
|
|
|
return this.appWindow.getGallery(identifier);
|
|
|
|
}
|
2020-02-08 23:26:57 +01:00
|
|
|
}
|