@puq/meta
Version:
A TypeScript utility for managing resource metadata using the reflect-metadata library. This module provides a way to define and retrieve metadata for resource entities, such as entity classes, names, paths, and public access flags, typically used in fram
19 lines • 847 B
TypeScript
import { type ResourceMetadataOptions } from './resource-metadata-manager.js';
export type SetResourceMetadataOptions<T extends object = object> = Readonly<Omit<ResourceMetadataOptions<T>, 'target'>>;
/**
* Set metadata for the resource controller that method and class decorator can access using {@link ResourceMetadataManager}
* This decorator must be used as the first property of the resource controller class
* ```ts
* class ResourceController {
* '@SetResourceMetadata({
* entity:()=> EntityClass,
* isPublic:true (public resource)
* })
* __metadata__:any;
* }
* ```
* @param entity
* @returns - {@link PropertyDecorator}
*/
export declare function SetResourceMetadata<T extends object>(options: SetResourceMetadataOptions<T>): PropertyDecorator;
//# sourceMappingURL=set-resource-metadata.decorator.d.ts.map