/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IFluidHandle } from "@fluidframework/core-interfaces";
import { type ITreeCursor, type TreeNodeSchemaIdentifier, type TreeNodeStoredSchema } from "../../core/index.js";
import type { TreeLeafValue } from "../schemaTypes.js";
import { type TreeNodeSchema } from "../core/index.js";
/**
 * Options for how to encode a tree.
 * @alpha
 */
export interface EncodeOptions<TCustom> {
    /**
     * How to encode any {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles} in the tree.
     * @remarks
     * See note on {@link ParseOptions.valueConverter}.
     */
    valueConverter(data: IFluidHandle): TCustom;
    /**
     * If true, interpret the input keys of object nodes as stored keys.
     * If false, interpret them as property keys.
     * @defaultValue false.
     */
    readonly useStoredKeys?: boolean;
}
/**
 * Tree representation with fields as properties and customized handle and child representations.
 */
export type CustomTree<TChild, THandle> = CustomTreeNode<TChild> | CustomTreeValue<THandle>;
/**
 * TreeLeafValue except the handle type is customized.
 */
export type CustomTreeValue<THandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle;
/**
 * Tree node representation with fields as properties and customized child representation.
 */
export type CustomTreeNode<TChild> = TChild[] | {
    [key: string]: TChild;
};
/**
 * Builds an {@link CustomTree} from a cursor in Nodes mode.
 */
export declare function customFromCursor<TChild, THandle>(reader: ITreeCursor, options: Required<EncodeOptions<THandle>>, schema: ReadonlyMap<string, TreeNodeSchema>, childHandler: (reader: ITreeCursor, options: Required<EncodeOptions<THandle>>, schema: ReadonlyMap<string, TreeNodeSchema>) => TChild): CustomTree<TChild, THandle>;
/**
 * Builds an {@link CustomTree} from a cursor in Nodes mode.
 * @remarks
 * Uses stored keys and stored schema.
 */
export declare function customFromCursorStored<TChild>(reader: ITreeCursor, schema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>, childHandler: (reader: ITreeCursor, schema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>) => TChild): CustomTree<TChild, IFluidHandle>;
/**
 * Assumes `schema` corresponds to a simple-tree schema.
 * If it is an array schema, returns the allowed types for the array field.
 * Otherwise returns `undefined`.
 */
export declare function tryStoredSchemaAsArray(schema: TreeNodeStoredSchema): ReadonlySet<string> | undefined;
//# sourceMappingURL=customTree.d.ts.map