From 4ee343966a0ec59e84c9a2c7a9b8f4675a7c9195 Mon Sep 17 00:00:00 2001 From: Vannarath Poeu Date: Tue, 22 Jun 2021 16:51:46 +0800 Subject: [PATCH 1/5] Replaced moment and dayjs with luxon Signed-off-by: Vannarath Poeu --- plugins/cost-insights/package.json | 3 +- .../CostOverviewBreakdownChart.tsx | 11 ++--- .../CostOverviewCard/CostOverviewChart.tsx | 11 ++--- .../ProjectGrowthAlertChart.tsx | 10 +++-- .../ProjectGrowthInstructionsPage.tsx | 4 +- plugins/cost-insights/src/example/client.ts | 10 ++--- .../src/forms/AlertSnoozeForm.tsx | 4 +- .../cost-insights/src/testUtils/testUtils.ts | 16 ++++--- plugins/cost-insights/src/types/Duration.ts | 2 +- plugins/cost-insights/src/utils/change.ts | 15 ++----- plugins/cost-insights/src/utils/duration.ts | 44 +++++++++++-------- plugins/cost-insights/src/utils/formatters.ts | 22 +++++----- 12 files changed, 80 insertions(+), 72 deletions(-) diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index faba0ddf6d..1eb0f613e8 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -41,9 +41,8 @@ "@types/react": "^16.9", "@types/recharts": "^1.8.14", "classnames": "^2.2.6", - "dayjs": "^1.9.4", "history": "^5.0.0", - "moment": "^2.27.0", + "luxon": "^1.26.0", "pluralize": "^8.0.0", "qs": "^6.9.4", "react": "^16.13.1", diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx index 7202c069f5..d0731326f2 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx @@ -14,8 +14,7 @@ * limitations under the License. */ import React, { useState } from 'react'; -import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; +import { DateTime } from 'luxon'; import { useTheme, Box, @@ -54,8 +53,6 @@ import { formatPeriod } from '../../utils/formatters'; import { aggregationSum } from '../../utils/sum'; import { BarChartLegendOptions } from '../BarChart/BarChartLegend'; -dayjs.extend(utc); - export type CostOverviewBreakdownChartProps = { costBreakdown: Cost[]; }; @@ -184,7 +181,11 @@ export const CostOverviewBreakdownChart = ({ }) => { if (isInvalid({ label, payload })) return null; - const dateTitle = dayjs(label).utc().format(DEFAULT_DATE_FORMAT); + const date = + typeof label === 'number' + ? DateTime.fromMillis(label) + : DateTime.fromISO(label!); + const dateTitle = date.toUTC().toFormat(DEFAULT_DATE_FORMAT); const items = payload.map(p => ({ label: p.dataKey as string, value: formatGraphValue(p.value as number), diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx index 4f806658be..e7b478ba07 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx @@ -14,8 +14,7 @@ * limitations under the License. */ import React from 'react'; -import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; +import { DateTime } from 'luxon'; import { useTheme, Box } from '@material-ui/core'; import { ComposedChart, @@ -52,8 +51,6 @@ import { groupByDate, toDataMax, trendFrom } from '../../utils/charts'; import { aggregationSort } from '../../utils/sort'; import { CostOverviewLegend } from './CostOverviewLegend'; -dayjs.extend(utc); - type CostOverviewChartProps = { metric: Maybe; metricData: Maybe; @@ -108,7 +105,11 @@ export const CostOverviewChart = ({ if (isInvalid({ label, payload })) return null; const dataKeys = [data.dailyCost.dataKey, data.metric.dataKey]; - const title = dayjs(label).utc().format(DEFAULT_DATE_FORMAT); + const date = + typeof label === 'number' + ? DateTime.fromMillis(label) + : DateTime.fromISO(label!); + const title = date.toUTC().toFormat(DEFAULT_DATE_FORMAT); const items = payload .filter(p => dataKeys.includes(p.dataKey as string)) .map(p => ({ diff --git a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.tsx b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.tsx index bdfb27b8e8..74c0cea34b 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { Box } from '@material-ui/core'; import { BarChart, BarChartLegend, BarChartLegendOptions } from '../BarChart'; import { LegendItem } from '../LegendItem'; @@ -38,8 +38,12 @@ export const ProjectGrowthAlertChart = ({ const resourceData = alert.products.map(resourceOf); const options: Partial = { - previousName: moment(alert.periodStart, 'YYYY-[Q]Q').format('[Q]Q YYYY'), - currentName: moment(alert.periodEnd, 'YYYY-[Q]Q').format('[Q]Q YYYY'), + previousName: DateTime.fromFormat(alert.periodStart, "yyyy-'Q'q").toFormat( + "'Q'q yyyy", + ), + currentName: DateTime.fromFormat(alert.periodEnd, "yyyy-'Q'q").toFormat( + "'Q'q yyyy", + ), }; return ( diff --git a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx index 89d2f28a45..35b00ce6f6 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { Box, Typography } from '@material-ui/core'; import { AlertInstructionsLayout } from '../AlertInstructionsLayout'; import { ProductInsightsChart } from '../ProductInsightsCard'; @@ -30,7 +30,7 @@ import { import { ProjectGrowthAlert } from '../../alerts'; import { InfoCard } from '@backstage/core-components'; -const today = moment().format(DEFAULT_DATE_FORMAT); +const today = DateTime.now().toFormat(DEFAULT_DATE_FORMAT); export const ProjectGrowthInstructionsPage = () => { const alertData: ProjectGrowthData = { diff --git a/plugins/cost-insights/src/example/client.ts b/plugins/cost-insights/src/example/client.ts index dec3864ce6..a7a2a0e22f 100644 --- a/plugins/cost-insights/src/example/client.ts +++ b/plugins/cost-insights/src/example/client.ts @@ -15,7 +15,7 @@ */ /* eslint-disable no-restricted-imports */ -import dayjs from 'dayjs'; +import { DateTime } from 'luxon'; import { CostInsightsApi, ProductInsightsOptions } from '../api'; import { Alert, @@ -46,7 +46,7 @@ export class ExampleCostInsightsClient implements CostInsightsApi { getLastCompleteBillingDate(): Promise { return Promise.resolve( - dayjs().subtract(1, 'day').format(DEFAULT_DATE_FORMAT), + DateTime.now().minus({ days: 1 }).toFormat(DEFAULT_DATE_FORMAT), ); } @@ -175,13 +175,13 @@ export class ExampleCostInsightsClient implements CostInsightsApi { ], }; - const today = dayjs(); + const today = DateTime.now(); const alerts: Alert[] = await this.request({ group }, [ new ProjectGrowthAlert(projectGrowthData), new UnlabeledDataflowAlert(unlabeledDataflowData), new KubernetesMigrationAlert(this, { - startDate: today.subtract(30, 'day').format(DEFAULT_DATE_FORMAT), - endDate: today.format(DEFAULT_DATE_FORMAT), + startDate: today.minus({ days: 30 }).toFormat(DEFAULT_DATE_FORMAT), + endDate: today.toFormat(DEFAULT_DATE_FORMAT), change: { ratio: 0, amount: 0, diff --git a/plugins/cost-insights/src/forms/AlertSnoozeForm.tsx b/plugins/cost-insights/src/forms/AlertSnoozeForm.tsx index eb78327dc9..0dcc0a949e 100644 --- a/plugins/cost-insights/src/forms/AlertSnoozeForm.tsx +++ b/plugins/cost-insights/src/forms/AlertSnoozeForm.tsx @@ -21,7 +21,7 @@ import React, { forwardRef, FormEventHandler, } from 'react'; -import dayjs from 'dayjs'; +import { DateTime } from 'luxon'; import { Box, FormControl, @@ -57,7 +57,7 @@ export const AlertSnoozeForm = forwardRef< e.preventDefault(); if (duration) { const repeatInterval = 1; - const today = dayjs().format(DEFAULT_DATE_FORMAT); + const today = DateTime.now().toFormat(DEFAULT_DATE_FORMAT); onSubmit({ intervals: intervalsOf(duration, today, repeatInterval), }); diff --git a/plugins/cost-insights/src/testUtils/testUtils.ts b/plugins/cost-insights/src/testUtils/testUtils.ts index a2210b67cf..2c6f6b5ef2 100644 --- a/plugins/cost-insights/src/testUtils/testUtils.ts +++ b/plugins/cost-insights/src/testUtils/testUtils.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import dayjs from 'dayjs'; +import { DateTime } from 'luxon'; import regression, { DataPoint } from 'regression'; import { ChangeStatistic, @@ -58,9 +58,9 @@ export function aggregationFor( ): DateAggregation[] { const { duration, endDate } = parseIntervals(intervals); const inclusiveEndDate = inclusiveEndDateOf(duration, endDate); - const days = dayjs(endDate).diff( - inclusiveStartDateOf(duration, inclusiveEndDate), - 'day', + const days = DateTime.fromISO(endDate).diff( + DateTime.fromISO(inclusiveStartDateOf(duration, inclusiveEndDate)), + 'days', ); function nextDelta(): number { @@ -74,9 +74,11 @@ export function aggregationFor( return [...Array(days).keys()].reduce( (values: DateAggregation[], i: number): DateAggregation[] => { const last = values.length ? values[values.length - 1].amount : baseline; - const date = dayjs(inclusiveStartDateOf(duration, inclusiveEndDate)) - .add(i, 'day') - .format(DEFAULT_DATE_FORMAT); + const date = DateTime.fromISO( + inclusiveStartDateOf(duration, inclusiveEndDate), + ) + .plus({ days: i }) + .toFormat(DEFAULT_DATE_FORMAT); const amount = Math.max(0, last + nextDelta()); values.push({ date: date, diff --git a/plugins/cost-insights/src/types/Duration.ts b/plugins/cost-insights/src/types/Duration.ts index dcc0d9390c..94297ac00a 100644 --- a/plugins/cost-insights/src/types/Duration.ts +++ b/plugins/cost-insights/src/types/Duration.ts @@ -27,4 +27,4 @@ export enum Duration { P3M = 'P3M', } -export const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD'; +export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd'; diff --git a/plugins/cost-insights/src/utils/change.ts b/plugins/cost-insights/src/utils/change.ts index 8ab927ecf6..3a0d19b123 100644 --- a/plugins/cost-insights/src/utils/change.ts +++ b/plugins/cost-insights/src/utils/change.ts @@ -24,13 +24,10 @@ import { Duration, DateAggregation, } from '../types'; -import dayjs, { OpUnitType } from 'dayjs'; -import durationPlugin from 'dayjs/plugin/duration'; +import { DateTime, Duration as LuxonDuration } from 'luxon'; import { inclusiveStartDateOf } from './duration'; import { notEmpty } from './assert'; -dayjs.extend(durationPlugin); - // Used for displaying status colors export function growthOf(change: ChangeStatistic): GrowthType { const exceedsEngineerThreshold = Math.abs(change.amount) >= EngineerThreshold; @@ -85,16 +82,12 @@ export function getPreviousPeriodTotalCost( duration: Duration, inclusiveEndDate: string, ): number { - const dayjsDuration = dayjs.duration(duration); + const luxonDuration = LuxonDuration.fromISO(duration); const startDate = inclusiveStartDateOf(duration, inclusiveEndDate); - // dayjs doesn't allow adding an ISO 8601 period to dates. - const [amount, type]: [number, OpUnitType] = dayjsDuration.days() - ? [dayjsDuration.days(), 'day'] - : [dayjsDuration.months(), 'month']; - const nextPeriodStart = dayjs(startDate).add(amount, type); + const nextPeriodStart = DateTime.fromISO(startDate).plus(luxonDuration); // Add up costs that incurred before the start of the next period. return aggregation.reduce((acc, costByDate) => { - return dayjs(costByDate.date).isBefore(nextPeriodStart) + return DateTime.fromISO(costByDate.date) < nextPeriodStart ? acc + costByDate.amount : acc; }, 0); diff --git a/plugins/cost-insights/src/utils/duration.ts b/plugins/cost-insights/src/utils/duration.ts index 17d0661c2b..6d7c8d4765 100644 --- a/plugins/cost-insights/src/utils/duration.ts +++ b/plugins/cost-insights/src/utils/duration.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import moment from 'moment'; +import { DateTime, Duration as LuxonDuration } from 'luxon'; import { Duration, DEFAULT_DATE_FORMAT } from '../types'; import { assertNever } from './assert'; @@ -34,14 +34,18 @@ export function inclusiveStartDateOf( case Duration.P7D: case Duration.P30D: case Duration.P90D: - return moment(inclusiveEndDate) - .subtract(moment.duration(duration).add(moment.duration(duration))) - .format(DEFAULT_DATE_FORMAT); + return DateTime.fromISO(inclusiveEndDate) + .minus( + LuxonDuration.fromISO(duration).plus(LuxonDuration.fromISO(duration)), + ) + .toFormat(DEFAULT_DATE_FORMAT); case Duration.P3M: - return moment(inclusiveEndDate) + return DateTime.fromISO(inclusiveEndDate) .startOf('quarter') - .subtract(moment.duration(duration).add(moment.duration(duration))) - .format(DEFAULT_DATE_FORMAT); + .minus( + LuxonDuration.fromISO(duration).plus(LuxonDuration.fromISO(duration)), + ) + .toFormat(DEFAULT_DATE_FORMAT); default: return assertNever(duration); } @@ -55,11 +59,13 @@ export function exclusiveEndDateOf( case Duration.P7D: case Duration.P30D: case Duration.P90D: - return moment(inclusiveEndDate).add(1, 'day').format(DEFAULT_DATE_FORMAT); + return DateTime.fromISO(inclusiveEndDate) + .plus({ days: 1 }) + .toFormat(DEFAULT_DATE_FORMAT); case Duration.P3M: - return moment(quarterEndDate(inclusiveEndDate)) - .add(1, 'day') - .format(DEFAULT_DATE_FORMAT); + return DateTime.fromISO(quarterEndDate(inclusiveEndDate)) + .plus({ days: 1 }) + .toFormat(DEFAULT_DATE_FORMAT); default: return assertNever(duration); } @@ -69,9 +75,9 @@ export function inclusiveEndDateOf( duration: Duration, inclusiveEndDate: string, ): string { - return moment(exclusiveEndDateOf(duration, inclusiveEndDate)) - .subtract(1, 'day') - .format(DEFAULT_DATE_FORMAT); + return DateTime.fromISO(exclusiveEndDateOf(duration, inclusiveEndDate)) + .minus({ days: 1 }) + .toFormat(DEFAULT_DATE_FORMAT); } // https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals @@ -87,13 +93,13 @@ export function intervalsOf( } export function quarterEndDate(inclusiveEndDate: string): string { - const endDate = moment(inclusiveEndDate); - const endOfQuarter = endDate.endOf('quarter').format(DEFAULT_DATE_FORMAT); + const endDate = DateTime.fromISO(inclusiveEndDate); + const endOfQuarter = endDate.endOf('quarter').toFormat(DEFAULT_DATE_FORMAT); if (endOfQuarter === inclusiveEndDate) { - return endDate.format(DEFAULT_DATE_FORMAT); + return endDate.toFormat(DEFAULT_DATE_FORMAT); } return endDate .startOf('quarter') - .subtract(1, 'day') - .format(DEFAULT_DATE_FORMAT); + .minus({ days: 1 }) + .toFormat(DEFAULT_DATE_FORMAT); } diff --git a/plugins/cost-insights/src/utils/formatters.ts b/plugins/cost-insights/src/utils/formatters.ts index 7733046165..70782123cd 100644 --- a/plugins/cost-insights/src/utils/formatters.ts +++ b/plugins/cost-insights/src/utils/formatters.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import moment from 'moment'; +import { DateTime, Duration as LuxonDuration } from 'luxon'; import pluralize from 'pluralize'; import { ChangeStatistic, Duration } from '../types'; import { inclusiveEndDateOf, inclusiveStartDateOf } from '../utils/duration'; @@ -67,9 +67,11 @@ export const monthOf = (date: string): string => { }; export const quarterOf = (date: string): string => { - // Supports formatting YYYY-MM-DD and YYYY-[Q]Q returned in alerts - const d = moment(date).isValid() ? moment(date) : moment(date, 'YYYY-[Q]Q'); - return d.format('[Q]Q YYYY'); + // Supports formatting yyyy-LL-dd and yyyy-'Q'q returned in alerts + const d = DateTime.fromISO(date).isValid + ? DateTime.fromISO(date) + : DateTime.fromFormat(date, "yyyy-'Q'q"); + return d.toFormat("'Q'q yyyy"); }; export function formatCurrency(amount: number, currency?: string): string { @@ -100,12 +102,12 @@ export function formatPercent(n: number): string { } export function formatLastTwoLookaheadQuarters(inclusiveEndDate: string) { - const start = moment( + const start = DateTime.fromISO( inclusiveStartDateOf(Duration.P3M, inclusiveEndDate), - ).format('[Q]Q YYYY'); - const end = moment(inclusiveEndDateOf(Duration.P3M, inclusiveEndDate)).format( - '[Q]Q YYYY', - ); + ).toFormat("'Q'q yyyy"); + const end = DateTime.fromISO( + inclusiveEndDateOf(Duration.P3M, inclusiveEndDate), + ).toFormat("'Q'q yyyy"); return `${start} vs ${end}`; } @@ -116,7 +118,7 @@ const formatRelativePeriod = ( ): string => { const periodStart = isEndDate ? inclusiveStartDateOf(duration, date) : date; const periodEnd = isEndDate ? date : inclusiveEndDateOf(duration, date); - const days = moment.duration(duration).asDays(); + const days = LuxonDuration.fromISO(duration).days; if (![periodStart, periodEnd].includes(date)) { throw new Error(`Invalid relative date ${date} for duration ${duration}`); } From 0b4d00687c9557324ecd4766b445a8579839ad18 Mon Sep 17 00:00:00 2001 From: Vannarath Poeu Date: Tue, 22 Jun 2021 20:17:51 +0800 Subject: [PATCH 2/5] Added changeset Signed-off-by: Vannarath Poeu --- .changeset/nasty-crews-boil.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nasty-crews-boil.md diff --git a/.changeset/nasty-crews-boil.md b/.changeset/nasty-crews-boil.md new file mode 100644 index 0000000000..80919a9918 --- /dev/null +++ b/.changeset/nasty-crews-boil.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-cost-insights': patch +--- + +Replaced moment and dayjs with luxon From 4c979f3e15da61620de523e3caaab82096bd62d5 Mon Sep 17 00:00:00 2001 From: Vannarath Poeu Date: Thu, 24 Jun 2021 09:58:05 +0800 Subject: [PATCH 3/5] Updated changeset description and vocab Signed-off-by: Vannarath Poeu --- .changeset/nasty-crews-boil.md | 2 +- .github/styles/vocab.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.changeset/nasty-crews-boil.md b/.changeset/nasty-crews-boil.md index 80919a9918..5b4108c972 100644 --- a/.changeset/nasty-crews-boil.md +++ b/.changeset/nasty-crews-boil.md @@ -2,4 +2,4 @@ '@backstage/plugin-cost-insights': patch --- -Replaced moment and dayjs with luxon +Replaced moment and dayjs with Luxon diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index 9350a73120..dcad0952f1 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -52,6 +52,7 @@ cookiecutter css Datadog dataflow +dayjs deadnaming debounce Debounce From 3a2993504ee422eca13ccd025babd6695e1f7e37 Mon Sep 17 00:00:00 2001 From: Vannarath Poeu Date: Thu, 24 Jun 2021 10:06:55 +0800 Subject: [PATCH 4/5] Regenerated api-report Signed-off-by: Vannarath Poeu --- plugins/cost-insights/api-report.md | 394 +++++++++++++++++++++++++++- 1 file changed, 393 insertions(+), 1 deletion(-) diff --git a/plugins/cost-insights/api-report.md b/plugins/cost-insights/api-report.md index d21159a845..9092791d9b 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -8,6 +8,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePalette } from '@backstage/theme'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; +import { ClassNameMap } from '@material-ui/styles'; import { ContentRenderer } from 'recharts'; import { Dispatch } from 'react'; import { ForwardRefExoticComponent } from 'react'; @@ -18,9 +19,16 @@ import { RechartsFunction } from 'recharts'; import { RefAttributes } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SetStateAction } from 'react'; +import { TooltipPayload } from 'recharts'; import { TooltipProps } from 'recharts'; import { TypographyProps } from '@material-ui/core'; +// @public (undocumented) +export const aggregationSort: (a: DateAggregation, b: DateAggregation) => number; + +// @public (undocumented) +export const aggregationSum: (aggregation: DateAggregation[]) => number; + // @public export type Alert = { title: string | JSX.Element; @@ -125,6 +133,12 @@ export enum AlertStatus { Snoozed = "snoozed" } +// @public (undocumented) +export function assertAlways(argument: T | undefined): T; + +// @public (undocumented) +export function assertNever(x: never): never; + // @public (undocumented) export const BarChart: ({ resources, responsive, displayAmount, options, tooltip, onClick, onMouseMove, }: BarChartProps) => JSX.Element; @@ -194,6 +208,9 @@ export type BarChartTooltipProps = { actions?: ReactNode; }; +// @public (undocumented) +export function brighten(color: string, coefficient?: number): string; + // @public (undocumented) export interface ChangeStatistic { // (undocumented) @@ -218,6 +235,9 @@ export type ChartData = { [key: string]: number; }; +// @public (undocumented) +export function choose([savings, excess]: [T, T], change: ChangeStatistic): T; + // @public (undocumented) export interface Cost { // (undocumented) @@ -232,6 +252,9 @@ export interface Cost { trendline?: Trendline; } +// @public (undocumented) +export const costFormatter: Intl.NumberFormat; + // @public (undocumented) export const CostGrowth: ({ change, duration }: CostGrowthProps) => JSX.Element; @@ -265,9 +288,15 @@ export type CostInsightsApi = { // @public (undocumented) export const costInsightsApiRef: ApiRef; +// @public (undocumented) +export const costInsightsDarkTheme: CostInsightsThemeOptions; + // @public (undocumented) export const CostInsightsLabelDataflowInstructionsPage: () => JSX.Element; +// @public (undocumented) +export const costInsightsLightTheme: CostInsightsThemeOptions; + // @public (undocumented) export const CostInsightsPage: () => JSX.Element; @@ -317,6 +346,9 @@ export interface Currency { unit: string; } +// @public (undocumented) +export const currencyFormatter: Intl.NumberFormat; + // @public (undocumented) export enum CurrencyType { // (undocumented) @@ -346,7 +378,40 @@ export type DateAggregation = { }; // @public (undocumented) -export const DEFAULT_DATE_FORMAT = "YYYY-MM-DD"; +export const dateFormatter: Intl.DateTimeFormat; + +// @public (undocumented) +export const DEFAULT_DATE_FORMAT = "yyyy-LL-dd"; + +// @public (undocumented) +export const DEFAULT_DURATION = Duration.P30D; + +// @public (undocumented) +export const defaultCurrencies: Currency[]; + +// @public (undocumented) +export enum DefaultLoadingAction { + // (undocumented) + CostInsightsAlerts = "cost-insights-alerts", + // (undocumented) + CostInsightsInitial = "cost-insights-initial", + // (undocumented) + CostInsightsPage = "cost-insights-page", + // (undocumented) + CostInsightsProducts = "cost-insights-products", + // (undocumented) + LastCompleteBillingDate = "billing-date", + // (undocumented) + UserGroups = "user-groups" +} + +// @public (undocumented) +export enum DefaultNavigation { + // (undocumented) + AlertInsightsHeader = "alert-insights-header", + // (undocumented) + CostOverviewCard = "cost-overview-card" +} // @public export enum Duration { @@ -395,11 +460,82 @@ export class ExampleCostInsightsClient implements CostInsightsApi { getUserGroups(userId: string): Promise; } +// @public (undocumented) +export function exclusiveEndDateOf(duration: Duration, inclusiveEndDate: string): string; + +// @public (undocumented) +export function findAlways(collection: T[], callback: (el: T) => boolean): T; + +// @public (undocumented) +export function findAnyKey(record: Record | undefined): string | undefined; + +// @public (undocumented) +export function formatChange(change: ChangeStatistic): string; + +// @public (undocumented) +export function formatCurrency(amount: number, currency?: string): string; + +// @public (undocumented) +export function formatGraphValue(value: number, format?: string): string; + +// @public (undocumented) +export function formatLastTwoLookaheadQuarters(inclusiveEndDate: string): string; + +// @public (undocumented) +export function formatPercent(n: number): string; + +// @public (undocumented) +export function formatPeriod(duration: Duration, date: string, isEndDate: boolean): string; + +// @public (undocumented) +export function getComparedChange(dailyCost: Cost, metricData: MetricData, duration: Duration, lastCompleteBillingDate: string): ChangeStatistic; + +// @public (undocumented) +export const getDefaultNavigationItems: (alerts: number) => NavigationItem[]; + +// @public (undocumented) +export function getDefaultPageFilters(groups: Group[]): PageFilters; + +// @public (undocumented) +export const getDefaultState: (loadingActions: string[]) => Loading; + +// @public (undocumented) +export function getIcon(icon?: string): JSX.Element; + +// @public (undocumented) +export const getInitialPageState: (groups: Group[], queryParams?: Partial) => { + group: Maybe; + project: Maybe; + duration: Duration; + metric: string | null; +}; + +// @public (undocumented) +export const getInitialProductState: (config: ConfigContextProps) => { + productType: string; + duration: Duration; +}[]; + +// @public (undocumented) +export function getPreviousPeriodTotalCost(aggregation: DateAggregation[], duration: Duration, inclusiveEndDate: string): number; + +// @public (undocumented) +export const getResetState: (loadingActions: string[]) => Loading; + +// @public (undocumented) +export const getResetStateWithoutInitial: (loadingActions: string[]) => Loading; + // @public (undocumented) export type Group = { id: string; }; +// @public (undocumented) +export function groupByDate(acc: Record, entry: DateAggregation): Record; + +// @public (undocumented) +export function growthOf(change: ChangeStatistic): GrowthType; + // @public (undocumented) export enum GrowthType { // (undocumented) @@ -432,6 +568,39 @@ export enum IconType { Storage = "storage" } +// @public (undocumented) +export function inclusiveEndDateOf(duration: Duration, inclusiveEndDate: string): string; + +// @public +export function inclusiveStartDateOf(duration: Duration, inclusiveEndDate: string): string; + +// @public (undocumented) +export const indefiniteArticleOf: (articles: [string, string], word: string) => string; + +// @public (undocumented) +export const INITIAL_LOADING_ACTIONS: DefaultLoadingAction[]; + +// @public (undocumented) +export const initialStatesOf: (products: Product[], responses: Array>) => ProductState[]; + +// @public (undocumented) +export function intervalsOf(duration: Duration, inclusiveEndDate: string, repeating?: number): string; + +// @public (undocumented) +export const isInvalid: ({ label, payload }: TooltipProps) => boolean; + +// @public (undocumented) +export const isLabeled: (data?: Record<"activeLabel", string | undefined> | undefined) => boolean | "" | undefined; + +// @public (undocumented) +export function isNull(value: any): boolean; + +// @public (undocumented) +export function isUndefined(value: any): value is undefined; + +// @public (undocumented) +export const isUnlabeled: (data?: Record<"activeLabel", string | undefined> | undefined) => boolean; + // @public (undocumented) export const LegendItem: ({ title, tooltipText, markerColor, children, }: PropsWithChildren) => JSX.Element; @@ -442,6 +611,9 @@ export type LegendItemProps = { markerColor?: string; }; +// @public (undocumented) +export const lengthyCurrencyFormatter: Intl.NumberFormat; + // @public (undocumented) export type Loading = Record; @@ -473,6 +645,28 @@ export const MockConfigProvider: ({ children, ...context }: MockConfigProviderPr // @public (undocumented) export const MockCurrencyProvider: ({ children, ...context }: MockCurrencyProviderProps) => JSX.Element; +// @public (undocumented) +export const monthFormatter: Intl.DateTimeFormat; + +// @public (undocumented) +export const monthOf: (date: string) => string; + +// @public (undocumented) +export type NavigationItem = { + navigation: string; + icon: JSX.Element; + title: string; +}; + +// @public (undocumented) +export function notEmpty(value: TValue | null | undefined): value is TValue; + +// @public (undocumented) +export const numberFormatter: Intl.NumberFormat; + +// @public (undocumented) +export const overviewGraphTickFormatter: (millis: string | number) => string; + // @public (undocumented) export interface PageFilters { // (undocumented) @@ -485,6 +679,15 @@ export interface PageFilters { project: Maybe; } +// @public (undocumented) +export const parse: (queryString: string) => Partial; + +// @public (undocumented) +export type Period = { + periodStart: string; + periodEnd: string; +}; + // @public (undocumented) export interface Product { // (undocumented) @@ -512,6 +715,13 @@ export interface ProductPeriod { productType: string; } +// @public (undocumented) +export type ProductState = { + product: Product; + entity: Maybe; + duration: Duration; +}; + // @public (undocumented) export interface Project { // (undocumented) @@ -551,6 +761,15 @@ export interface ProjectGrowthData { project: string; } +// @public (undocumented) +export function quarterEndDate(inclusiveEndDate: string): string; + +// @public (undocumented) +export const quarterOf: (date: string) => string; + +// @public (undocumented) +export const rateOf: (cost: number, duration: Duration) => number; + // @public (undocumented) export interface ResourceData { // (undocumented) @@ -561,6 +780,40 @@ export interface ResourceData { previous: number; } +// @public (undocumented) +export const resourceOf: (entity: Entity | AlertCost) => ResourceData; + +// @public (undocumented) +export const resourceSort: (a: ResourceData, b: ResourceData) => number; + +// @public (undocumented) +export const ScrollAnchor: ({ id, left, top, block, inline, behavior, }: ScrollAnchorProps) => JSX.Element; + +// @public (undocumented) +export interface ScrollAnchorProps extends ScrollIntoViewOptions { + // (undocumented) + id: ScrollTo; + // (undocumented) + left?: number; + // (undocumented) + top?: number; +} + +// @public (undocumented) +export const settledResponseOf: (responses: PromiseSettledResult[]) => Array>; + +// @public (undocumented) +export const stringify: (queryParams: Partial) => string; + +// @public (undocumented) +export const titleOf: (label?: string | number | undefined) => string; + +// @public (undocumented) +export function toDataMax(metric: string, data: ChartData[]): number; + +// @public (undocumented) +export function toMaxCost(acc: ChartData, entry: ChartData): ChartData; + // @public (undocumented) export type TooltipItem = { fill: string; @@ -568,6 +821,19 @@ export type TooltipItem = { value: string; }; +// @public (undocumented) +export const tooltipItemOf: (payload: TooltipPayload) => { + label: string; + value: string; + fill: string; +} | null; + +// @public (undocumented) +export function totalAggregationSort(a: ProductState, b: ProductState): number; + +// @public (undocumented) +export function trendFrom(trendline: Trendline, date: number): number; + // @public (undocumented) export type Trendline = { slope: number; @@ -615,6 +881,132 @@ export interface UnlabeledDataflowData { unlabeledCost: number; } +// @public (undocumented) +export const useActionItemCardStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useAlertCardActionHeaderStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useAlertDialogStyles: (props?: any) => ClassNameMap<"radio" | "icon" | "content" | "actions">; + +// @public (undocumented) +export const useAlertInsightsSectionStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useAlertStatusSummaryButtonStyles: (props?: any) => ClassNameMap<"icon" | "clicked">; + +// @public (undocumented) +export const useBackdropStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useBarChartLabelStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useBarChartLayoutStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useBarChartStepperButtonStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useBarChartStepperStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useBarChartStyles: (theme: CostInsightsTheme) => { + axis: { + fill: string; + }; + barChart: { + margin: { + left: number; + right: number; + }; + }; + cartesianGrid: { + stroke: string; + }; + cursor: { + fill: string; + fillOpacity: number; + }; + container: { + height: number; + width: number; + }; + infoIcon: { + marginLeft: number; + fontSize: string; + }; + xAxis: { + height: number; + }; +}; + +// @public (undocumented) +export const useCostGrowthLegendStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useCostGrowthStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useCostInsightsStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useCostInsightsTabsStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useCostOverviewStyles: (theme: CostInsightsTheme) => { + axis: { + fill: string; + }; + container: { + height: number; + width: number; + }; + cartesianGrid: { + stroke: string; + }; + chart: { + margin: { + right: number; + top: number; + }; + }; + yAxis: { + width: number; + }; +}; + +// @public (undocumented) +export const useEntityDialogStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useNavigationStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useOverviewTabsStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useProductInsightsCardStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useProductInsightsChartStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useSelectStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useSubtleTypographyStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const useTooltipStyles: (props?: any) => ClassNameMap; + +// @public (undocumented) +export const validate: (queryString: string) => Promise; + +// @public (undocumented) +export function validateMetrics(metrics: Metric[]): void; + // (No @packageDocumentation comment for this package) From a61310b1dc7199f26ca3e21f52fe2749fd1ae0fa Mon Sep 17 00:00:00 2001 From: Vannarath Poeu Date: Thu, 24 Jun 2021 18:19:07 +0800 Subject: [PATCH 5/5] Regenerated api-report after rebase Signed-off-by: Vannarath Poeu --- plugins/cost-insights/api-report.md | 392 ---------------------------- 1 file changed, 392 deletions(-) diff --git a/plugins/cost-insights/api-report.md b/plugins/cost-insights/api-report.md index 9092791d9b..97dd33e5ad 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -8,7 +8,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePalette } from '@backstage/theme'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; -import { ClassNameMap } from '@material-ui/styles'; import { ContentRenderer } from 'recharts'; import { Dispatch } from 'react'; import { ForwardRefExoticComponent } from 'react'; @@ -19,16 +18,9 @@ import { RechartsFunction } from 'recharts'; import { RefAttributes } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SetStateAction } from 'react'; -import { TooltipPayload } from 'recharts'; import { TooltipProps } from 'recharts'; import { TypographyProps } from '@material-ui/core'; -// @public (undocumented) -export const aggregationSort: (a: DateAggregation, b: DateAggregation) => number; - -// @public (undocumented) -export const aggregationSum: (aggregation: DateAggregation[]) => number; - // @public export type Alert = { title: string | JSX.Element; @@ -133,12 +125,6 @@ export enum AlertStatus { Snoozed = "snoozed" } -// @public (undocumented) -export function assertAlways(argument: T | undefined): T; - -// @public (undocumented) -export function assertNever(x: never): never; - // @public (undocumented) export const BarChart: ({ resources, responsive, displayAmount, options, tooltip, onClick, onMouseMove, }: BarChartProps) => JSX.Element; @@ -208,9 +194,6 @@ export type BarChartTooltipProps = { actions?: ReactNode; }; -// @public (undocumented) -export function brighten(color: string, coefficient?: number): string; - // @public (undocumented) export interface ChangeStatistic { // (undocumented) @@ -235,9 +218,6 @@ export type ChartData = { [key: string]: number; }; -// @public (undocumented) -export function choose([savings, excess]: [T, T], change: ChangeStatistic): T; - // @public (undocumented) export interface Cost { // (undocumented) @@ -252,9 +232,6 @@ export interface Cost { trendline?: Trendline; } -// @public (undocumented) -export const costFormatter: Intl.NumberFormat; - // @public (undocumented) export const CostGrowth: ({ change, duration }: CostGrowthProps) => JSX.Element; @@ -288,15 +265,9 @@ export type CostInsightsApi = { // @public (undocumented) export const costInsightsApiRef: ApiRef; -// @public (undocumented) -export const costInsightsDarkTheme: CostInsightsThemeOptions; - // @public (undocumented) export const CostInsightsLabelDataflowInstructionsPage: () => JSX.Element; -// @public (undocumented) -export const costInsightsLightTheme: CostInsightsThemeOptions; - // @public (undocumented) export const CostInsightsPage: () => JSX.Element; @@ -346,9 +317,6 @@ export interface Currency { unit: string; } -// @public (undocumented) -export const currencyFormatter: Intl.NumberFormat; - // @public (undocumented) export enum CurrencyType { // (undocumented) @@ -377,42 +345,9 @@ export type DateAggregation = { amount: number; }; -// @public (undocumented) -export const dateFormatter: Intl.DateTimeFormat; - // @public (undocumented) export const DEFAULT_DATE_FORMAT = "yyyy-LL-dd"; -// @public (undocumented) -export const DEFAULT_DURATION = Duration.P30D; - -// @public (undocumented) -export const defaultCurrencies: Currency[]; - -// @public (undocumented) -export enum DefaultLoadingAction { - // (undocumented) - CostInsightsAlerts = "cost-insights-alerts", - // (undocumented) - CostInsightsInitial = "cost-insights-initial", - // (undocumented) - CostInsightsPage = "cost-insights-page", - // (undocumented) - CostInsightsProducts = "cost-insights-products", - // (undocumented) - LastCompleteBillingDate = "billing-date", - // (undocumented) - UserGroups = "user-groups" -} - -// @public (undocumented) -export enum DefaultNavigation { - // (undocumented) - AlertInsightsHeader = "alert-insights-header", - // (undocumented) - CostOverviewCard = "cost-overview-card" -} - // @public export enum Duration { // (undocumented) @@ -460,82 +395,11 @@ export class ExampleCostInsightsClient implements CostInsightsApi { getUserGroups(userId: string): Promise; } -// @public (undocumented) -export function exclusiveEndDateOf(duration: Duration, inclusiveEndDate: string): string; - -// @public (undocumented) -export function findAlways(collection: T[], callback: (el: T) => boolean): T; - -// @public (undocumented) -export function findAnyKey(record: Record | undefined): string | undefined; - -// @public (undocumented) -export function formatChange(change: ChangeStatistic): string; - -// @public (undocumented) -export function formatCurrency(amount: number, currency?: string): string; - -// @public (undocumented) -export function formatGraphValue(value: number, format?: string): string; - -// @public (undocumented) -export function formatLastTwoLookaheadQuarters(inclusiveEndDate: string): string; - -// @public (undocumented) -export function formatPercent(n: number): string; - -// @public (undocumented) -export function formatPeriod(duration: Duration, date: string, isEndDate: boolean): string; - -// @public (undocumented) -export function getComparedChange(dailyCost: Cost, metricData: MetricData, duration: Duration, lastCompleteBillingDate: string): ChangeStatistic; - -// @public (undocumented) -export const getDefaultNavigationItems: (alerts: number) => NavigationItem[]; - -// @public (undocumented) -export function getDefaultPageFilters(groups: Group[]): PageFilters; - -// @public (undocumented) -export const getDefaultState: (loadingActions: string[]) => Loading; - -// @public (undocumented) -export function getIcon(icon?: string): JSX.Element; - -// @public (undocumented) -export const getInitialPageState: (groups: Group[], queryParams?: Partial) => { - group: Maybe; - project: Maybe; - duration: Duration; - metric: string | null; -}; - -// @public (undocumented) -export const getInitialProductState: (config: ConfigContextProps) => { - productType: string; - duration: Duration; -}[]; - -// @public (undocumented) -export function getPreviousPeriodTotalCost(aggregation: DateAggregation[], duration: Duration, inclusiveEndDate: string): number; - -// @public (undocumented) -export const getResetState: (loadingActions: string[]) => Loading; - -// @public (undocumented) -export const getResetStateWithoutInitial: (loadingActions: string[]) => Loading; - // @public (undocumented) export type Group = { id: string; }; -// @public (undocumented) -export function groupByDate(acc: Record, entry: DateAggregation): Record; - -// @public (undocumented) -export function growthOf(change: ChangeStatistic): GrowthType; - // @public (undocumented) export enum GrowthType { // (undocumented) @@ -568,39 +432,6 @@ export enum IconType { Storage = "storage" } -// @public (undocumented) -export function inclusiveEndDateOf(duration: Duration, inclusiveEndDate: string): string; - -// @public -export function inclusiveStartDateOf(duration: Duration, inclusiveEndDate: string): string; - -// @public (undocumented) -export const indefiniteArticleOf: (articles: [string, string], word: string) => string; - -// @public (undocumented) -export const INITIAL_LOADING_ACTIONS: DefaultLoadingAction[]; - -// @public (undocumented) -export const initialStatesOf: (products: Product[], responses: Array>) => ProductState[]; - -// @public (undocumented) -export function intervalsOf(duration: Duration, inclusiveEndDate: string, repeating?: number): string; - -// @public (undocumented) -export const isInvalid: ({ label, payload }: TooltipProps) => boolean; - -// @public (undocumented) -export const isLabeled: (data?: Record<"activeLabel", string | undefined> | undefined) => boolean | "" | undefined; - -// @public (undocumented) -export function isNull(value: any): boolean; - -// @public (undocumented) -export function isUndefined(value: any): value is undefined; - -// @public (undocumented) -export const isUnlabeled: (data?: Record<"activeLabel", string | undefined> | undefined) => boolean; - // @public (undocumented) export const LegendItem: ({ title, tooltipText, markerColor, children, }: PropsWithChildren) => JSX.Element; @@ -611,9 +442,6 @@ export type LegendItemProps = { markerColor?: string; }; -// @public (undocumented) -export const lengthyCurrencyFormatter: Intl.NumberFormat; - // @public (undocumented) export type Loading = Record; @@ -645,28 +473,6 @@ export const MockConfigProvider: ({ children, ...context }: MockConfigProviderPr // @public (undocumented) export const MockCurrencyProvider: ({ children, ...context }: MockCurrencyProviderProps) => JSX.Element; -// @public (undocumented) -export const monthFormatter: Intl.DateTimeFormat; - -// @public (undocumented) -export const monthOf: (date: string) => string; - -// @public (undocumented) -export type NavigationItem = { - navigation: string; - icon: JSX.Element; - title: string; -}; - -// @public (undocumented) -export function notEmpty(value: TValue | null | undefined): value is TValue; - -// @public (undocumented) -export const numberFormatter: Intl.NumberFormat; - -// @public (undocumented) -export const overviewGraphTickFormatter: (millis: string | number) => string; - // @public (undocumented) export interface PageFilters { // (undocumented) @@ -679,15 +485,6 @@ export interface PageFilters { project: Maybe; } -// @public (undocumented) -export const parse: (queryString: string) => Partial; - -// @public (undocumented) -export type Period = { - periodStart: string; - periodEnd: string; -}; - // @public (undocumented) export interface Product { // (undocumented) @@ -715,13 +512,6 @@ export interface ProductPeriod { productType: string; } -// @public (undocumented) -export type ProductState = { - product: Product; - entity: Maybe; - duration: Duration; -}; - // @public (undocumented) export interface Project { // (undocumented) @@ -761,15 +551,6 @@ export interface ProjectGrowthData { project: string; } -// @public (undocumented) -export function quarterEndDate(inclusiveEndDate: string): string; - -// @public (undocumented) -export const quarterOf: (date: string) => string; - -// @public (undocumented) -export const rateOf: (cost: number, duration: Duration) => number; - // @public (undocumented) export interface ResourceData { // (undocumented) @@ -780,40 +561,6 @@ export interface ResourceData { previous: number; } -// @public (undocumented) -export const resourceOf: (entity: Entity | AlertCost) => ResourceData; - -// @public (undocumented) -export const resourceSort: (a: ResourceData, b: ResourceData) => number; - -// @public (undocumented) -export const ScrollAnchor: ({ id, left, top, block, inline, behavior, }: ScrollAnchorProps) => JSX.Element; - -// @public (undocumented) -export interface ScrollAnchorProps extends ScrollIntoViewOptions { - // (undocumented) - id: ScrollTo; - // (undocumented) - left?: number; - // (undocumented) - top?: number; -} - -// @public (undocumented) -export const settledResponseOf: (responses: PromiseSettledResult[]) => Array>; - -// @public (undocumented) -export const stringify: (queryParams: Partial) => string; - -// @public (undocumented) -export const titleOf: (label?: string | number | undefined) => string; - -// @public (undocumented) -export function toDataMax(metric: string, data: ChartData[]): number; - -// @public (undocumented) -export function toMaxCost(acc: ChartData, entry: ChartData): ChartData; - // @public (undocumented) export type TooltipItem = { fill: string; @@ -821,19 +568,6 @@ export type TooltipItem = { value: string; }; -// @public (undocumented) -export const tooltipItemOf: (payload: TooltipPayload) => { - label: string; - value: string; - fill: string; -} | null; - -// @public (undocumented) -export function totalAggregationSort(a: ProductState, b: ProductState): number; - -// @public (undocumented) -export function trendFrom(trendline: Trendline, date: number): number; - // @public (undocumented) export type Trendline = { slope: number; @@ -881,132 +615,6 @@ export interface UnlabeledDataflowData { unlabeledCost: number; } -// @public (undocumented) -export const useActionItemCardStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useAlertCardActionHeaderStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useAlertDialogStyles: (props?: any) => ClassNameMap<"radio" | "icon" | "content" | "actions">; - -// @public (undocumented) -export const useAlertInsightsSectionStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useAlertStatusSummaryButtonStyles: (props?: any) => ClassNameMap<"icon" | "clicked">; - -// @public (undocumented) -export const useBackdropStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useBarChartLabelStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useBarChartLayoutStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useBarChartStepperButtonStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useBarChartStepperStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useBarChartStyles: (theme: CostInsightsTheme) => { - axis: { - fill: string; - }; - barChart: { - margin: { - left: number; - right: number; - }; - }; - cartesianGrid: { - stroke: string; - }; - cursor: { - fill: string; - fillOpacity: number; - }; - container: { - height: number; - width: number; - }; - infoIcon: { - marginLeft: number; - fontSize: string; - }; - xAxis: { - height: number; - }; -}; - -// @public (undocumented) -export const useCostGrowthLegendStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useCostGrowthStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useCostInsightsStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useCostInsightsTabsStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useCostOverviewStyles: (theme: CostInsightsTheme) => { - axis: { - fill: string; - }; - container: { - height: number; - width: number; - }; - cartesianGrid: { - stroke: string; - }; - chart: { - margin: { - right: number; - top: number; - }; - }; - yAxis: { - width: number; - }; -}; - -// @public (undocumented) -export const useEntityDialogStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useNavigationStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useOverviewTabsStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useProductInsightsCardStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useProductInsightsChartStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useSelectStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useSubtleTypographyStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const useTooltipStyles: (props?: any) => ClassNameMap; - -// @public (undocumented) -export const validate: (queryString: string) => Promise; - -// @public (undocumented) -export function validateMetrics(metrics: Metric[]): void; - // (No @packageDocumentation comment for this package)