812dac9920
* Use BatchingQueue instead of BatchedPool as parsing download happens on main thread anyway * add tests for keyedqueue * clean up * more prettier fix
19 lines
455 B
TypeScript
19 lines
455 B
TypeScript
import Queue from '../queues/queue.js'
|
|
import { Item } from '../types/types.js'
|
|
|
|
export interface Downloader extends Queue<string> {
|
|
initialize(params: {
|
|
results: Queue<Item>
|
|
total: number
|
|
maxDownloadBatchWait?: number
|
|
}): void
|
|
downloadSingle(): Promise<Item>
|
|
disposeAsync(): Promise<void>
|
|
}
|
|
|
|
export interface Database {
|
|
getAll(ids: string[]): Promise<(Item | undefined)[]>
|
|
putAll(batch: Item[]): Promise<void>
|
|
dispose(): void
|
|
}
|