Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat: add AggregationValue type and improve type safety in aggregation filtering

DarkPhoenix27047c9c2c1711f2
diff --git a/packages/nocodb-sdk/src/lib/aggregationHelper.ts b/packages/nocodb-sdk/src/lib/aggregationHelper.ts
index ca83f8525e..1051f49f06 100644
--- a/packages/nocodb-sdk/src/lib/aggregationHelper.ts
+++ b/packages/nocodb-sdk/src/lib/aggregationHelper.ts
@@ -56,6 +56,8 @@ const AllAggregations = {
...DateAggregations,
};
+type AggregationValue = typeof AllAggregations[keyof typeof AllAggregations]
+
const getAvailableAggregations = (type: string, parsed_tree?): string[] => {
let returnAggregations = [];
if (type === UITypes.Formula && parsed_tree?.dataType) {
@@ -235,4 +237,5 @@ export {
AttachmentAggregations,
AllAggregations,
formatAggregation,
+ AggregationValue,
};