/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Adapters, TreeAdapter, TreeSchemaIdentifier } from "../../core";
import { FullSchemaPolicy } from "../modular-schema";
import { FieldSchema, TreeSchema, TypedSchemaCollection } from "./typedTreeSchema";
import { Sourced } from "./view";
/**
 * Schema data collected by a single SchemaBuilder (does not include referenced libraries).
 * @alpha
 */
export interface SchemaLibraryData {
    readonly name: string;
    readonly rootFieldSchema?: FieldSchema;
    readonly treeSchema: ReadonlyMap<TreeSchemaIdentifier, TreeSchema>;
    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.
 * @alpha
 */
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).
 */
export declare function buildViewSchemaCollection(lintConfiguration: SchemaLintConfiguration, libraries: Iterable<SchemaLibraryData>): TypedSchemaCollection;
/**
 * View Schema information collected from a SchemaBuilder.
 * Internal type for unifying document schema and libraries for use in validation and conversion.
 */
export interface ViewSchemaCollection {
    readonly rootFieldSchema?: FieldSchema;
    readonly treeSchema: ReadonlyMap<TreeSchemaIdentifier, TreeSchema>;
    readonly policy: FullSchemaPolicy;
    readonly adapters: Adapters;
}
/**
 * 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 validateViewSchemaCollection(lintConfiguration: SchemaLintConfiguration, collection: ViewSchemaCollection): string[];
export declare function validateRootField(lintConfiguration: SchemaLintConfiguration, collection: ViewSchemaCollection, field: FieldSchema, errors: string[]): void;
export declare function validateField(lintConfiguration: SchemaLintConfiguration, collection: ViewSchemaCollection, field: FieldSchema, describeField: () => string, errors: string[]): void;
/**
 * Reserved field names to avoid collisions with the API.
 */
export declare const bannedFieldNames: Set<string>;
/**
 * Field names starting with these must not be followed by an upper case letter
 */
export declare const fieldApiPrefixes: Set<string>;
export declare function validateStructFieldName(name: string, describeField: () => string, errors: string[]): void;
//# sourceMappingURL=schemaCollection.d.ts.map