import { DecoratorContext, Interface, Model, ModelProperty, Namespace, Operation, Program, Scalar, Type } from "@cadl-lang/compiler"; /** * `@autoRoute` enables automatic route generation for an operation, namespace, or interface. * * When applied to an operation, it automatically generates the operation's route based on path parameter * metadata. When applied to a namespace or interface, it causes all operations under that scope to have * auto-generated routes. */ export declare function $autoRoute(context: DecoratorContext, entity: Namespace | Interface | Operation): void; export declare function isAutoRoute(program: Program, target: Namespace | Interface | Operation): boolean; /** * `@segment` defines the preceding path segment for a `@path` parameter in auto-generated routes * * The first argument should be a string that will be inserted into the operation route before the * path parameter's name field. * * `@segment` can only be applied to model properties, operation parameters, or operations. */ export declare function $segment(context: DecoratorContext, entity: Model | ModelProperty | Operation, name: string): void; export declare function $segmentOf(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function getSegment(program: Program, entity: Type): string | undefined; /** * `@actionSeparator` defines the separator string that is used to precede the action name * in auto-generated actions. * * `@actionSeparator` can only be applied to model properties, operation parameters, or operations. */ export declare function $actionSeparator(context: DecoratorContext, entity: Model | ModelProperty | Operation, separator: "/" | ":" | "/:"): void; /** * @param program the Cadl program * @param entity the target entity * @returns the action separator string */ export declare function getActionSeparator(program: Program, entity: Type): string | undefined; /** * `@resource` marks a model as a resource type. * * The first argument should be the name of the collection that the resources * belong to. For example, a resource type `Widget` might have a collection * name of `widgets`. * * `@resource` can only be applied to models. */ export declare function $resource(context: DecoratorContext, entity: Model, collectionName: string): void; export type ResourceOperations = "read" | "create" | "createOrReplace" | "createOrUpdate" | "update" | "delete" | "list"; export interface ResourceOperation { operation: string; resourceType: Model; } export declare function setResourceOperation(context: DecoratorContext, entity: Operation, resourceType: Model, operation: ResourceOperations): void; export declare function getResourceOperation(program: Program, cadlOperation: Operation): ResourceOperation | undefined; export declare function $readsResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $createsResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $createsOrReplacesResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $createsOrUpdatesResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $updatesResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $deletesResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $listsResource(context: DecoratorContext, entity: Operation, resourceType: Model): void; export declare function $actionSegment(context: DecoratorContext, entity: Operation, name: string): void; export declare function getActionSegment(program: Program, entity: Type): string | undefined; export declare function $action(context: DecoratorContext, entity: Operation, name?: string): void; export declare function getAction(program: Program, operation: Operation): string | null | undefined; export declare function $collectionAction(context: DecoratorContext, entity: Operation, resourceType: Model, name?: string): void; export declare function getCollectionAction(program: Program, operation: Operation): string | null | undefined; export declare function $resourceLocation(context: DecoratorContext, entity: Model, resourceType: Model): void; export declare function getResourceLocationType(program: Program, entity: Scalar): Model | undefined; //# sourceMappingURL=rest.d.ts.map