"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.library = exports.recursiveStruct2 = exports.recursiveStruct = 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 feature_libraries_1 = require("../feature-libraries");
const leaf = __importStar(require("./leafDomain"));
const builder = new feature_libraries_1.SchemaBuilder("Test Recursive Domain", {}, leaf.library);
/**
 * @alpha
 */
exports.recursiveStruct = builder.structRecursive("recursiveStruct", {
    recursive: feature_libraries_1.SchemaBuilder.fieldRecursive(feature_libraries_1.FieldKinds.optional, () => exports.recursiveStruct),
    number: feature_libraries_1.SchemaBuilder.fieldValue(leaf.number),
});
// Some related information in https://github.com/microsoft/TypeScript/issues/55758.
function fixRecursiveReference(...types) { }
const recursiveReference = () => exports.recursiveStruct2;
fixRecursiveReference(recursiveReference);
/**
 * @alpha
 */
exports.recursiveStruct2 = builder.struct("recursiveStruct2", {
    recursive: feature_libraries_1.SchemaBuilder.field(feature_libraries_1.FieldKinds.optional, recursiveReference),
    number: feature_libraries_1.SchemaBuilder.fieldValue(leaf.number),
});
/**
 * @alpha
 */
exports.library = builder.intoLibrary();
//# sourceMappingURL=testRecursiveDomain.js.map