Skip to content

Commit

Permalink
notnull
Browse files Browse the repository at this point in the history
  • Loading branch information
lroal committed May 7, 2024
1 parent 00b7705 commit 1e51239
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ type ExtractAggregates<Agg> = {
Required<Agg>[K] extends (agg: Aggregate<infer V>) => ColumnSymbols
? K extends 'where'? never : K
: never
]: Agg[K] extends (agg: Aggregate<infer V>) => infer R ? R & NotNull : never;
]: Agg[K] extends (agg: Aggregate<infer V>) => infer R ? R : never;
}

type ColumnSymbols = StringColumnSymbol | UuidColumnSymbol | NumericColumnSymbol | DateColumnSymbol | DateWithTimeZoneColumnSymbol | BinaryColumnSymbol | BooleanColumnSymbol | JSONColumnSymbol;
Expand All @@ -599,11 +599,11 @@ type AggregationFunction<T> = (agg: Aggregate<T>) => ColumnSymbols;
type Aggregate<T> =
RelatedColumns<T> &
{
sum(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol;
avg(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol;
min(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol;
max(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol;
count(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol;
sum(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol & NotNull;
avg(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol & NotNull;
min(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol & NotNull;
max(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol & NotNull;
count(fn: (x: AggregateColumns<T>) => NumericColumnSymbol): NumericColumnSymbol & NotNull;
}

type RelatedColumns<T> = RemoveNeverFlat<{
Expand Down

0 comments on commit 1e51239

Please sign in to comment.