/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey } from "../core/index.js";
import { HasListeners, IEmitter, ISubscribable } from "../events/index.js";
import { FlexFieldSchema, NodeKeyManager, ViewSchema } from "../feature-libraries/index.js";
import { ImplicitFieldSchema, SchemaIncompatible, TreeConfiguration, TreeFieldFromImplicitField, TreeView, TreeViewEvents } from "../simple-tree/index.js";
import { disposeSymbol } from "../util/index.js";
import { UpdateType } from "./schematizeTree.js";
import { 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<TreeFieldFromImplicitField<TRootSchema>> {
    readonly checkout: TreeCheckout;
    readonly config: TreeConfiguration<TRootSchema>;
    readonly nodeKeyManager: NodeKeyManager;
    readonly nodeKeyFieldKey: FieldKey;
    /**
     * In one of three states:
     * 1. Valid: A checkout is present, not disposed, and it's stored schema and view schema are compatible.
     * 2. SchematizeError: stored schema and view schema are not compatible.
     * 3. disposed: `view` is undefined, and using this object will error. Some methods also transiently leave view undefined.
     */
    private view;
    private readonly flexConfig;
    readonly events: ISubscribable<TreeViewEvents> & IEmitter<TreeViewEvents> & HasListeners<TreeViewEvents>;
    private readonly viewSchema;
    private readonly unregisterCallbacks;
    private disposed;
    constructor(checkout: TreeCheckout, config: TreeConfiguration<TRootSchema>, nodeKeyManager: NodeKeyManager, nodeKeyFieldKey: FieldKey);
    upgradeSchema(): void;
    /**
     * Gets the view is the stored schema is compatible with the view schema,
     * otherwise returns an error detailing the schema incompatibility.
     */
    getViewOrError(): CheckoutFlexTreeView<FlexFieldSchema> | SchematizeError;
    /**
     * Updates `this.view`.
     * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.
     * Handled 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 its really needed before calling `update`.
     */
    private update;
    private disposeView;
    get error(): SchematizeError | undefined;
    [disposeSymbol](): void;
    get root(): TreeFieldFromImplicitField<TRootSchema>;
}
export declare class SchematizeError implements SchemaIncompatible {
    readonly updateType: UpdateType;
    constructor(updateType: UpdateType);
    get canUpgrade(): boolean;
    get canInitialize(): boolean;
}
/**
 * Flex-Tree schematizing layer.
 * Creates a view that self-disposes when stored schema becomes incompatible.
 * 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, nodeKeyFieldKey: FieldKey): CheckoutFlexTreeView<TRoot>;
//# sourceMappingURL=schematizingTreeView.d.ts.map