22 lines
706 B
TypeScript
22 lines
706 B
TypeScript
import { injectable } from 'inversify';
|
|
import { Service } from '../../core/container';
|
|
import { inject } from '../../core/inject';
|
|
import type { NhentaiAppWindowInterface } from './nhentai-app-window-interface';
|
|
|
|
@injectable()
|
|
export class NhentaiApi implements NhentaiApiInterface {
|
|
private readonly appWindow: NhentaiAppWindowInterface;
|
|
|
|
public constructor(@inject(Service.NHENTAI_APP_WINDOW) appWindow: NhentaiAppWindowInterface) {
|
|
this.appWindow = appWindow;
|
|
}
|
|
|
|
public getFavorites(): Promise<NodeJS.ReadableStream> {
|
|
return this.appWindow.getFavorites();
|
|
}
|
|
|
|
public getGallery(identifier: string): Promise<Nhentai.Gallery> {
|
|
return this.appWindow.getGallery(identifier);
|
|
}
|
|
}
|