@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
17 lines (16 loc) • 1.14 kB
TypeScript
import type { EApiDtoType, EApiRouteType } from '../../enum/decorator/api/index';
import type { TApiPropertyDescribeDtoProperties, TApiPropertyDescribeProperties } from '../../type/decorator/api/property/index';
/**
* Retrieves the configuration for property decorators based on method, metadata, and DTO type.
* Allows for custom overrides defined in the property metadata and merges them with
* defaults from the appropriate strategy.
* @param {M} method - The API route type (CREATE, DELETE, GET, etc.)
* @param {TApiPropertyDescribeProperties} metadata - The property metadata
* @param {D} dtoType - The type of DTO (REQUEST, RESPONSE, etc.)
* @param {string} propertyName - The name of the property
* @returns {TApiPropertyDescribeDtoProperties} The merged decorator configuration
* @throws {Error} When no strategy is found for the DTO type
* @template M - The API route type
* @template D - The DTO type
*/
export declare const DtoGetDecoratorConfig: <M extends EApiRouteType, D extends EApiDtoType>(method: M, metadata: TApiPropertyDescribeProperties, dtoType: D, propertyName: string) => TApiPropertyDescribeDtoProperties;