/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { PackageJson } from "@fluidframework/build-tools"; import type { CommandLogger } from "../../logging.js"; import type { ExportData, Node10CompatExportData } from "../packageExports.js"; import { BaseCommand } from "./base.js"; interface Options { readonly mainEntrypoint: string; readonly resolutionConditions: string[]; readonly outDir: string; readonly outFilePrefix: string; /** * File path for `@alpha` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue "alpha" */ readonly outFileAlpha: string | undefined; /** * File path for `@beta` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue "beta" */ readonly outFileBeta: string | undefined; /** * File path for `@public` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue "public" */ readonly outFilePublic: string | undefined; /** * File path for `@legacy` + `@alpha` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue "legacy" */ readonly outFileLegacyAlpha: string | undefined; /** * File path for `@legacy` + `@beta` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue `undefined` */ readonly outFileLegacyBeta: string | undefined; /** * File path for `@legacy` + `@public` API entrypoint. * @remarks To opt out of generating this entrypoint, set to `undefined`. * @defaultValue `undefined` */ readonly outFileLegacyPublic: string | undefined; readonly outFileSuffix: string; } /** * {@link Options} defaults. * @privateRemarks Exported for testing. */ export declare const optionDefaults: { readonly mainEntrypoint: "./src/index.ts"; readonly resolutionConditions: []; readonly outDir: "./lib"; readonly outFilePrefix: ""; readonly outFileAlpha: "alpha"; readonly outFileBeta: "beta"; readonly outFilePublic: "public"; readonly outFileLegacyAlpha: undefined; readonly outFileLegacyBeta: undefined; readonly outFileLegacyPublic: undefined; readonly outFileSuffix: ".d.ts"; }; /** * Generates type declarations files for Fluid Framework APIs to support API levels (/alpha, /beta. etc.). */ export declare class GenerateEntrypointsCommand extends BaseCommand { static readonly description = "Generates type declaration entrypoints for Fluid Framework API levels (/alpha, /beta. etc.) as found in package.json \"exports\""; static readonly flags: { mainEntrypoint: import("@oclif/core/interfaces").OptionFlag; resolutionConditions: import("@oclif/core/interfaces").OptionFlag; outDir: import("@oclif/core/interfaces").OptionFlag; outFilePrefix: import("@oclif/core/interfaces").OptionFlag; outFileAlpha: import("@oclif/core/interfaces").OptionFlag; outFileBeta: import("@oclif/core/interfaces").OptionFlag; outFilePublic: import("@oclif/core/interfaces").OptionFlag; outFileLegacyAlpha: import("@oclif/core/interfaces").OptionFlag; outFileLegacyBeta: import("@oclif/core/interfaces").OptionFlag; outFileLegacyPublic: import("@oclif/core/interfaces").OptionFlag; outFileSuffix: import("@oclif/core/interfaces").OptionFlag; node10TypeCompat: import("@oclif/core/interfaces").BooleanFlag; }; run(): Promise; } /** * Reads command line argument values that are simple value following option like: * --optionName value * * @param commandLine - command line to extract from * @param argQuery - record of arguments to read (keys) with default values * @returns record of argument values extracted or given default value * * @remarks * This functionality only supports arguments that are "--flagName single-value" pairs. * In practice, other values that come through argQuery are preserved (default values * used), but no caller should rely on unsupported arguments. Thus the return type is * trimmed to those and also only those named with "out" prefix. * * @privateRemarks Exported for testing. */ export declare function readArgValues(commandLine: string, argQuery: Options): Pick; export declare function getGenerateEntrypointsOutput(packageJson: PackageJson, commandLine: string): IterableIterator; /** * Create Node10 entrypoint file content. * * @remarks * Generates the necessary export statement to re-export the contents of `sourceTypeRelPath` from a file under `dirPath`. * Ensures the generated file path is explicitly relative to ensure Node10 compatibility. * * @privateRemarks Exported for testing. */ export declare function createNode10EntrypointFileContent({ dirPath, sourceTypeRelPath, isTypeOnly, contentHeader, }: { readonly dirPath: string; readonly sourceTypeRelPath: string; readonly isTypeOnly: boolean; readonly contentHeader: string; }): string; export declare function generateNode10TypeEntrypoints(mapExportPathToData: ReadonlyMap, commandLineForGeneratedHeader: string, log: CommandLogger): Promise; export {}; //# sourceMappingURL=generateEntrypoints.d.ts.map