Skip to content

Commit

Permalink
chore(client-core): extend client types with custom granularity support
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Sep 18, 2024
1 parent 4875b8e commit 4c2378c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/cubejs-client-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,19 @@ declare module '@cubejs-client/core' {
format?: 'currency' | 'percent';
};

export type TCubeDimension = BaseCubeMember & {
export type TCubeTimeDimensionGranularity = {
name: string;
title: string;
}

export type BaseCubeDimension = BaseCubeMember & {
primaryKey?: boolean;
suggestFilterValues: boolean;
};
}

export type TCubeDimension = BaseCubeDimension &
({ type: Exclude<BaseCubeDimension['type'], 'time'> } |
{ type: 'time'; granularities?: TCubeTimeDimensionGranularity[] })

export type TCubeSegment = Omit<BaseCubeMember, 'type'>;

Expand Down

0 comments on commit 4c2378c

Please sign in to comment.