/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type FixRecursiveArraySchema, type TreeNodeFromImplicitAllowedTypes } from "./simple-tree/index.js";
/**
 * Utilities for storing JSON data in {@link TreeNode}s.
 * @remarks
 * Schema which replicate the JSON data model with {@link TreeNode}s.
 *
 * This allows JSON to be losslessly round-tripped through a tree with the following limitations:
 *
 * 1. Only information that would be preserved by JSON.parse is preserved. This means (among other things) that numbers are limited to JavasScript's numeric precision.
 *
 * 2. The order of fields on an object is not preserved. The resulting order is arbitrary.
 *
 * JSON data can be imported from JSON into this format using `JSON.parse` then {@link TreeAlpha.importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.
 *
 * @alpha
 */
export declare namespace JsonAsTree {
    /**
     * {@link AllowedTypes} for primitives types allowed in JSON.
     * @alpha
     */
    const Primitive: readonly [import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>];
    /**
     * @alpha
     */
    type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
    /**
     * {@link AllowedTypes} for any content allowed in the {@link JsonAsTree} domain.
     * @example
     * ```typescript
     * const tree = TreeAlpha.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });
     * ```
     * @alpha
     */
    const Tree: readonly [() => typeof JsonObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>];
    /**
     * @alpha
     */
    type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
    /**
     * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
     * @system @alpha
     */
    const _APIExtractorWorkaroundObjectBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.json.object", import("./simple-tree/index.js").NodeKind.Map, import("./simple-tree/index.js").TreeMapNodeUnsafe<readonly [() => typeof JsonObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>]> & import("./simple-tree/index.js").WithType<"com.fluidframework.json.object", import("./simple-tree/index.js").NodeKind.Map, unknown>, {
        [Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
            create(data: boolean): boolean;
        }> | null], any, undefined>;
    } | {
        readonly [x: string]: string | number | JsonObject | Array | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
            create(data: boolean): boolean;
        }> | null;
    }, false, readonly [() => typeof JsonObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>], undefined>;
    /**
     * Arbitrary JSON object as a {@link TreeNode}.
     * @remarks
     * API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.
     * @example
     * ```typescript
     * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
     * const fromArray = new JsonAsTreeObject([["a", 0]]);
     * // Using `importConcise` can work better for JSON data:
     * const imported = TreeAlpha.importConcise(JsonAsTree.Object, { a: 0 });
     * // Node API is like a Map:
     * const value = imported.get("a");
     * ```
     * @privateRemarks
     * Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.
     * @sealed @alpha
     */
    class JsonObject extends _APIExtractorWorkaroundObjectBase {
    }
    /**
     * D.ts bug workaround, see {@link FixRecursiveArraySchema}.
     * @privateRemarks
     * In the past this this had to reference the base type (_APIExtractorWorkaroundArrayBase).
     * Testing for this in examples/utils/import-testing now shows it has to reference JsonAsTree.Array instead.
     * @system @alpha
     */
    type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
    /**
     * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
     * @system @alpha
     */
    const _APIExtractorWorkaroundArrayBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.json.array", import("./simple-tree/index.js").NodeKind.Array, import("./simple-tree/index.js").TreeArrayNodeUnsafe<readonly [() => typeof JsonObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>]> & import("./simple-tree/index.js").WithType<"com.fluidframework.json.array", import("./simple-tree/index.js").NodeKind.Array, unknown>, {
        [Symbol.iterator](): Iterator<string | number | JsonObject | Array | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
            create(data: boolean): boolean;
        }> | null, any, undefined>;
    }, false, readonly [() => typeof JsonObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>], undefined>;
    /**
     * Arbitrary JSON array as a {@link TreeNode}.
     * @remarks
     * This can be imported using {@link TreeAlpha.importConcise}.
     * @example
     * ```typescript
     * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
     * const usingConstructor = new JsonAsTree.Array(["a", 0, new JsonAsTree.Array([1])]);
     * // Using `importConcise` can work better for JSON data:
     * const imported = TreeAlpha.importConcise(JsonAsTree.Array, ["a", 0, [1]]);
     * // Node API is like an Array:
     * const inner: JsonAsTree.Tree = imported[2];
     * assert(Tree.is(inner, JsonAsTree.Array));
     * const leaf = inner[0];
     * ```
     * @sealed @alpha
     */
    class Array extends _APIExtractorWorkaroundArrayBase {
    }
}
//# sourceMappingURL=jsonDomainSchema.d.ts.map