UNPKG

trade360-nodejs-sdk

Version:

LSports Trade360 SDK for Node.js

23 lines (22 loc) 1 kB
import { ClassConstructor } from 'class-transformer'; import { BaseEntity } from '../../../entities/core-entities/index.js'; import { HeaderContent } from './http-response-header'; /** * HttpResponsePayloadDto class is responsible for the * response structure of the HTTP response.It contains * the header and body of the response. The header * contains the HTTP status code and the errors if any. * The body contains the response data. * @typeparam TResponse The type of the response data. */ export declare class HttpResponsePayloadDto<TResponse extends BaseEntity> implements BaseEntity { [key: string]: unknown; header: HeaderContent; body: TResponse; /** * Create a custom DTO for the response body. * @param entityClass The class of the response body. * @returns The custom DTO for the response body. */ static createPayloadDto<TResponse extends BaseEntity>(entityClass: ClassConstructor<TResponse>): new () => HttpResponsePayloadDto<TResponse>; }