UNPKG

@adocasts.com/dto

Version:

Easily make and generate DTOs from Lucid Models

17 lines (16 loc) 835 B
import SimplePaginatorDto from '../paginator/simple_paginator_dto.js'; import BaseDto from './base_dto.js'; export default class BaseModelDto extends BaseDto { /** * Creates a new instance of the SimplePaginatorDto class using the provided paginator and DTO. * * @template Model - The type of the LucidRow model. * @template Dto - The type of the BaseDto. * @param {SimplePaginatorContract<Model>|ModelPaginatorContract<Model>} paginator - The paginator to use for the SimplePaginatorDto. * @param {SimplePaginatorDtoMetaRange} [range] - The range of pages to include in the SimplePaginatorDto. * @return {SimplePaginatorDto<Model, Dto>} - The created SimplePaginatorDto. */ static fromPaginator(paginator, range) { return new SimplePaginatorDto(paginator, this, range); } }