From c380ea795eb3876a6b50ce602f33dc1065bc578f Mon Sep 17 00:00:00 2001 From: Andrew Thauer Date: Thu, 30 Jun 2022 10:25:59 -0400 Subject: [PATCH] update cost-insights api docs Signed-off-by: Andrew Thauer --- plugins/cost-insights-common/api-report.md | 2 -- .../src/types/ChangeStatistic.ts | 13 +++++++++---- .../src/types/DateAggregation.ts | 7 ++++++- plugins/cost-insights-common/src/types/Duration.ts | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/cost-insights-common/api-report.md b/plugins/cost-insights-common/api-report.md index daf8f5767d..1f54bece3e 100644 --- a/plugins/cost-insights-common/api-report.md +++ b/plugins/cost-insights-common/api-report.md @@ -5,9 +5,7 @@ ```ts // @public (undocumented) export interface ChangeStatistic { - // (undocumented) amount: number; - // (undocumented) ratio?: number; } diff --git a/plugins/cost-insights-common/src/types/ChangeStatistic.ts b/plugins/cost-insights-common/src/types/ChangeStatistic.ts index 29be6e9367..8d64fb47f9 100644 --- a/plugins/cost-insights-common/src/types/ChangeStatistic.ts +++ b/plugins/cost-insights-common/src/types/ChangeStatistic.ts @@ -18,10 +18,15 @@ * @public */ export interface ChangeStatistic { - // The ratio of change from one duration to another, expressed as: (newSum - oldSum) / oldSum - // If a ratio cannot be calculated - such as when a new or old sum is zero, - // the ratio can be omitted and where applicable, ∞ or -∞ will display based on amount. + /** + * The ratio of change from one duration to another, expressed as: (newSum - oldSum) / oldSum + * If a ratio cannot be calculated - such as when a new or old sum is zero, + * the ratio can be omitted and where applicable, ∞ or -∞ will display based on amount. + */ ratio?: number; - // The actual USD change between time periods (can be negative if costs decreased) + + /** + * The actual USD change between time periods (can be negative if costs decreased) + */ amount: number; } diff --git a/plugins/cost-insights-common/src/types/DateAggregation.ts b/plugins/cost-insights-common/src/types/DateAggregation.ts index 4faed85241..edc867a7bf 100644 --- a/plugins/cost-insights-common/src/types/DateAggregation.ts +++ b/plugins/cost-insights-common/src/types/DateAggregation.ts @@ -18,6 +18,11 @@ * @public */ export type DateAggregation = { - date: string; // YYYY-MM-DD + /** + * The date aggregation as string. + * @example YYYY-MM-DD + */ + date: string; + amount: number; }; diff --git a/plugins/cost-insights-common/src/types/Duration.ts b/plugins/cost-insights-common/src/types/Duration.ts index 3a4c7a3a9f..dbb226df24 100644 --- a/plugins/cost-insights-common/src/types/Duration.ts +++ b/plugins/cost-insights-common/src/types/Duration.ts @@ -19,6 +19,7 @@ * 'last completed quarter', and P30D/P90D to be '[month|quarter] relative to today'. So if * it's September 15, P3M represents costs for Q2 and P30D represents August 16 - * September 15. + * * @public */ export enum Duration {