"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.library = exports.recursiveObject = void 0;
/**
 * This file exists and is package exported to aid in testing of exporting recursive types across package boundaries.
 * Sometimes when TypeScript generates d.ts files, they type check significantly differently than the original source (One example of this: https://github.com/microsoft/TypeScript/issues/20979).
 * Unfortunately our recursive schema types are an example of types that have this kind of issue: the d.ts files tend to get "any" instead of the recursive type reference.
 * Currently we do not have tooling in place to test this in our test suite, and exporting these types here is a temporary crutch to aid in diagnosing this issue.
 */
const index_js_1 = require("../feature-libraries/index.js");
const leafDomain_js_1 = require("./leafDomain.js");
const builder = new index_js_1.SchemaBuilderBase(index_js_1.FieldKinds.optional, { scope: "Test Recursive Domain" });
exports.recursiveObject = builder.objectRecursive("object", {
    recursive: index_js_1.FlexFieldSchema.createUnsafe(index_js_1.FieldKinds.optional, [() => exports.recursiveObject]),
    number: leafDomain_js_1.leaf.number,
});
exports.library = builder.intoLibrary();
{
    const b = new index_js_1.SchemaBuilderBase(index_js_1.FieldKinds.optional, { scope: "Test Recursive Domain" });
    const node = b.objectRecursive("object", {
        child: index_js_1.FlexFieldSchema.createUnsafe(index_js_1.FieldKinds.optional, [() => node]),
    });
    const _field = index_js_1.FlexFieldSchema.createUnsafe(index_js_1.FieldKinds.optional, [node]);
    // All these cause TSC to "RangeError: Maximum call stack size exceeded"
    // const _field4 = FlexFieldSchema.create(FieldKinds.optional, [node]);
    // const _field2 = b.optional(node);
    // const _field3 = SchemaBuilder.optional(node);
    // const schema = b.intoSchema(field);
    // const schema = b.intoSchema(_field);
}
//# sourceMappingURL=testRecursiveDomain.js.map