/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { AllowedUpdateType, StoredSchemaRepository, ITreeCursorSynchronous } from "../core";
import { TypedSchemaCollection, SchemaAware, FieldSchema } from "../feature-libraries";
import { ISubscribable } from "../events";
import { ViewEvents } from "./sharedTreeView";
/**
 * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
 *
 * Requires `storedSchema` to be in its default/empty state.
 *
 * This is done in such a way that if the content (implicitly assumed to start empty)
 * is never out of schema.
 * This means that if the root field of the new schema requires content (like a value field),
 * a temporary intermediate schema is used so the initial empty state is not out of schema.
 *
 * Since this makes multiple changes, callers may want to wrap it in a transaction.
 */
export declare function initializeContent(storedSchema: StoredSchemaRepository, schema: TypedSchemaCollection, setInitialTree: () => void): void;
/**
 * See {@link ISharedTree.schematize} for more details.
 *
 * TODO:
 * - Support adapters for handling out of schema data.
 * - Handle initialization via an adapter.
 * - Support per adapter update policy.
 * - Support lazy schema updates.
 * - Better error for change to invalid schema approach than throwing on later event.
 */
export declare function schematize(events: ISubscribable<ViewEvents>, storedSchema: StoredSchemaRepository, config: SchematizeConfiguration): void;
/**
 * View Schema for a `SharedTree`.
 *
 * @alpha
 */
export interface SchemaConfiguration<TRoot extends FieldSchema = FieldSchema> {
    /**
     * The schema which the application wants to view the tree with.
     */
    readonly schema: TypedSchemaCollection<TRoot>;
}
/**
 * Content that can populate a `SharedTree`.
 *
 * @alpha
 */
export interface TreeContent<TRoot extends FieldSchema = FieldSchema> extends SchemaConfiguration<TRoot> {
    /**
     * Default tree content to initialize the tree with iff the tree is uninitialized
     * (meaning it does not even have any schema set at all).
     */
    readonly initialTree: SchemaAware.TypedField<TRoot, SchemaAware.ApiMode.Flexible> | readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous;
}
/**
 * Options used to schematize a `SharedTree`.
 *
 * @alpha
 */
export interface SchematizeConfiguration<TRoot extends FieldSchema = FieldSchema> extends SchemaConfiguration<TRoot> {
    /**
     * Controls if and how schema from existing documents can be updated to accommodate the view schema.
     */
    readonly allowedSchemaModifications: AllowedUpdateType;
}
/**
 * Options used to initialize (if needed) and schematize a `SharedTree`.
 *
 * @alpha
 */
export interface InitializeAndSchematizeConfiguration<TRoot extends FieldSchema = FieldSchema> extends TreeContent<TRoot>, SchematizeConfiguration<TRoot> {
}
//# sourceMappingURL=schematizedTree.d.ts.map