/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { getUnhydratedContext } from "../createContext.js";
import { customFromCursor, replaceHandles, } from "./customTree.js";
/**
 * Used to read a node cursor as a ConciseTree.
 */
export function conciseFromCursor(reader, rootSchema, options) {
    const config = {
        useStoredKeys: false,
        ...options,
    };
    const schemaMap = getUnhydratedContext(rootSchema).schema;
    return conciseFromCursorInner(reader, config, schemaMap);
}
function conciseFromCursorInner(reader, options, schema) {
    return customFromCursor(reader, options, schema, conciseFromCursorInner);
}
/**
 * Clones tree, replacing any handles.
 * @remarks A strongly typed version of {@link replaceHandles}.
 * @alpha
 */
export function replaceConciseTreeHandles(tree, replacer) {
    return replaceHandles(tree, replacer);
}
//# sourceMappingURL=conciseTree.js.map