import { DecoratorContext, Model, ModelProperty, Program, Type } from "@typespec/compiler"; import { ParentResourceDecorator } from "../generated-defs/TypeSpec.Rest.js"; export interface ResourceKey { resourceType: Model; keyProperty: ModelProperty; } export declare function setResourceTypeKey(program: Program, resourceType: Model, keyProperty: ModelProperty): void; export declare function getResourceTypeKey(program: Program, resourceType: Model): ResourceKey | undefined; export declare function $resourceTypeForKeyParam(context: DecoratorContext, entity: Type, resourceType: Type): void; export declare function getResourceTypeForKeyParam(program: Program, param: ModelProperty): Model | undefined; export declare function $copyResourceKeyParameters(context: DecoratorContext, entity: Model, filter?: string): void; export declare const /** * Get the parent resource type for a given resource model. * * @param program The TypeSpec program instance * @param type The resource model to get the parent for * @returns The parent resource model if one exists, otherwise `undefined` * * @example * * ```tsp * @parentResource(Organization) * model User {} * ``` * * ```typescript * const parentType = getParentResource(program, userModel); * // parentType would be the Organization model * ``` */ getParentResource: (program: Program, type: Model) => Model | undefined, /** * Set parent resource for a resource. * Same as applying `@parentResource` decorator. */ setParentResource: (program: Program, type: Model, value: Model) => void; /** * `@parentResource` marks a model with a reference to its parent resource type * * The first argument should be a reference to a model type which will be treated as the parent * type of the target model type. This will cause the `@key` properties of all parent types of * the target type to show up in operations of the `Resource*` interfaces defined in this library. * * `@parentResource` can only be applied to models. */ export declare const $parentResource: ParentResourceDecorator; //# sourceMappingURL=resource.d.ts.map