import {MemoryBranchNode} from "../MemoryBranchNode";
import {BranchData, BranchNode, StateBranchNode} from "../StateBranchNode";
import {GroveExporter} from "./GroveExporter";

export interface StoreExporter<Format> {
    export(target: ExportImportTarget): Format;
}

/**
 * This is an internal exporter, that is, one that exports internal data, no data to export is passed to its arguments.
 */
export interface DataExporter<Out> {
    exportData(target: ExportImportTarget, groveExporter?: GroveExporter): Out
}

export interface BranchExporter {
    canExport(branch: BranchNode): boolean;

    export<ExtraData extends Record<any, any> = Record<any, any>, ChildrenType = any>(branch: BranchNode): BranchData<ExtraData, ChildrenType>;
}

export type ExportImportTarget = 'preset' | 'server' | 'clone-tier'