"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdaptedViewSchema = exports.AllowedUpdateType = exports.Compatibility = void 0;
/**
 * APIs for applying `view schema` to documents.
 */
/**
 * How compatible a particular view schema is for some operation on some specific document.
 */
var Compatibility;
(function (Compatibility) {
    Compatibility[Compatibility["Incompatible"] = 0] = "Incompatible";
    // For write compatibility this can include compatible schema updates to stored schema.
    // TODO: separate schema updates from adapters.
    // RequiresAdapters,
    Compatibility[Compatibility["Compatible"] = 1] = "Compatible";
})(Compatibility || (exports.Compatibility = Compatibility = {}));
/**
 * What kinds of updates to stored schema to permit.
 *
 * Bit flags enum.
 * @internal
 */
var AllowedUpdateType;
(function (AllowedUpdateType) {
    /**
     * Do not update the stored schema to match view schema.
     */
    AllowedUpdateType[AllowedUpdateType["None"] = 0] = "None";
    /**
     * Update the stored schema as part of initializing an empty document.
     *
     * Includes "Initialize".
     */
    // eslint-disable-next-line no-bitwise
    AllowedUpdateType[AllowedUpdateType["Initialize"] = 1] = "Initialize";
    /**
     * Update the stored schema to match the view schema if the current document contents are compatible with the view schema.
     * TODO: support this option.
     */
    // DataCompatible,
    /**
     * Update the stored schema to match view schema if all possible documents based on the current stored schema would be compatible with the view schema.
     *
     * Includes "Initialize".
     */
    // eslint-disable-next-line no-bitwise
    AllowedUpdateType[AllowedUpdateType["SchemaCompatible"] = 2] = "SchemaCompatible";
})(AllowedUpdateType || (exports.AllowedUpdateType = AllowedUpdateType = {}));
/**
 * A collection of View information for schema, including policy.
 */
class AdaptedViewSchema {
    constructor(adapters, adaptedForViewSchema) {
        this.adapters = adapters;
        this.adaptedForViewSchema = adaptedForViewSchema;
    }
}
exports.AdaptedViewSchema = AdaptedViewSchema;
//# sourceMappingURL=view.js.map