21 lines
652 B
TypeScript
21 lines
652 B
TypeScript
import { injectable } from 'inversify';
|
|
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('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);
|
|
}
|
|
}
|