import type { BobbinContext, XrpcRequestInit } from './client';
import { jsonGet } from './_request';

export interface Coverage {
	ready: boolean;
	eventsProcessed: number;
	lastCursor: number;
}

export const getCoverage = (ctx: BobbinContext, init?: XrpcRequestInit): Promise<Coverage> =>
	jsonGet<Coverage>(ctx, 'sh.tangled.bobbin.getCoverage', undefined, init);
