/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type HasListeners, type IEmitter, type Listenable } from "../events/index.js";
import { type FlexFieldSchema, type NodeKeyManager, ViewSchema } from "../feature-libraries/index.js";
import { type ImplicitFieldSchema, type SchemaCompatibilityStatus, type InsertableTreeFieldFromImplicitField, type TreeConfiguration, type TreeFieldFromImplicitField, type TreeView, type TreeViewEvents, type TreeViewConfiguration } from "../simple-tree/index.js";
import type { TreeCheckout } from "./treeCheckout.js";
import { CheckoutFlexTreeView } from "./treeView.js";
/**
 * Implementation of TreeView wrapping a FlexTreeView.
 */
export declare class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitFieldSchema> implements TreeView<TRootSchema> {
    readonly checkout: TreeCheckout;
    readonly config: // eslint-disable-next-line import/no-deprecated
    TreeConfiguration<TRootSchema> | TreeViewConfiguration<TRootSchema>;
    readonly nodeKeyManager: NodeKeyManager;
    /**
     * The view is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.
     *
     * The view schema may be incompatible with the stored schema. Use `compatibility` to check.
     */
    private view;
    /**
     * Undefined iff uninitialized or disposed.
     */
    private currentCompatibility;
    private readonly flexConfig;
    readonly events: Listenable<TreeViewEvents> & IEmitter<TreeViewEvents> & HasListeners<TreeViewEvents>;
    private readonly viewSchema;
    private readonly unregisterCallbacks;
    disposed: boolean;
    /**
     * This is set to true while an edit impacting the document schema is in progress.
     * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.
     * This is useful especially for some initialization edits, since document initialization can involve transient schemas
     * which are implementation details and should not be exposed to the user.
     */
    private midUpgrade;
    private readonly rootFieldSchema;
    constructor(checkout: TreeCheckout, config: // eslint-disable-next-line import/no-deprecated
    TreeConfiguration<TRootSchema> | TreeViewConfiguration<TRootSchema>, nodeKeyManager: NodeKeyManager);
    initialize(content: InsertableTreeFieldFromImplicitField<TRootSchema>): void;
    upgradeSchema(): void;
    /**
     * Gets the view. Throws when disposed.
     */
    getView(): CheckoutFlexTreeView<FlexFieldSchema>;
    private ensureUndisposed;
    private failDisposed;
    /**
     * Updates `this.view` and the current compatibility status.
     * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.
     * Handles re-registering for events to call update in the future.
     * @remarks
     * This does not check if the view needs to be replaced, it replaces it unconditionally:
     * callers should do any checking to detect if it's really needed before calling `update`.
     * @privateRemarks
     * This implementation avoids making any edits, which prevents it from being invoked reentrantly.
     * If implicit initialization (or some other edit) is desired, it should be done outside of this method.
     */
    private update;
    private runSchemaEdit;
    private disposeView;
    get compatibility(): SchemaCompatibilityStatus;
    dispose(): void;
    get root(): TreeFieldFromImplicitField<TRootSchema>;
    set root(newRoot: InsertableTreeFieldFromImplicitField<TRootSchema>);
}
/**
 * Creates a view that self-disposes whenenever the stored schema changes.
 * This may only be called when the schema is already known to be compatible (typically via ensureSchema).
 */
export declare function requireSchema<TRoot extends FlexFieldSchema>(checkout: TreeCheckout, viewSchema: ViewSchema<TRoot>, onDispose: () => void, nodeKeyManager: NodeKeyManager): CheckoutFlexTreeView<TRoot>;
//# sourceMappingURL=schematizingTreeView.d.ts.map