/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { IChannelAttributes, IChannelFactory, IChannelServices, IChannelStorageService, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
import { ISharedObject } from "@fluidframework/shared-object-base";
import { Anchor, AnchorNode, AnchorSetRootEvents, GlobalFieldKey, StoredSchemaRepository, IForestSubscription } from "../core";
import { SharedTreeBranch, SharedTreeCore } from "../shared-tree-core";
import { EditableTreeContext, DefaultEditBuilder, UnwrappedEditableField, DefaultChangeset, ContextuallyTypedNodeData, GlobalFieldSchema, EditableTree, Identifier } from "../feature-libraries";
import { IEmitter, ISubscribable } from "../events";
import { JsonCompatibleReadOnly } from "../util";
import { SchematizeConfiguration } from "./schematizedTree";
import { ISharedTreeView, SharedTreeView, ViewEvents } from "./sharedTreeView";
/**
 * Collaboratively editable tree distributed data-structure,
 * powered by {@link @fluidframework/shared-object-base#ISharedObject}.
 *
 * See [the README](../../README.md) for details.
 * @alpha
 */
export interface ISharedTree extends ISharedObject, ISharedTreeView {
}
/**
 * The key for the special identifier field, which allows nodes to be given identifiers that can be used
 * to find the nodes via the identifier index
 * @alpha
 */
export declare const identifierKey: GlobalFieldKey;
/**
 * The global field key symbol that corresponds to {@link identifierKey}
 * @alpha
 */
export declare const identifierKeySymbol: import("../core").GlobalFieldKeySymbol;
/**
 * Shared tree, configured with a good set of indexes and field kinds which will maintain compatibility over time.
 * TODO: node identifier index.
 *
 * TODO: detail compatibility requirements.
 */
export declare class SharedTree extends SharedTreeCore<DefaultEditBuilder, DefaultChangeset> implements ISharedTree {
    readonly events: ISubscribable<ViewEvents> & IEmitter<ViewEvents>;
    private readonly view;
    private readonly schema;
    private readonly identifierIndex;
    constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, telemetryContextPrefix: string);
    get rootEvents(): ISubscribable<AnchorSetRootEvents>;
    get storedSchema(): StoredSchemaRepository;
    get forest(): IForestSubscription;
    get identifiedNodes(): ReadonlyMap<Identifier, EditableTree>;
    get root(): UnwrappedEditableField;
    set root(data: ContextuallyTypedNodeData | undefined);
    get context(): EditableTreeContext;
    locate(anchor: Anchor): AnchorNode | undefined;
    schematize<TRoot extends GlobalFieldSchema>(config: SchematizeConfiguration<TRoot>): ISharedTreeView;
    get transaction(): SharedTreeView["transaction"];
    fork(): SharedTreeView;
    merge(fork: SharedTreeView): void;
    rebase(fork: SharedTreeView): void;
    getLocalBranch(): SharedTreeBranch<DefaultEditBuilder, DefaultChangeset>;
    /**
     * TODO: Shared tree needs a pattern for handling non-changeset operations.
     * Whatever pattern is adopted should probably also handle multiple versions of changeset operations.
     * A single top level enum listing all ops (including their different versions),
     * with at least fine grained enough detail to direct them to the correct subsystem would be a good approach.
     * The current use-case (with an op applying to a specific index) is a temporary hack,
     * and its not clear how it would fit into such a system if implemented in shared-tree-core:
     * maybe op dispatch is part of the shared-tree level?
     */
    protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
    protected reSubmitCore(content: JsonCompatibleReadOnly, localOpMetadata: unknown): void;
    protected loadCore(services: IChannelStorageService): Promise<void>;
    /** Finish a batch (see {@link ViewEvents}) */
    private finishBatch;
}
/**
 * A channel factory that creates {@link ISharedTree}s.
 * @alpha
 */
export declare class SharedTreeFactory implements IChannelFactory {
    type: string;
    attributes: IChannelAttributes;
    load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly<IChannelAttributes>): Promise<ISharedTree>;
    create(runtime: IFluidDataStoreRuntime, id: string): ISharedTree;
}
//# sourceMappingURL=sharedTree.d.ts.map