/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type MapTree, type TreeFieldStoredSchema, type TreeTypeSet } from "../core";
import { type CursorWithNode, type TreeDataContext, type TreeNodeSchema } from "../feature-libraries";
import { InsertableTreeField, InsertableTypedNode } from "./insertable";
/**
 * Module notes:
 *
 * The flow of the below code is in terms of the structure of the input data. We then verify that the associated
 * schema is appropriate for that kind of data. This is fine while we have a 1:1 mapping of kind of input data to
 * the kind of schema we expect for it (e.g. an input that is an array always need to be associated with a sequence in
 * the schema). If/when we begin accepting kinds of input data that are ambiguous (e.g. accepting an input that is an
 * array of key/value tuples to instantiate a map) we may need to rethink the structure here to be based more on the
 * schema than on the input data.
 */
/**
 * Transforms an input {@link TypedNode} tree to a {@link MapTree}, and wraps the tree in a {@link CursorWithNode}.
 * @param data - The input tree to be converted.
 * @param context - Describes the context into which the data is being created. See {@link FlexTreeEntity.context}.
 * @param typeSet - The set of types allowed by the parent context. Used to validate the input tree.
 *
 * @returns A cursor (in nodes mode) for the mapped tree if the input data was defined. Otherwise, returns `undefined`.
 */
export declare function cursorFromNodeData(data: InsertableTypedNode<TreeNodeSchema>, context: TreeDataContext, typeSet: TreeTypeSet): CursorWithNode<MapTree> | undefined;
/**
 * Transforms an input {@link TreeField} tree to a list of {@link MapTree}s, and wraps the tree in a {@link CursorWithNode}.
 * @param data - The input tree to be converted.
 * @param context - Describes the context into which the data is being created. See {@link FlexTreeEntity.context}.
 */
export declare function cursorFromFieldData(data: InsertableTreeField, context: TreeDataContext, fieldSchema: TreeFieldStoredSchema): CursorWithNode<MapTree>;
/**
 * Transforms an input {@link TypedNode} tree to a {@link MapTree}.
 * @param data - The input tree to be converted.
 * If the data is an unsupported value (e.g. NaN), a fallback value will be used when supported,
 * otherwise an error will be thrown.
 *
 * Fallbacks:
 *
 * * `NaN` =\> `null`
 *
 * * `+/-∞` =\> `null`
 *
 * * `-0` =\> `+0`
 *
 * @param context - Describes the context into which the data is being created. See {@link FlexTreeEntity.context}.
 * @param typeSet - The set of types allowed by the parent context. Used to validate the input tree.
 */
export declare function nodeDataToMapTree(data: InsertableTypedNode<TreeNodeSchema>, context: TreeDataContext, typeSet: TreeTypeSet): MapTree;
/**
 * Transforms an input {@link TreeField} tree to a list of {@link MapTree}s.
 * @param data - The input tree to be converted.
 * If the input is a sequence containing 1 or more `undefined` values, those values will be mapped as `null` if supported.
 * Othewise, an error will be thrown.
 * @param context - Describes the context into which the data is being created. See {@link FlexTreeEntity.context}.
 */
export declare function fieldDataToMapTrees(data: InsertableTreeField, context: TreeDataContext, fieldSchema: TreeFieldStoredSchema): MapTree[];
//# sourceMappingURL=toMapTree.d.ts.map