/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Named } from "../../util/index.js";
import { TreeStoredSchema, Adapters, AdaptedViewSchema, Compatibility } from "../../core/index.js";
import { FullSchemaPolicy } from "../modular-schema/index.js";
import { FlexFieldSchema, FlexTreeSchema } from "./typedTreeSchema.js";
/**
 * A collection of View information for schema, including policy.
 */
export declare class ViewSchema<out TSchema extends FlexFieldSchema = FlexFieldSchema> {
    readonly policy: FullSchemaPolicy;
    readonly adapters: Adapters;
    readonly schema: FlexTreeSchema<TSchema>;
    /**
     * Cached conversion of `schema` into a stored schema.
     */
    readonly storedSchema: TreeStoredSchema;
    constructor(policy: FullSchemaPolicy, adapters: Adapters, schema: FlexTreeSchema<TSchema>);
    /**
     * 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: TreeStoredSchema): {
        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.
     */
    adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema;
    /**
     * Adapt original such that it allows member types which can be adapted to its specified types.
     */
    private adaptField;
    private adaptTree;
}
/**
 * Record where a schema came from for error reporting purposes.
 * @internal
 */
export interface Sourced {
    readonly builder: Named<string>;
}
//# sourceMappingURL=view.d.ts.map