import { type Program, type Service } from "@typespec/compiler"; import type { OpenAPI2Document } from "./openapi2-document.js"; import { type AutorestEmitterResult, type OpenApi2DocumentProxy } from "./types.js"; import { type AutorestEmitterContext } from "./utils.js"; /** * Options to configure the behavior of the Autorest document emitter. */ export interface AutorestDocumentEmitterOptions { readonly examplesDirectory?: string; /** * Omit unreachable types. * By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted. */ readonly omitUnreachableTypes?: boolean; /** * If the x-typespec-name extension should be included */ readonly includeXTypeSpecName: "inline-only" | "never"; /** * Arm types dir */ readonly armTypesDir: string; /** * readOnly property schema behavior */ readonly useReadOnlyStatusSchema?: boolean; /** * Decide how to deal with the version enum when `omitUnreachableTypes` is not set. * @default "omit" */ readonly versionEnumStrategy?: "omit" | "include"; /** * Determines whether and how to emit x-ms-long-running-operation-options * to describe resolution of asynchronous operations * @default "final-state-only" */ readonly emitLroOptions?: "none" | "final-state-only" | "all"; /** * Determines whether and how to emit schema for arm common-types * @default "for-visibility-only" */ readonly emitCommonTypesSchema?: "never" | "for-visibility-changes"; readonly xmlStrategy: "xml-service" | "none"; /** * Determines whether output should be split into multiple files. The only supported option for splitting is "legacy-feature-files", */ readonly outputSplitting?: "legacy-feature-files"; /** * When enabled, example files will not be copied to the output directory. * Instead, the source example files will be referenced using relative file paths. * @default false */ readonly skipExampleCopying?: boolean; /** * Strategy for naming the OpenAPI names derived from TypeSpec types (definition/schema * names, parameter keys, inline names, `x-typespec-name`, etc.). * * - `"namespaced"`: Include the namespace prefix for types outside the service namespace * (e.g. `LiftrBase.Foo`). Default. * - `"name-only"`: Use only the type name without any namespace prefix (e.g. `Foo`). Conflicts are * reported as an error. * @default "namespaced" */ readonly typeNameStrategy?: "namespaced" | "name-only"; /** * Controls how the emitter sources `x-ms-examples`. * * - `"auto"`: Use the unified `examples.yaml` format when present, otherwise legacy JSON files. * - `"legacy"`: Only load legacy per-version `x-ms-examples` JSON files. * - `"unified"`: Only read the unified `examples.yaml`, materializing legacy files per version. * @default "auto" */ readonly examplesFormat?: "auto" | "legacy" | "unified"; } export declare function getOpenAPIForService(context: AutorestEmitterContext, options: AutorestDocumentEmitterOptions): Promise; export declare function sortOpenAPIDocument(doc: OpenAPI2Document): OpenAPI2Document; export declare function createDocumentProxy(program: Program, service: Service, options: AutorestDocumentEmitterOptions, version?: string): OpenApi2DocumentProxy; export declare function createDefaultDocumentProxy(program: Program, service: Service, options: AutorestDocumentEmitterOptions, version?: string): OpenApi2DocumentProxy; //# sourceMappingURL=openapi.d.ts.map