/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IsUnion, RestrictiveStringRecord, UnionToIntersection } from "../../util/index.js";
import type { NodeKind, WithType, TreeNode, Unhydrated, InternalTreeNode, TreeNodeSchema, TreeNodeSchemaCore, TreeNodeSchemaClass, ImplicitAllowedTypes, TreeLeafValue, FlexListToUnion, LazyItem, AnnotatedAllowedType, AnnotatedAllowedTypes } from "../core/index.js";
import type { ApplyKind, ApplyKindInput, DefaultProvider, FieldKind, FieldSchema, FieldSchemaAlpha, FieldPropsAlpha } from "../fieldSchema.js";
import type { TreeArrayNode } from "../node-kinds/index.js";
import type { SchemaType, SimpleArrayNodeSchema, SimpleMapNodeSchema } from "../simpleSchema.js";
/**
 * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.
 *
 * These extends constraints only serve as documentation:
 * to avoid breaking compilation, this type has to not actually enforce anything, and thus is just `unknown`.
 * Therefore the type safety is the responsibility of the user of the API.
 * @public
 */
export type Unenforced<_DesiredExtendsConstraint> = unknown;
/**
 * A collection of {@link Unenforced} types that are used in the implementation of recursive schema.
 * These are all `@system` types, and thus should not be used directly.
 * @privateRemarks
 * Due to limitations of API-Extractor, all types in this namespace are treated as `@public`:
 * therefore, non-public types should not be included in this namespace.
 * @system @public
 */
export declare namespace System_Unsafe {
    /**
     * {@link Unenforced} version of `ObjectFromSchemaRecord`.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @privateRemarks
     * This does not bother special casing `{}` since no one should make empty objects using the *Recursive APIs.
     * @system @public
     */
    type ObjectFromSchemaRecordUnsafe<T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>> = {
        -readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitFieldUnsafe<T[Property]> : unknown;
    };
    /**
     * {@link Unenforced} version of {@link TreeNodeSchema}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type TreeNodeSchemaUnsafe<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends Unenforced<TreeNode | TreeLeafValue> = unknown, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = TreeNodeSchemaClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> | TreeNodeSchemaNonClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
    /**
     * {@link Unenforced} version of {@link TreeNodeSchemaClass}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind extends NodeKind, out TNode extends Unenforced<TreeNode>, in TInsertable, out ImplicitlyConstructable extends boolean, out Info, out TCustomMetadata = unknown> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, never, TCustomMetadata> {
        /**
         * Constructs an {@link Unhydrated} node with this schema.
         * @remarks
         * This constructor is also used internally to construct hydrated nodes with a different parameter type.
         * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.
         * @sealed
         */
        new (data: TInsertable | InternalTreeNode): Unhydrated<TNode>;
    }
    /**
     * {@link Unenforced} version of {@link TreeNodeSchemaNonClass}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    interface TreeNodeSchemaNonClassUnsafe<out Name extends string, out Kind extends NodeKind, out TNode extends Unenforced<TreeNode | TreeLeafValue>, in TInsertable, out ImplicitlyConstructable extends boolean, out Info = unknown> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info> {
        create(data: TInsertable): TNode;
    }
    /**
     * {@link Unenforced} version of {@link TreeObjectNode}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type TreeObjectNodeUnsafe<T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object, T>;
    /**
     * {@link Unenforced} version of {@link TreeFieldFromImplicitField}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type TreeFieldFromImplicitFieldUnsafe<TSchema extends ImplicitFieldSchemaUnsafe> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind> : TSchema extends ImplicitAllowedTypesUnsafe ? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema> : unknown;
    /**
     * {@link Unenforced} version of {@link AllowedTypes}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type AllowedTypesUnsafe = readonly LazyItem<TreeNodeSchemaUnsafe>[];
    /**
     * {@link Unenforced} version of {@link ImplicitAllowedTypes}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @privateRemarks
     * This is similar to `Unenforced<ImplicitAllowedTypes>` in that it avoids constraining the schema
     * (which is necessary to avoid breaking recursive types),
     * but is superior from a safety perspective because it constrains the structure containing the schema.
     * @system @public
     */
    type ImplicitAllowedTypesUnsafe = TreeNodeSchemaUnsafe | readonly LazyItem<Unenforced<TreeNodeSchema>>[];
    /**
     * {@link Unenforced} version of {@link ImplicitFieldSchema}.
     * @remarks
     * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @privateRemarks
     * This is similar to `Unenforced<ImplicitFieldSchema>` in that it avoids constraining the schema
     * (which is necessary to avoid breaking recursive types),
     * but is superior from a safety perspective because it constrains the structure containing the schema.
     * @system @public
     */
    type ImplicitFieldSchemaUnsafe = FieldSchemaUnsafe<FieldKind, ImplicitAllowedTypesUnsafe> | ImplicitAllowedTypesUnsafe;
    /**
     * {@link Unenforced} version of {@link TreeNodeFromImplicitAllowedTypes}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
    /**
     * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.
     * @see {@link Input}
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
    /**
     * {@link Unenforced} version of {@link InsertableTreeNodeFromAllowedTypes}.
     * @see {@link Input}
     * @privateRemarks
     * TODO: AB#36348: it seems like the order of the union this produces is what is non-deterministic in incremental builds
     * of the JsonAsTree schema.
     * @system @public
     */
    type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
        readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
    }[number];
    /**
     * {@link Unenforced} version of {@link InsertableTypedNode}.
     * @see {@link Input}
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @privateRemarks
     * TODO:
     * This is less strict than InsertableTypedNode when given non-exact schema to avoid compilation issues.
     * This should probably be fixed or documented somehow.
     * @system @public
     */
    type InsertableTypedNodeUnsafe<TSchema extends TreeNodeSchemaUnsafe, T = UnionToIntersection<TSchema>> = (T extends TreeNodeSchemaUnsafe<string, NodeKind, TreeNode | TreeLeafValue, never, true> ? NodeBuilderDataUnsafe<T> : never) | (T extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<T> : never);
    /**
     * {@link Unenforced} version of {@link NodeFromSchema}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type NodeFromSchemaUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchemaUnsafe<string, NodeKind, infer TNode> ? TNode : never;
    /**
     * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchemaUnsafe<string, NodeKind, unknown, infer TBuild> ? TBuild : never;
    /**
     * {@link Unenforced} version of {@link (TreeArrayNode:interface)}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @sealed @public
     */
    interface TreeArrayNodeUnsafe<TAllowedTypes extends ImplicitAllowedTypesUnsafe> extends TreeArrayNode<TAllowedTypes, TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>> {
    }
    /**
     * {@link Unenforced} version of {@link TreeMapNode}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @sealed @public
     */
    interface TreeMapNodeUnsafe<T extends ImplicitAllowedTypesUnsafe> extends ReadonlyMapInlined<string, T>, TreeNode {
        /**
         * {@inheritdoc TreeMapNode.set}
         */
        set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
        /**
         * {@inheritdoc TreeMapNode.delete}
         */
        delete(key: string): void;
    }
    /**
     * Copy of TypeScript's ReadonlyMap, but with `TreeNodeFromImplicitAllowedTypesUnsafe<T>` inlined into it.
     * Using this instead of ReadonlyMap in TreeMapNodeUnsafe is necessary to make recursive map schema not generate compile errors in the d.ts files when exported.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @privateRemarks
     * This is the same as `ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>` (Checked in test),
     * except that it avoids the above mentioned compile error.
     * Authored by manually inlining ReadonlyMap from from the TypeScript lib which can be found by navigating to the definition of `ReadonlyMap`.
     * @system @sealed @public
     */
    interface ReadonlyMapInlined<K, T extends ImplicitAllowedTypesUnsafe> {
        /** Returns an iterable of entries in the map. */
        [Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
        /**
         * Returns an iterable of key, value pairs for every entry in the map.
         */
        entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
        /**
         * Returns an iterable of keys in the map
         */
        keys(): IterableIterator<K>;
        /**
         * Returns an iterable of values in the map
         */
        values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
        forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
        get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
        has(key: K): boolean;
        readonly size: number;
    }
    /**
     * {@link Unenforced} version of `FieldHasDefault`.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @sealed @public
     */
    type FieldHasDefaultUnsafe<T extends ImplicitFieldSchemaUnsafe> = T extends FieldSchemaUnsafe<FieldKind.Optional | FieldKind.Identifier, ImplicitAllowedTypesUnsafe> ? true : false;
    /**
     * {@link Unenforced} version of `InsertableObjectFromSchemaRecord`.
     * @see {@link Input}
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type InsertableObjectFromSchemaRecordUnsafe<T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>> = {
        readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
    } & {
        readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends true ? Property : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
    };
    /**
     * {@link Unenforced} version of {@link InsertableTreeFieldFromImplicitField}.
     * @see {@link Input}
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @public
     */
    type InsertableTreeFieldFromImplicitFieldUnsafe<TSchemaInput extends ImplicitFieldSchemaUnsafe, TSchema = UnionToIntersection<TSchemaInput>> = [TSchema] extends [FieldSchemaUnsafe<infer Kind, infer Types>] ? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true> : [TSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema> : never;
    /**
     * {@link Unenforced} version of {@link FieldSchema}.
     * @remarks
     * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
     * @system @sealed @public
     */
    interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown> extends FieldSchema<Kind, any, TCustomMetadata> {
        /**
         * {@inheritDoc FieldSchema.kind}
         */
        readonly kind: Kind;
        /**
         * {@inheritDoc FieldSchema.allowedTypes}
         */
        readonly allowedTypes: Types;
        /**
         * {@inheritDoc FieldSchema.allowedTypeSet}
         */
        readonly allowedTypeSet: ReadonlySet<TreeNodeSchema>;
    }
}
/**
 * {@link Unenforced} version of {@link FieldSchemaAlpha}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @alpha
 */
export interface FieldSchemaAlphaUnsafe<out Kind extends FieldKind, out Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown, out TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = undefined> extends FieldSchemaAlpha<Kind, any, TCustomMetadata, TProps>, System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {
    /**
     * {@inheritDoc FieldSchema.allowedTypes}
     */
    readonly allowedTypes: Types;
}
/**
 * {@link Unenforced} version of {@link FieldHasDefaultAlpha}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @alpha
 */
export type FieldHasDefaultAlphaUnsafe<T extends System_Unsafe.ImplicitFieldSchemaUnsafe> = T extends FieldSchemaAlphaUnsafe<infer Kind, System_Unsafe.ImplicitAllowedTypesUnsafe, unknown, infer TProps> ? Kind extends FieldKind.Optional | FieldKind.Identifier ? true : TProps extends {
    defaultProvider: DefaultProvider;
} ? true : false : System_Unsafe.FieldHasDefaultUnsafe<T>;
/**
 * {@link Unenforced} version of {@link InsertableObjectFromSchemaRecordAlpha}.
 * @see {@link System_Unsafe.InsertableObjectFromSchemaRecordUnsafe}
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @alpha
 */
export type InsertableObjectFromSchemaRecordAlphaUnsafe<T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>> = {
    readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends false ? Property : never]: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
} & {
    readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends true ? Property : never]?: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
};
/**
 * {@link Unenforced} version of {@link ArrayNodeCustomizableSchema}s.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @sealed
 * @alpha
 * @system
 */
export interface ArrayNodeCustomizableSchemaUnsafe<out TName extends string, in out T extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata> extends TreeNodeSchemaClass<TName, NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<T> & WithType<TName, NodeKind.Array, T>, {
    [Symbol.iterator](): Iterator<System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
}, false, T, undefined, TCustomMetadata>, SimpleArrayNodeSchema<SchemaType.View, TCustomMetadata> {
}
/**
 * {@link Unenforced} version of {@link MapNodeCustomizableSchema}s.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @sealed
 * @alpha
 * @system
 */
export interface MapNodeCustomizableSchemaUnsafe<out TName extends string, in out T extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata> extends TreeNodeSchemaClass<TName, NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe<T> & WithType<TName, NodeKind.Map, T>, {
    [Symbol.iterator](): Iterator<[
        string,
        System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
    ]>;
} | {
    readonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
}, false, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {
}
/**
 * {@link Unenforced} version of {@link TreeRecordNode}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export interface TreeRecordNodeUnsafe<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe> extends Record<string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>>, TreeNode {
    [Symbol.iterator](): IterableIterator<[
        string,
        System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>
    ]>;
}
/**
 * {@link Unenforced} utility to remove {@link AnnotatedAllowedTypeUnsafe} wrappers.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @sealed
 * @beta
 * @system
 */
export type UnannotateAllowedTypeUnsafe<T extends Unenforced<AnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>>> = T extends AnnotatedAllowedTypeUnsafe<infer X> ? X : T;
/**
 * {@link Unenforced} version of {@link AnnotatedAllowedType}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export interface AnnotatedAllowedTypeUnsafe<T = Unenforced<LazyItem<TreeNodeSchema>>> extends AnnotatedAllowedType<T> {
}
/**
 * {@link Unenforced} version of {@link AnnotatedAllowedTypes}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export interface AnnotatedAllowedTypesUnsafe extends AnnotatedAllowedTypes<LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>> {
}
/**
 * {@link Unenforced} version of {@link AllowedTypesFull}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @alpha
 */
export type AllowedTypesFullUnsafe<T extends readonly AnnotatedAllowedTypeUnsafe[] = readonly AnnotatedAllowedTypeUnsafe[]> = AnnotatedAllowedTypes<T> & UnannotateAllowedTypesListUnsafe<T>;
/**
 * {@link Unenforced} version of {@link AllowedTypesFullFromMixed}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export type AllowedTypesFullFromMixedUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = UnannotateAllowedTypesListUnsafe<T> & AnnotatedAllowedTypes<AnnotateAllowedTypesListUnsafe<T>>;
/**
 * {@link Unenforced} version of {@link UnannotateAllowedTypesList}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export type UnannotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
    readonly [I in keyof T]: T[I] extends {
        type: infer X;
    } ? X : T[I];
};
/**
 * {@link Unenforced} version of {@link AnnotateAllowedTypesList}.
 * @remarks
 * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.
 * @system @sealed @beta
 */
export type AnnotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
    [I in keyof T]: T[I] extends AnnotatedAllowedTypeUnsafe ? T[I] : AnnotatedAllowedTypeUnsafe<T[I]>;
};
//# sourceMappingURL=typesUnsafe.d.ts.map