/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { LocalFieldKey, TreeSchemaIdentifier, SchemaData, GlobalFieldKey, Adapters, ViewSchemaData, AdaptedViewSchema, Compatibility, Named, NamedTreeSchema, TreeTypeSet } from "../../core";
import { FieldKind, FullSchemaPolicy } from "./fieldKind";
/**
 * A collection of View information for schema, including policy.
 */
export declare class ViewSchema extends ViewSchemaData<FullSchemaPolicy> {
    readonly schema: SchemaCollection;
    constructor(policy: FullSchemaPolicy, adapters: Adapters, schema: SchemaCollection);
    /**
     * Determines the compatibility of a stored document
     * (based on its stored schema) with a viewer (based on its view schema).
     *
     * Adapters can be provided to handle differences between the two schema.
     * Adapters should only use to types in the `view` SchemaRepository.
     *
     * TODO: this API violates the parse don't validate design philosophy.
     * It should be wrapped with (or replaced by) a parse style API.
     */
    checkCompatibility(stored: SchemaData): {
        read: Compatibility;
        write: Compatibility;
        writeAllowingStoredSchemaUpdates: Compatibility;
    };
    /**
     * Compute a schema that `original` could be viewed as using adapters as needed.
     *
     * TODO: have a way for callers to get invalidated on schema updates.
     * Maybe pass in StoredSchemaRepository and optional ObservingDependent?
     */
    adaptRepo(stored: SchemaData): AdaptedViewSchema;
    /**
     * Adapt original such that it allows member types which can be adapted to its specified types.
     */
    private adaptField;
    private adaptTree;
}
/**
 * @alpha
 */
export interface ITreeSchema extends NamedTreeSchema, Sourced {
    readonly localFields: ReadonlyMap<LocalFieldKey, IFieldSchema>;
    readonly globalFields: ReadonlySet<GlobalFieldKey>;
    readonly extraLocalFields: IFieldSchema;
}
/**
 * All policy for a specific field kind,
 * including functionality that does not have to be kept consistent across versions or deterministic.
 *
 * This can include policy for how to use this schema for "view" purposes, and well as how to expose editing APIs.
 * @alpha
 */
export interface IFieldSchema {
    readonly kind: FieldKind;
    /**
     * Types allowed in this field.
     *
     * TODO: Put behind a function so it can be lazy and support cycles.
     */
    readonly types: TreeTypeSet;
}
/**
 * Schema data that can be be used to view a document.
 * @alpha
 */
export interface SchemaCollection {
    readonly globalFieldSchema: ReadonlyMap<GlobalFieldKey, IFieldSchema>;
    readonly treeSchema: ReadonlyMap<TreeSchemaIdentifier, ITreeSchema>;
    readonly policy: FullSchemaPolicy;
    readonly adapters: Adapters;
}
/**
 * Record where a schema came from for error reporting purposes.
 * @alpha
 */
export interface Sourced {
    readonly builder: Named<string>;
}
//# sourceMappingURL=view.d.ts.map