/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { ContainerRuntimeOptionsInternal } from "./containerRuntime.js";
/**
 * Our policy is to support N/N-1 compatibility by default, where N is the most
 * recent public major release of the runtime.
 * Therefore, if the customer does not provide a minVersionForCollab, we will
 * default to use N-1.
 *
 * However, this is not consistent with today's behavior. Some options (i.e.
 * batching, compression) are enabled by default despite not being compatible
 * with 1.x clients. Since the policy was introduced during 2.x's lifespan,
 * N/N-1 compatibility by **default** will be in effect starting with 3.0.
 * Importantly though, N/N-2 compatibility is still guaranteed with the proper
 * configurations set.
 *
 * Further to distinguish unspecified `minVersionForCollab` from a specified
 * version and allow `enableExplicitSchemaControl` to default to `true` for
 * any 2.0.0+ version, we will use a special value of `2.0.0-defaults`, which
 * is semantically less than 2.0.0.
 */
export declare const defaultMinVersionForCollab: "2.0.0-defaults";
/**
 * String in a valid semver format specifying bottom of a minor version
 * or special "defaults" prerelease of a major.
 * @remarks Only 2.0.0-defaults is expected, but index signatures cannot be a
 * literal; so, just allow any major -defaults prerelease.
 */
export type MinimumMinorSemanticVersion = `${bigint}.${bigint}.0` | `${bigint}.0.0-defaults`;
/**
 * String in a valid semver format of a specific version at least specifying minor.
 *
 * @legacy
 * @alpha
 */
export type MinimumVersionForCollab = `${1 | 2}.${bigint}.${bigint}` | `${1 | 2}.${bigint}.${bigint}-${string}`;
/**
 * String in a valid semver format of a specific version at least specifying minor.
 * Unlike {@link MinimumVersionForCollab}, this type allows any bigint for the major version.
 * Used as a more generic type that allows major versions other than 1 or 2.
 *
 * @internal
 */
export type SemanticVersion = `${bigint}.${bigint}.${bigint}` | `${bigint}.${bigint}.${bigint}-${string}`;
/**
 * Generic type for runtimeOptionsAffectingDocSchemaConfigMap
 */
export type ConfigMap<T extends Record<string, unknown>> = {
    [K in keyof T]-?: {
        [version: MinimumMinorSemanticVersion]: T[K];
    };
};
/**
 * Generic type for runtimeOptionsAffectingDocSchemaConfigValidationMap
 */
export type ConfigValidationMap<T extends Record<string, unknown>> = {
    [K in keyof T]-?: (configValue: T[K]) => SemanticVersion | undefined;
};
/**
 * Subset of the {@link ContainerRuntimeOptionsInternal} properties which
 * affect {@link IDocumentSchemaFeatures}.
 *
 * @remarks
 * When a new option is added to {@link ContainerRuntimeOptionsInternal}, we
 * must consider if it changes the DocumentSchema. If so, then a corresponding
 * entry must be added to {@link runtimeOptionsAffectingDocSchemaConfigMap}
 * below. If not, then it must be omitted from this type.
 *
 * Note: `Omit` is used instead of `Pick` to ensure that all new options are
 * included in this type by default. If any new properties are added to
 * {@link ContainerRuntimeOptionsInternal}, they will be included in this
 * type unless explicitly omitted. This will prevent us from forgetting to
 * account for any new properties in the future.
 */
export type RuntimeOptionsAffectingDocSchema = Omit<ContainerRuntimeOptionsInternal, "chunkSizeInBytes" | "maxBatchSizeInBytes" | "loadSequenceNumberVerification" | "summaryOptions">;
/**
 * Returns the default RuntimeOptionsAffectingDocSchema configuration for a given minVersionForCollab.
 */
export declare function getMinVersionForCollabDefaults(minVersionForCollab: MinimumVersionForCollab): RuntimeOptionsAffectingDocSchema;
/**
 * Returns a default configuration given minVersionForCollab and configuration version map.
 */
export declare function getConfigsForMinVersionForCollab<T extends Record<SemanticVersion, unknown>>(minVersionForCollab: SemanticVersion, configMap: ConfigMap<T>): Partial<T>;
/**
 * Checks if the minVersionForCollab is valid.
 * A valid minVersionForCollab is a MinimumVersionForCollab that is at least `lowestMinVersionForCollab` and less than or equal to the current package version.
 */
export declare function isValidMinVersionForCollab(minVersionForCollab: MinimumVersionForCollab): boolean;
/**
 * Validates if the runtime options passed in from the user are compatible with the minVersionForCollab.
 * For example, if a user sets the `enableGroupedBatching` option to true, but the minVersionForCollab
 * is set to "1.0.0", then we should throw a UsageError since 1.x clients do not support batching.
 * */
export declare function validateRuntimeOptions(minVersionForCollab: MinimumVersionForCollab, runtimeOptions: Partial<ContainerRuntimeOptionsInternal>): void;
/**
 * Generic function to validate runtime options against the minVersionForCollab.
 */
export declare function getValidationForRuntimeOptions<T extends Record<string, unknown>>(minVersionForCollab: SemanticVersion, runtimeOptions: Partial<T>, validationMap: ConfigValidationMap<T>): void;
/**
 * Helper function to map ContainerRuntimeOptionsInternal config values to
 * minVersionForCollab in {@link runtimeOptionsAffectingDocSchemaConfigValidationMap}.
 */
export declare function configValueToMinVersionForCollab<T extends string | number | boolean | undefined | object, Arr extends readonly [T, SemanticVersion][]>(configToMinVer: Arr): (configValue: T) => SemanticVersion | undefined;
//# sourceMappingURL=compatUtils.d.ts.map