import { type TCGCContext } from "@azure-tools/typespec-client-generator-core"; import { type ModelProperty, type Operation, type Program, type Service, type Type } from "@typespec/compiler"; import type { OpenApi2DocumentProxy } from "./types.js"; export interface AutorestEmitterContext { readonly program: Program; readonly service: Service; readonly outputFile: string; readonly tcgcSdkContext: TCGCContext; readonly version?: string; /** The service's full ordered list of API versions (used to resolve unified examples). */ readonly versions?: readonly string[]; readonly proxy?: OpenApi2DocumentProxy; readonly multiService: boolean; } export declare function getClientName(context: AutorestEmitterContext, type: Type & { name: string; }): string; /** * Determines whether a type will be inlined in OpenAPI rather than defined * as a schema and referenced. * * All anonymous types (anonymous models, arrays, tuples, etc.) are inlined. * * Template instantiations are inlined unless they have a friendly name. * * A friendly name can be provided by the user using `@friendlyName` * decorator, or chosen by default in simple cases. */ export declare function shouldInline(program: Program, type: Type): boolean; /** * Resolve the OpenAPI operation ID for the given operation using the following logic: * - If @operationId was specified use that value * - If @clientLocation was specified: * - If the target is a string, use the string value as the prefix of the operation ID * - If the target is an Interface, use the interface name as the prefix * - If the target is a Namespace and it's not the service namespace or global namespace, use the namespace name as the prefix * - If the target is the service namespace or global namespace, use the operation name as the operation ID * - If operation is defined at the root or under the service namespace return `` * - Otherwise(operation is under another namespace or interface) return `_` * * @param program TypeSpec Program * @param operation Operation * @returns Operation ID in this format `` or `_` */ export declare function resolveOperationId(context: AutorestEmitterContext, operation: Operation): string; /** * Determines if a property is read-only, which is defined as having only the * Lifecycle.Read visibility active within the Lifecycle visibility class. * * If there is more than one Lifecycle visibility modifier active, then the * property is not read-only. For example, `@visibility(Lifecycle.Read, Lifecycle.Update)` * does not designate a read-only property. */ export declare function isReadonlyProperty(program: Program, property: ModelProperty): boolean; /** * Check if the given format is supported by Autorest. * Those formats are validated by https://github.com/Azure/azure-openapi-validator/blob/main/packages/rulesets/src/spectral/functions/schema-format.ts#L17 */ export declare function isSupportedAutorestFormat(formatStr: string): boolean; //# sourceMappingURL=utils.d.ts.map