import type { Criteria } from "../criteria.js"; import type { Pagination, PaginationMeta, DeepJsonResult } from "../types/index.js"; /** * Type for the serialized result of PaginatedResult.toJSON() * Uses DeepJsonResult to ensure all nested entities are converted to plain objects */ export type PaginatedJsonResult = { data: DeepJsonResult[]; meta: PaginationMeta; }; export declare class PaginatedResult { readonly data: T[]; readonly meta: PaginationMeta; constructor(data: T[], meta: PaginationMeta); /** * Creates a PaginatedResult with calculated metadata */ static create(data: T[], pagination: Pagination, total: number): PaginatedResult; /** * Creates pagination metadata from total count */ static createMeta(pagination: Pagination, total: number): PaginationMeta; /** * Applies criteria to an in-memory array (useful for testing) */ static fromArray(items: T[], criteria: Criteria): PaginatedResult; /** * Converts the result to JSON, deeply serializing all entities/aggregates/value objects * - Entities/Aggregates → calls toJSON() recursively * - Value Objects → converts to value * - Id → converts to string * - Arrays → maps recursively * - Plain objects → serializes properties recursively * - Primitives → returns as-is */ toJSON(): PaginatedJsonResult; /** * Deep serialization logic (similar to BaseEntity.deepToJson) */ private deepSerialize; /** * Transform each item in the result using a mapper function */ map(fn: (item: T) => U): PaginatedResult; /** * Check if result has no data */ get isEmpty(): boolean; /** * Check if there are more pages available */ get hasMore(): boolean; } //# sourceMappingURL=paginated-result.d.ts.map