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