gadl/platform.ts

17 lines
379 B
TypeScript
Raw Normal View History

2023-11-19 16:18:00 +09:00
import type { Database } from "./database";
import type { Browser } from "./browser";
import { DmmBooks } from "./platforms/dmm-books";
2023-11-19 02:25:32 +09:00
2023-11-19 16:18:00 +09:00
export function createPlatform(db: Database, browser: Browser) {
const platform = DmmBooks(db, browser);
2023-11-19 02:25:32 +09:00
return {
async login() {
await platform.login();
},
2023-11-19 16:18:00 +09:00
async logout() {
await platform.logout();
},
2023-11-19 02:25:32 +09:00
};
}