mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
29 lines
698 B
TypeScript
29 lines
698 B
TypeScript
import type { ServerAdapter } from '$lib/server-adapters/types'
|
|
import * as extensions from './extensions'
|
|
import * as chapters from './chapters'
|
|
import * as downloads from './downloads'
|
|
import * as manga from './manga'
|
|
import * as tracking from './tracking'
|
|
|
|
let adapter: ServerAdapter
|
|
|
|
export function initRequestManager(a: ServerAdapter) {
|
|
adapter = a
|
|
}
|
|
|
|
export function getAdapter(): ServerAdapter {
|
|
if (!adapter) throw new Error('RequestManager not initialized')
|
|
return adapter
|
|
}
|
|
|
|
export function clearPageCache(chapterId?: number): void {
|
|
getAdapter().clearPageCache(chapterId)
|
|
}
|
|
|
|
export const requestManager = {
|
|
extensions,
|
|
chapters,
|
|
downloads,
|
|
manga,
|
|
tracking,
|
|
} |