export { BaseEntry, Change, GitProvider, FileType, Oid, Path, Point, Range } from "./support";
import { BufferId, ChangeObserver, ChangeObserverCallback, GitProvider, FileType, Oid, Path, Range, Tagged } from "./support";
export declare function init(): Promise<{
    WorkTree: typeof WorkTree;
}>;
export declare type Version = Tagged<string, "Version">;
export declare type Operation = Tagged<Uint8Array, "Operation">;
export declare type ReplicaId = Tagged<string, "ReplicaId">;
export interface OperationEnvelope {
    epochTimestamp(): number;
    epochReplicaId(): ReplicaId;
    operation(): Operation;
}
export declare enum FileStatus {
    New = "New",
    Renamed = "Renamed",
    Removed = "Removed",
    Modified = "Modified",
    RenamedAndModified = "RenamedAndModified",
    Unchanged = "Unchanged"
}
export interface Entry {
    readonly depth: number;
    readonly type: FileType;
    readonly name: string;
    readonly path: string;
    readonly status: FileStatus;
    readonly visible: boolean;
}
export declare class WorkTree {
    private tree;
    private observer;
    static create(base: Oid | null, startOps: ReadonlyArray<Operation>, git: GitProvider): [WorkTree, AsyncIterable<OperationEnvelope>];
    private constructor();
    reset(base: Oid | null): AsyncIterable<OperationEnvelope>;
    applyOps(ops: Operation[]): AsyncIterable<OperationEnvelope>;
    createFile(path: Path, fileType: FileType): OperationEnvelope;
    rename(oldPath: Path, newPath: Path): OperationEnvelope;
    remove(path: Path): OperationEnvelope;
    entries(options?: {
        descendInto?: Path[];
        showDeleted?: boolean;
    }): Entry[];
    openTextFile(path: Path): Promise<Buffer>;
}
export declare class Buffer {
    private id;
    private tree;
    private observer;
    constructor(id: BufferId, tree: any, observer: ChangeObserver);
    edit(oldRanges: Range[], newText: string): OperationEnvelope;
    getText(): string;
    onChange(callback: ChangeObserverCallback): void;
}
//# sourceMappingURL=index.d.ts.map