/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type TreeFieldStoredSchema, Multiplicity, type SchemaAndPolicy } from "../core/index.js";
import type { MapTreeFieldViewGeneric, MinimalMapTreeNodeView } from "./mapTreeCursor.js";
export declare enum SchemaValidationError {
    Field_KindNotInSchemaPolicy = 0,
    Field_MissingRequiredChild = 1,
    Field_MultipleChildrenNotAllowed = 2,
    Field_ChildInForbiddenField = 3,
    Field_NodeTypeNotAllowed = 4,
    LeafNode_InvalidValue = 5,
    LeafNode_FieldsNotAllowed = 6,
    ObjectNode_FieldNotInSchema = 7,
    NonLeafNode_ValueNotAllowed = 8,
    Node_MissingSchema = 9
}
/**
 * Throws a UsageError indicating a tree is out of schema.
 */
export declare function throwOutOfSchema(maybeError: SchemaValidationError): never;
type NotUndefined = number | string | boolean | bigint | symbol | object;
/**
 * Deeply checks that the provided node complies with the schema based on its identifier.
 *
 * @param onError - Called with the first error (if any).
 *
 * @returns the return value from `onError` if the node or anything inside of it is out of schema, otherwise `undefined`.
 */
export declare function isNodeInSchema<T extends NotUndefined>(node: MinimalMapTreeNodeView, schemaAndPolicy: SchemaAndPolicy, onError: (error: SchemaValidationError) => T): T | undefined;
/**
 * Deeply checks that the nodes comply with the field schema and included schema.
 *
 * @param onError - Called with the first error (if any).
 *
 * @returns the return value from `onError` if the field or anything inside of it is out of schema, otherwise `undefined`.
 */
export declare function isFieldInSchema<T extends NotUndefined>(childNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>, schema: TreeFieldStoredSchema, schemaAndPolicy: SchemaAndPolicy, onError: (error: SchemaValidationError) => T): T | undefined;
/**
 * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.
 * @param numberOfItems - Number of items.
 * @param multiplicity - Kind of multiplicity to validate against.
 * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.
 */
export declare function compliesWithMultiplicity(numberOfItems: number, multiplicity: Multiplicity): SchemaValidationError | undefined;
export {};
//# sourceMappingURL=schemaChecker.d.ts.map