/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IFluidHandle } from "@fluidframework/core-interfaces";
import type { ITreeCursorSynchronous } from "../../core/index.js";
import type { ImplicitFieldSchema, InsertableTreeFieldFromImplicitField, TreeFieldFromImplicitField, FieldSchema, FieldKind } from "../schemaTypes.js";
import type { Unhydrated } from "../core/index.js";
import { type NodeKeyManager } from "../../feature-libraries/index.js";
import { type ParseOptions, type VerboseTreeNode } from "./verboseTree.js";
/**
 * Construct tree content that is compatible with the field defined by the provided `schema`.
 * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
 * @param data - The data used to construct the field content.
 * @remarks
 * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.
 * This function exists as a generalization that can be used in other cases as well,
 * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.
 *
 * Like with {@link TreeNodeSchemaClass}'s constructor, its an error to provide an existing node to this API.
 * TODO: For that case, use we should provide `Tree.clone`.
 * @privateRemarks
 * This could be exposed as a public `Tree.create` function.
 */
export declare function createFromInsertable<TSchema extends ImplicitFieldSchema>(schema: TSchema, data: InsertableTreeFieldFromImplicitField<TSchema>, context?: NodeKeyManager | undefined): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
/**
 * Construct tree content that is compatible with the field defined by the provided `schema`.
 * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
 * @param data - The data used to construct the field content.
 * @remarks
 * When providing a {@link TreeNodeSchemaClass},
 * this is the same as invoking its constructor except that an unhydrated node can also be provided and the returned value is a cursor.
 * When `undefined` is provided (for an optional field), `undefined` is returned.
 */
export declare function cursorFromInsertable<TSchema extends ImplicitFieldSchema>(schema: TSchema, data: InsertableTreeFieldFromImplicitField<TSchema>, context?: NodeKeyManager | undefined): ITreeCursorSynchronous | (TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never);
/**
 * Construct tree content compatible with a field defined by the provided `schema`.
 * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.
 * @privateRemarks
 * This could be exposed as a public `Tree.createFromVerbose` function.
 */
export declare function createFromVerbose<TSchema extends ImplicitFieldSchema, THandle>(schema: TSchema, data: VerboseTreeNode<THandle> | undefined, options: ParseOptions<THandle>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
/**
 * Construct tree content compatible with a field defined by the provided `schema`.
 * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.
 */
export declare function createFromVerbose<TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTreeNode | undefined, options?: Partial<ParseOptions<IFluidHandle>>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
/**
 * Creates an unhydrated simple-tree field from a cursor in nodes mode.
 */
export declare function createFromCursor<TSchema extends ImplicitFieldSchema>(schema: TSchema, cursor: ITreeCursorSynchronous | undefined): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
//# sourceMappingURL=create.d.ts.map