/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type Adapters, type TreeAdapter } from "../../core/index.js";
import { type FlexFieldSchema, type SchemaCollection } from "./typedTreeSchema.js";
import type { Sourced } from "./view.js";
/**
 * Schema data collected by a single SchemaBuilder (does not include referenced libraries).
 * @internal
 */
export interface SchemaLibraryData extends SchemaCollection {
    readonly name: string;
    readonly adapters: Adapters;
}
/**
 * Mutable adapter collection which records the associated factory.
 * See {@link Adapters}.
 */
export interface SourcedAdapters {
    readonly tree: (Sourced & TreeAdapter)[];
}
/**
 * Allows opting into and out of errors for some unusual schema patterns which are usually bugs.
 * @internal
 */
export interface SchemaLintConfiguration {
    readonly rejectForbidden: boolean;
    readonly rejectEmpty: boolean;
}
export declare const schemaLintDefault: SchemaLintConfiguration;
/**
 * Build and validate a SchemaCollection.
 *
 * As much as possible tries to detect anything that might be a mistake made by the schema author.
 * This will error on some valid but probably never intended to be used patterns
 * (like libraries with the same name, nodes which are impossible to create etc).
 *
 * @param name - Name of the resulting library.
 * @param lintConfiguration - configuration for what errors to generate.
 * @param libraries - Data to aggregate into the SchemaCollection.
 * @param rootFieldSchema - Only validated: not included in the result.
 *
 * @privateRemarks
 * This checks that input works with defaultSchemaPolicy.
 * If support fo other policies is added, this will need to take in the policy.
 */
export declare function aggregateSchemaLibraries(name: string, lintConfiguration: SchemaLintConfiguration, libraries: Iterable<SchemaLibraryData>, rootFieldSchema?: FlexFieldSchema): SchemaLibraryData;
/**
 * Returns an array of descriptions of errors in the collection.
 *
 * As much as possible tries to detect anything that might be a mistake made by the schema author.
 * This will error on some valid but probably never intended to be used patterns (like never nodes).
 */
export declare function validateSchemaCollection(lintConfiguration: SchemaLintConfiguration, collection: SchemaCollection, rootFieldSchema?: FlexFieldSchema): string[];
export declare function validateRootField(lintConfiguration: SchemaLintConfiguration, collection: SchemaCollection, field: FlexFieldSchema, errors: string[]): void;
export declare function validateField(lintConfiguration: SchemaLintConfiguration, collection: SchemaCollection, field: FlexFieldSchema, describeField: () => string, errors: string[]): void;
//# sourceMappingURL=schemaCollection.d.ts.map