import { Config } from '../Config.js';
import type { Entry, EntryStatus } from '../Entry.js';
import type { ChangesBatch } from '../source/Change.js';
import { type Source } from '../source/Source.js';
import { ReadonlyTree } from '../source/Tree.js';
import { Type } from '../Type.js';
import { EntryTransaction } from './EntryTransaction.js';
export interface EntryFilter {
    ids?: ReadonlyArray<string>;
    search?: string;
    condition?(entry: Entry): boolean;
}
export interface EntryCondition {
    search?: string;
    nodes?: Iterable<EntryNode>;
    node?(node: EntryNode): boolean;
    language?(language: EntryLanguageNode): boolean;
    entry?(entry: Entry): boolean;
}
export declare function combineConditions(a: EntryCondition, b: EntryCondition): EntryCondition;
interface EntryVersionData {
    id: string;
    type: string;
    index: string;
    searchableText: string;
    title: string;
    data: Record<string, unknown>;
    seeded: string | null;
    rowHash: string;
    fileHash: string;
}
interface EntryVersion extends EntryVersionData {
    locale: string | null;
    workspace: string;
    root: string;
    path: string;
    status: EntryStatus;
    parentDir: string;
    childrenDir: string;
    filePath: string;
    level: number;
}
declare class EntryLanguage extends Map<EntryStatus, EntryVersion> {
    readonly locale: string | null;
    readonly parentDir: string;
    readonly selfDir: string;
    constructor(versions: Array<EntryVersion>);
}
declare class EntryCollection extends Map<string | null, EntryLanguage> {
    versions: Array<EntryVersion>;
    readonly type: string;
    constructor(versions: Array<EntryVersion>);
}
declare class EntryLanguageNode {
    #private;
    private node;
    private language;
    inheritedStatus: EntryStatus | undefined;
    main: EntryVersion;
    active: EntryVersion;
    url: string;
    locale: string | null;
    path: string;
    readonly seeded: string | null;
    constructor(node: EntryNode, language: EntryLanguage);
    [Symbol.iterator](): MapIterator<[EntryStatus, EntryVersion]>;
    has(status: EntryStatus): boolean;
    get parentPaths(): string[];
    get entries(): Entry<Record<string, unknown>>[];
    filter(filter: EntryCondition): Generator<Entry>;
}
export declare class EntryNode extends Map<string | null, EntryLanguageNode> {
    entryType: Type;
    parent: EntryNode | null;
    children: () => Iterable<EntryNode>;
    readonly id: string;
    readonly index: string;
    readonly parentId: string | null;
    readonly parents: Array<string>;
    readonly workspace: string;
    readonly root: string;
    readonly type: string;
    readonly level: number;
    constructor(entryType: Type, parent: EntryNode | null, children: () => Iterable<EntryNode>, collection: EntryCollection);
    filter(filter: EntryCondition): Generator<Entry>;
}
export declare class EntryGraph {
    #private;
    nodes: Array<EntryNode>;
    constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
    byId(id: string): EntryNode | undefined;
    byDir(dir: string): EntryNode | undefined;
    withChanges(batch: ChangesBatch): EntryGraph;
    filter({ search, ...filter }: EntryCondition): Generator<Entry>;
}
export declare class EntryIndex extends EventTarget {
    #private;
    tree: ReadonlyTree;
    initialSync: ReadonlyTree | undefined;
    graph: EntryGraph;
    constructor(config: Config);
    get sha(): string;
    filter(filter: EntryCondition): Iterable<Entry>;
    findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
    findMany(filter: (entry: Entry) => boolean): Iterable<Entry>;
    syncWith(source: Source): Promise<string>;
    indexChanges(batch: ChangesBatch): Promise<string>;
    seed(source: Source): Promise<void>;
    byId(id: string): EntryNode | undefined;
    fix(source: Source): Promise<void>;
    transaction(source: Source): Promise<EntryTransaction>;
}
interface Seed {
    seedId: string;
    type: string;
    workspace: string;
    root: string;
    locale: string | null;
    data: Record<string, any>;
}
export {};
