import { Atom } from './Atom2'; /** * Defines a map of hashes to Atom IDs. */ export interface AtomHashList { [id: string]: string; } /** * Defines a map of Atom IDs to atoms. */ export interface AtomList { [id: string]: Atom; } /** * Defines an index of atoms. * That is, a hashed list of atoms. */ export interface AtomIndex { /** * The hash of the index. */ hash: string; /** * The atoms in the list. */ atoms: AtomHashList; } /** * Defines an diff between atom indexes. */ export interface AtomIndexDiff { /** * The list of atoms that were added. */ additions: AtomHashList; /** * The list of atoms that were deleted. */ deletions: AtomHashList; } /** * Defines a diff between atom indexes where added and changed atoms have been * substituted with their full atom data. */ export interface AtomIndexFullDiff { /** * The list of atoms that were added. */ additions: Atom[]; /** * The list of atoms that were deleted. */ deletions: AtomHashList; } /** * Creates a new weave index from the given list of atoms. * @param atoms The atoms. */ export declare function createIndex(atoms: Atom[]): AtomIndex; /** * Creates an index diff from the given atoms. * @param added The atoms that were added. * @param deleted The atoms that were deleted. */ export declare function createIndexDiff(added: Atom[], deleted?: Atom[]): AtomIndexDiff; /** * Hashes the given list of atoms. * @param atoms The list of atoms to hash. */ export declare function hashAtoms(atoms: Atom[]): string; /** * Calculates the diff between the two atom indexes. * @param first The first index. * @param second The second index. */ export declare function calculateDiff(first: AtomIndex, second: AtomIndex): AtomIndexDiff; /** * Determines if the given value is an atom index. * @param value the value. */ export declare function isAtomIndex(value: unknown): value is AtomIndex; /** * Gets the hashes of the atoms stored in the index. * @param index The index. */ export declare function getAtomHashes(index: AtomHashList): string[]; //# sourceMappingURL=AtomIndex.d.ts.map