/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { ITreeCursorSynchronous } from "../../core/index.js";
import type { ImplicitFieldSchema, TreeFieldFromImplicitField, FieldSchema, FieldKind, UnsafeUnknownSchema, InsertableField, TreeLeafValue } from "../schemaTypes.js";
import { type TreeNode, type Unhydrated } from "../core/index.js";
import { type NodeKeyManager } from "../../feature-libraries/index.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.
 * For that case, use {@link TreeBeta.clone}.
 */
export declare function createFromInsertable<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>, context?: NodeKeyManager | undefined): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
/**
 * 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 | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>, context?: NodeKeyManager | undefined): ITreeCursorSynchronous | (TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never);
/**
 * Creates an unhydrated simple-tree field from a cursor in nodes mode.
 */
export declare function createFromCursor<const TSchema extends ImplicitFieldSchema>(schema: TSchema, cursor: ITreeCursorSynchronous | undefined): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
//# sourceMappingURL=create.d.ts.map