export interface AutorestEmitterOptions { /** * @deprecated DO NOT USE. Use built-in emitter-output-dir instead */ "output-dir"?: string; /** * Name of the output file. * Output file will interpolate the following values: * - service-name: Name of the service if multiple * - version: Version of the service if multiple * * @default `{emitter-output-dir}/{service-name}/{version-status}/{version}/openapi.json` * * * @example Single service no versioning * - `openapi.yaml` * * @example Multiple services no versioning * - `openapi.Org1.Service1.yaml` * - `openapi.Org1.Service2.yaml` * * @example Single service with versioning * - `openapi.v1.yaml` * - `openapi.v2.yaml` * * @example Multiple service with versioning * - `openapi.Org1.Service1.v1.yaml` * - `openapi.Org1.Service1.v2.yaml` * - `openapi.Org1.Service2.v1.0.yaml` * - `openapi.Org1.Service2.v1.1.yaml` * * @example azureResourceProviderFolder is provided * - `arm-folder/AzureService/preview/2020-01-01.yaml` * - `arm-folder/AzureService/preview/2020-01-01.yaml` */ "output-file"?: string; /** * Directory where the examples are located. * @default `{project-root}/examples` */ "examples-dir"?: string; /** * @deprecated use {@link examples-dir} */ "examples-directory"?: string; version?: string; /** @deprecated Do not use this option. Specify the path directly in emitter-output-dir. */ "azure-resource-provider-folder"?: string; /** * Set the newline character for emitting files. * @default lf */ "new-line"?: "crlf" | "lf"; /** * 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. */ "omit-unreachable-types"?: boolean; /** * Decide how to deal with the Version enum when when `omit-unreachable-types` is not set. * @default "omit" */ "version-enum-strategy"?: "omit" | "include"; /** * If the generated openapi types should have the `x-typespec-name` extension set with the name of the TypeSpec type that created it. * This extension is meant for debugging and should not be depended on. * @default "never" */ "include-x-typespec-name"?: "inline-only" | "never"; /** * Path to the common-types.json file folder. * @default "${project-root}/../../common-types/resource-management" */ "arm-types-dir"?: string; /** * Determines whether to transmit the 'readOnly' property to lro status schemas. * @default false */ "use-read-only-status-schema"?: boolean; /** * Determines whether and how to emit the x-ms-long-running-operation-options * @default "final-state-only" */ "emit-lro-options"?: "none" | "final-state-only" | "all"; /** * Determines whether and how to emit schemas for common-types * @default "for-visibility-changes" */ "emit-common-types-schema"?: "never" | "for-visibility-changes"; /** * Strategy for applying XML serialization metadata to schemas. * * - "xml-service": Apply XML serialization metadata for any service that uses the `"application/xml"` content type. * - "none": Do not apply any XML serialization metadata. * * @default "xml-service" */ "xml-strategy"?: "xml-service" | "none"; /** * Determines whether output should be split into multiple files. The only supported option for splitting is "legacy-feature-files", * which uses the typespec-azure-resource-manager `@feature` decorators to split into output files based on feature. */ "output-splitting"?: "legacy-feature-files"; /** * When enabled, the emitter will not copy example files to the output directory. * Instead, it will reference the source example files using relative file paths. * @default false */ "skip-example-copying"?: 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 when a type lives outside the service namespace * (e.g. `LiftrBase.Foo`). The service (and root `TypeSpec`) namespace is always stripped. This * is the current/default behavior. * - `"name-only"`: Use only the type name without any namespace prefix (e.g. `Foo`). When two * types from different namespaces collapse to the same name, the conflict is reported as an * error (`@typespec/openapi/duplicate-type-name`). * * @default "namespaced" */ "type-name-strategy"?: "namespaced" | "name-only"; /** * Controls emission of a `service.yaml` manifest (declaring the service's API versions) * at the project root, next to `tspconfig.yaml`. * * - `"auto"`: Emit/update `service.yaml` only if the file already exists. (default) * - `"always"`: Always emit `service.yaml`. * - `"never"`: Never emit `service.yaml`. * * When an existing file is present it is updated in place, preserving comments and unrelated keys. * * @default "auto" */ "service-yaml"?: "auto" | "always" | "never"; /** * Controls how the emitter sources `x-ms-examples`. * * - `"auto"`: Use the unified `examples.yaml` format when a `examples.yaml` (or * `examples/*.yaml`) file is present at the project root; otherwise fall back to loading legacy * per-version `x-ms-examples` JSON files from `examples-dir`. (default) * - `"legacy"`: Only load legacy per-version `x-ms-examples` JSON files. * - `"unified"`: Only load the unified `examples.yaml` format, resolving and materializing the * applicable example for each operation at the emitted API version and writing the resulting * legacy `x-ms-examples` JSON files. Enables a smooth rollout of the new format without * changing downstream consumers. * * @default "auto" */ "examples-format"?: "auto" | "legacy" | "unified"; } export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{ "duplicate-body-types": { readonly default: "Request has multiple body types"; }; "duplicate-header": { readonly default: import("@typespec/compiler").CallableMessage<["header"]>; }; "duplicate-example": { readonly default: "Duplicate @example declarations on operation"; }; "duplicate-example-file": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "title", "operationId"]>; }; "duplicate-operation-id": { readonly default: import("@typespec/compiler").CallableMessage<["operationId"]>; }; "invalid-schema": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "union-null": { readonly default: "Cannot have a union containing only null types."; }; "union-unsupported": { readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."; readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value."; }; "invalid-multi-collection-format": { readonly default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "inline-cycle": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "nonspecific-scalar": { readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>; }; "example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "error"]>; readonly noDirectory: import("@typespec/compiler").CallableMessage<["directory"]>; readonly noOperationId: import("@typespec/compiler").CallableMessage<["filename"]>; }; "unknown-example-operation": { readonly default: import("@typespec/compiler").CallableMessage<["operation", "version"]>; }; "unified-example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["message"]>; }; "unsupported-http-auth-scheme": { readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>; }; "unsupported-status-code-range": { readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>; }; "unsupported-multipart-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-param-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-optional-path-param": { readonly default: import("@typespec/compiler").CallableMessage<["name"]>; }; "cookies-unsupported": { readonly default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`; }; "unknown-format": { readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>; readonly encoding: import("@typespec/compiler").CallableMessage<["schema", "format"]>; }; "unsupported-auth": { readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; }; "no-matching-version-found": { readonly default: "The emitter did not emit any files because the specified version option does not match any versions of the service."; }; "service-yaml-multiple-services": { readonly default: "Cannot emit service.yaml because the project defines multiple services. Only the first service will be included."; }; "inconsistent-client-api-version-override": { readonly default: import("@typespec/compiler").CallableMessage<["values", "fallback"]>; }; }, AutorestEmitterOptions, "example" | "useRef">; export declare const reportDiagnostic: ; }; "duplicate-example": { readonly default: "Duplicate @example declarations on operation"; }; "duplicate-example-file": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "title", "operationId"]>; }; "duplicate-operation-id": { readonly default: import("@typespec/compiler").CallableMessage<["operationId"]>; }; "invalid-schema": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "union-null": { readonly default: "Cannot have a union containing only null types."; }; "union-unsupported": { readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."; readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value."; }; "invalid-multi-collection-format": { readonly default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "inline-cycle": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "nonspecific-scalar": { readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>; }; "example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "error"]>; readonly noDirectory: import("@typespec/compiler").CallableMessage<["directory"]>; readonly noOperationId: import("@typespec/compiler").CallableMessage<["filename"]>; }; "unknown-example-operation": { readonly default: import("@typespec/compiler").CallableMessage<["operation", "version"]>; }; "unified-example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["message"]>; }; "unsupported-http-auth-scheme": { readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>; }; "unsupported-status-code-range": { readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>; }; "unsupported-multipart-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-param-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-optional-path-param": { readonly default: import("@typespec/compiler").CallableMessage<["name"]>; }; "cookies-unsupported": { readonly default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`; }; "unknown-format": { readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>; readonly encoding: import("@typespec/compiler").CallableMessage<["schema", "format"]>; }; "unsupported-auth": { readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; }; "no-matching-version-found": { readonly default: "The emitter did not emit any files because the specified version option does not match any versions of the service."; }; "service-yaml-multiple-services": { readonly default: "Cannot emit service.yaml because the project defines multiple services. Only the first service will be included."; }; "inconsistent-client-api-version-override": { readonly default: import("@typespec/compiler").CallableMessage<["values", "fallback"]>; }; }[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{ "duplicate-body-types": { readonly default: "Request has multiple body types"; }; "duplicate-header": { readonly default: import("@typespec/compiler").CallableMessage<["header"]>; }; "duplicate-example": { readonly default: "Duplicate @example declarations on operation"; }; "duplicate-example-file": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "title", "operationId"]>; }; "duplicate-operation-id": { readonly default: import("@typespec/compiler").CallableMessage<["operationId"]>; }; "invalid-schema": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "union-null": { readonly default: "Cannot have a union containing only null types."; }; "union-unsupported": { readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."; readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value."; }; "invalid-multi-collection-format": { readonly default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "inline-cycle": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "nonspecific-scalar": { readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>; }; "example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "error"]>; readonly noDirectory: import("@typespec/compiler").CallableMessage<["directory"]>; readonly noOperationId: import("@typespec/compiler").CallableMessage<["filename"]>; }; "unknown-example-operation": { readonly default: import("@typespec/compiler").CallableMessage<["operation", "version"]>; }; "unified-example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["message"]>; }; "unsupported-http-auth-scheme": { readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>; }; "unsupported-status-code-range": { readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>; }; "unsupported-multipart-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-param-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-optional-path-param": { readonly default: import("@typespec/compiler").CallableMessage<["name"]>; }; "cookies-unsupported": { readonly default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`; }; "unknown-format": { readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>; readonly encoding: import("@typespec/compiler").CallableMessage<["schema", "format"]>; }; "unsupported-auth": { readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; }; "no-matching-version-found": { readonly default: "The emitter did not emit any files because the specified version option does not match any versions of the service."; }; "service-yaml-multiple-services": { readonly default: "Cannot emit service.yaml because the project defines multiple services. Only the first service will be included."; }; "inconsistent-client-api-version-override": { readonly default: import("@typespec/compiler").CallableMessage<["values", "fallback"]>; }; }, C, M>) => void, createDiagnostic: ; }; "duplicate-example": { readonly default: "Duplicate @example declarations on operation"; }; "duplicate-example-file": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "title", "operationId"]>; }; "duplicate-operation-id": { readonly default: import("@typespec/compiler").CallableMessage<["operationId"]>; }; "invalid-schema": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "union-null": { readonly default: "Cannot have a union containing only null types."; }; "union-unsupported": { readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."; readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value."; }; "invalid-multi-collection-format": { readonly default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "inline-cycle": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "nonspecific-scalar": { readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>; }; "example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "error"]>; readonly noDirectory: import("@typespec/compiler").CallableMessage<["directory"]>; readonly noOperationId: import("@typespec/compiler").CallableMessage<["filename"]>; }; "unknown-example-operation": { readonly default: import("@typespec/compiler").CallableMessage<["operation", "version"]>; }; "unified-example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["message"]>; }; "unsupported-http-auth-scheme": { readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>; }; "unsupported-status-code-range": { readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>; }; "unsupported-multipart-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-param-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-optional-path-param": { readonly default: import("@typespec/compiler").CallableMessage<["name"]>; }; "cookies-unsupported": { readonly default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`; }; "unknown-format": { readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>; readonly encoding: import("@typespec/compiler").CallableMessage<["schema", "format"]>; }; "unsupported-auth": { readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; }; "no-matching-version-found": { readonly default: "The emitter did not emit any files because the specified version option does not match any versions of the service."; }; "service-yaml-multiple-services": { readonly default: "Cannot emit service.yaml because the project defines multiple services. Only the first service will be included."; }; "inconsistent-client-api-version-override": { readonly default: import("@typespec/compiler").CallableMessage<["values", "fallback"]>; }; }[C]>(diag: import("@typespec/compiler").DiagnosticReport<{ "duplicate-body-types": { readonly default: "Request has multiple body types"; }; "duplicate-header": { readonly default: import("@typespec/compiler").CallableMessage<["header"]>; }; "duplicate-example": { readonly default: "Duplicate @example declarations on operation"; }; "duplicate-example-file": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "title", "operationId"]>; }; "duplicate-operation-id": { readonly default: import("@typespec/compiler").CallableMessage<["operationId"]>; }; "invalid-schema": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "union-null": { readonly default: "Cannot have a union containing only null types."; }; "union-unsupported": { readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."; readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value."; }; "invalid-multi-collection-format": { readonly default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "inline-cycle": { readonly default: import("@typespec/compiler").CallableMessage<["type"]>; }; "nonspecific-scalar": { readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>; }; "example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["filename", "error"]>; readonly noDirectory: import("@typespec/compiler").CallableMessage<["directory"]>; readonly noOperationId: import("@typespec/compiler").CallableMessage<["filename"]>; }; "unknown-example-operation": { readonly default: import("@typespec/compiler").CallableMessage<["operation", "version"]>; }; "unified-example-loading": { readonly default: import("@typespec/compiler").CallableMessage<["message"]>; }; "unsupported-http-auth-scheme": { readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>; }; "unsupported-status-code-range": { readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>; }; "unsupported-multipart-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-param-type": { readonly default: import("@typespec/compiler").CallableMessage<["part"]>; }; "unsupported-optional-path-param": { readonly default: import("@typespec/compiler").CallableMessage<["name"]>; }; "cookies-unsupported": { readonly default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`; }; "unknown-format": { readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>; readonly encoding: import("@typespec/compiler").CallableMessage<["schema", "format"]>; }; "unsupported-auth": { readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; }; "no-matching-version-found": { readonly default: "The emitter did not emit any files because the specified version option does not match any versions of the service."; }; "service-yaml-multiple-services": { readonly default: "Cannot emit service.yaml because the project defines multiple services. Only the first service will be included."; }; "inconsistent-client-api-version-override": { readonly default: import("@typespec/compiler").CallableMessage<["values", "fallback"]>; }; }, C, M>) => import("@typespec/compiler").Diagnostic, AutorestStateKeys: Record<"example" | "useRef", symbol>, getTracer: (program: import("@typespec/compiler").Program) => import("@typespec/compiler").Tracer; //# sourceMappingURL=lib.d.ts.map