/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ObjectNodeStoredSchema, type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet } from "../core/index.js";
import { type FlexFieldKind } from "../feature-libraries/index.js";
import { type JsonCompatibleReadOnlyObject } from "../util/index.js";
import { type StoredSchemaGenerationOptions } from "./core/index.js";
import { FieldKind, FieldSchemaAlpha, type ImplicitAnnotatedFieldSchema } from "./fieldSchema.js";
import type { SimpleFieldSchema, SimpleNodeSchema } from "./simpleSchema.js";
export declare const restrictiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions;
export declare const permissiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions;
/**
 * Converts a {@link ImplicitAnnotatedFieldSchema} into a {@link TreeStoredSchema} for use in schema upgrades.
 *
 * TODO: once upgrades are more flexible, this should take in more options, including the old schema and specific upgrades to enable.
 */
export declare function toUpgradeSchema(root: ImplicitAnnotatedFieldSchema): TreeStoredSchema;
/**
 * Converts a {@link ImplicitAnnotatedFieldSchema} into a {@link TreeStoredSchema} for use as initial document schema.
 */
export declare function toInitialSchema(root: ImplicitAnnotatedFieldSchema): TreeStoredSchema;
/**
 * Converts a {@link ImplicitAnnotatedFieldSchema} into a {@link TreeStoredSchema} to used for unhydrated nodes.
 * @remarks
 * This allows as much as possible, relying on further validation when inserting the content.
 *
 * TODO: this should get additional options to enable support for unknown optional fields.
 */
export declare const toUnhydratedSchema: StoredSchemaGenerationOptions;
/**
 * Converts a {@link ImplicitAnnotatedFieldSchema} into a {@link TreeStoredSchema}.
 *
 * @privateRemarks
 * TODO:#38722 When runtime schema upgrades are implemented, this will need to be updated to check if
 * a staged allowed type has been upgraded and if so, include it in the conversion.
 *
 * @throws
 * Throws a `UsageError` if multiple schemas are encountered with the same identifier.
 */
export declare function toStoredSchema(root: ImplicitAnnotatedFieldSchema, options: StoredSchemaGenerationOptions): TreeStoredSchema;
/**
 * Normalizes an {@link ImplicitFieldSchema} into a {@link TreeFieldSchema}.
 */
export declare function convertField(schema: SimpleFieldSchema | FieldSchemaAlpha, options: StoredSchemaGenerationOptions): TreeFieldStoredSchema;
/**
 * A map that converts {@link FieldKind} to {@link FlexFieldKind}.
 */
export declare const convertFieldKind: ReadonlyMap<FieldKind, FlexFieldKind>;
/**
 * Converts a {@link TreeNodeSchema} into a {@link TreeNodeStoredSchema}.
 * @privateRemarks
 * TODO: Persist node metadata once schema FormatV2 is supported.
 *
 * TODO: AB#43548: Using a stored schema for unhydrated flex trees does not handle schema evolution features like "allowUnknownOptionalFields".
 * Usage of this and the conversion which wrap it should be audited and reduced.
 */
export declare function getStoredSchema(schema: SimpleNodeSchema, options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;
export declare function arrayNodeStoredSchema(types: TreeTypeSet, persistedMetadata: JsonCompatibleReadOnlyObject | undefined): ObjectNodeStoredSchema;
//# sourceMappingURL=toStoredSchema.d.ts.map