import type { HistoricalDataset } from '../types.js';
import { loadDatasetFromJsonPayload } from './jsonLoader.js';

export interface ReadOnlyReplayAdapter {
    loadHistoricalDataset(): Promise<HistoricalDataset> | HistoricalDataset;
}

export class InlineReplayAdapter implements ReadOnlyReplayAdapter {
    constructor(private payload: unknown) { }

    loadHistoricalDataset(): HistoricalDataset {
        return loadDatasetFromJsonPayload(this.payload);
    }
}

