/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IFluidCompatibilityMetadata, Logger, Package } from "@fluidframework/build-tools"; import { PackageCommand } from "../../BasePackageCommand.js"; import type { PackageSelectionDefault } from "../../flags.js"; export declare const daysInMonthApproximation = 33; export default class UpdateGenerationCommand extends PackageCommand { static readonly description = "Updates the generation and release date for layer compatibility."; static readonly flags: { readonly private: import("@oclif/core/interfaces").BooleanFlag; readonly scope: import("@oclif/core/interfaces").OptionFlag; readonly skipScope: import("@oclif/core/interfaces").OptionFlag; readonly all: import("@oclif/core/interfaces").BooleanFlag; readonly dir: import("@oclif/core/interfaces").OptionFlag; readonly packages: import("@oclif/core/interfaces").BooleanFlag; readonly releaseGroup: import("@oclif/core/interfaces").OptionFlag<("client" | "server" | "build-tools" | "all" | "gitrest" | "historian")[] | undefined, import("@oclif/core/interfaces").CustomOptions>; readonly releaseGroupRoot: import("@oclif/core/interfaces").OptionFlag<("client" | "server" | "build-tools" | "all" | "gitrest" | "historian")[] | undefined, import("@oclif/core/interfaces").CustomOptions>; readonly changed: import("@oclif/core/interfaces").BooleanFlag; readonly branch: import("@oclif/core/interfaces").OptionFlag; readonly concurrency: import("@oclif/core/interfaces").OptionFlag; readonly generationDir: import("@oclif/core/interfaces").OptionFlag; readonly outFile: import("@oclif/core/interfaces").OptionFlag; readonly minimumCompatWindowMonths: import("@oclif/core/interfaces").OptionFlag; }; protected defaultSelection: PackageSelectionDefault; protected processPackage(pkg: Package): Promise; } /** * Determines if the current package version represents a patch release. * * @param pkgVersion - The semantic version of the package (e.g., "2.0.1") * @returns True if the version is a patch release, false otherwise * * @throws Error When the provided version string is not a valid semantic version * * @example * ```typescript * isCurrentPackageVersionPatch("2.0.1"); // returns true * isCurrentPackageVersionPatch("2.1.0"); // returns false * isCurrentPackageVersionPatch("3.0.0"); // returns false * ``` */ export declare function isCurrentPackageVersionPatch(pkgVersion: string): boolean; /** * Generates the complete content for a layer generation TypeScript file. * * Creates a properly formatted TypeScript file with copyright header, autogenerated warning, * and export for generation number. * * @param generation - The layer compatibility generation number * @returns The complete file content as a string ready to be written to disk * * @example * ```typescript * const content = generateLayerFileContent(5); * // Returns a complete TypeScript file with exports: * // export const generation = 5; * ``` */ export declare function generateLayerFileContent(generation: number): string; /** * Determines if a new generation should be generated based on package version changes and time since * the last release. * * This function parses an existing layer generation file and decides whether to increment the generation * number based on: * 1. Whether the package version has changed since the last update * 2. How much time has elapsed since the previous release date * 3. The minimum compatibility window constraints * * The generation increment is calculated as the number of months since the previous release, * but capped at (minimumCompatWindowMonths - 1) to maintain compatibility requirements. * * @param currentPkgVersion - The current package version to compare against the stored version * @param fluidCompatMetadata - The existing Fluid compatibility metadata from the previous generation * @param minimumCompatWindowMonths - The maximum number of months of compatibility to maintain across layers * @param log - Logger instance for verbose output about the calculation process * @returns The new generation number if an update is needed, or undefined if no update is required * * @throws Error When the generation file content doesn't match the expected format * @throws Error When the current date is older than the previous release date */ export declare function maybeGetNewGeneration(currentPkgVersion: string, fluidCompatMetadata: IFluidCompatibilityMetadata, minimumCompatWindowMonths: number, log: Logger): number | undefined; //# sourceMappingURL=layerCompatGeneration.d.ts.map