From afbc08ad53b5dc893301e950e346a6b73301ce4b Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 26 Sep 2023 02:35:08 +0200 Subject: [PATCH] fix(typings): make typings for meta in responses v4 more specific --- src/runtime/types/v4.d.ts | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/runtime/types/v4.d.ts b/src/runtime/types/v4.d.ts index 37a16297..4ddac2e5 100644 --- a/src/runtime/types/v4.d.ts +++ b/src/runtime/types/v4.d.ts @@ -39,15 +39,33 @@ export interface Strapi4ResponseData { export interface Strapi4Response { data: Strapi4ResponseData | Strapi4ResponseData[], - meta: Record + meta: Strapi4ResponseMeta } export interface Strapi4ResponseSingle { data: Strapi4ResponseData, - meta: Record + meta: Strapi4ResponseMeta } export interface Strapi4ResponseMany { data: Strapi4ResponseData[], - meta: Record + meta: Strapi4ResponseMeta +} + +export interface Strapi4ResponseMeta { + pagination: MetaResponsePaginationByPage | MetaResponsePaginationByOffset, + [key: string]: unknown +} + +export interface MetaResponsePaginationByPage { + page: number, + pageSize: number, + pageCount: number, + total: number +} + +export interface MetaResponsePaginationByOffset { + start: number, + limit: number, + total: number }