From f6f273cc861feacd0cc62848e99bcfa56975e879 Mon Sep 17 00:00:00 2001 From: Tom Arild Jakobsen Date: Thu, 23 Mar 2023 11:11:15 +0100 Subject: [PATCH] Add default parameters for AggregationInput and Output #10101 `never` is used as the default type parameter for the `aggregation` properties in the different QueryParams. `undefined` is used as the default type parameter for `aggregations` in different query results. The reason `never` is not used is that since the property is not optional, we are not able to construct this object independently of the library functions. (cherry picked from commit 8d1c425baf514bc252f4831d6c653dc8012cd6d5) --- .../lib/lib-content/src/main/resources/lib/xp/content.ts | 4 ++-- modules/lib/lib-node/src/main/resources/lib/xp/node.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/lib/lib-content/src/main/resources/lib/xp/content.ts b/modules/lib/lib-content/src/main/resources/lib/xp/content.ts index e1edb44900e..4c0f644a50c 100644 --- a/modules/lib/lib-content/src/main/resources/lib/xp/content.ts +++ b/modules/lib/lib-content/src/main/resources/lib/xp/content.ts @@ -432,7 +432,7 @@ export { export interface ContentsResult< Hit extends Content, - AggregationOutput extends Record + AggregationOutput extends Record | undefined = undefined > { total: number; count: number; @@ -608,7 +608,7 @@ export function create< return __.toNativeObject(bean.execute()); } -export interface QueryContentParams { +export interface QueryContentParams { start?: number; count?: number; query?: QueryDsl | string; diff --git a/modules/lib/lib-node/src/main/resources/lib/xp/node.ts b/modules/lib/lib-node/src/main/resources/lib/xp/node.ts index 8e6c0e99644..a00edb8046b 100644 --- a/modules/lib/lib-node/src/main/resources/lib/xp/node.ts +++ b/modules/lib/lib-node/src/main/resources/lib/xp/node.ts @@ -138,7 +138,7 @@ export interface SuggestionResult { }[]; } -export interface NodeQueryResult> { +export interface NodeQueryResult | undefined = undefined> { total: number; count: number; hits: NodeQueryResultHit[]; @@ -146,7 +146,7 @@ export interface NodeQueryResult; } -export interface NodeMultiRepoQueryResult> { +export interface NodeMultiRepoQueryResult | undefined = undefined> { total: number; count: number; hits: (NodeQueryResultHit & { @@ -346,7 +346,7 @@ export interface SetChildOrderParams { childOrder: string; } -export interface QueryNodeParams { +export interface QueryNodeParams { start?: number; count?: number; query?: QueryDsl | string;