Skip to content

Commit

Permalink
feat(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 47c4d78 commit 21a63e2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 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,22 @@ declare module '@cubejs-client/core' {
format?: 'currency' | 'percent';
};

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

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

export type CubeTimeDimension = BaseCubeDimension &
{ type: 'time'; granularities?: CubeTimeDimensionGranularity[] };

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

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

Expand Down

0 comments on commit 21a63e2

Please sign in to comment.