import { type ConvertibleUnit, type FormatDateOptions, type FormatOptions, type Unit } from '@dynatrace-sdk/units'; import type { ColumnDefBase } from '../hooks/useTable/types.js'; import type { DataTableV2DisplayColumnDef } from '../public.api.js'; /** * Options to format a currency (incl. locale and properties accepted by Intl.NumberFormat). * @public */ export interface FormatterCurrencyOptions extends Omit { /** * The ISO 4217 currency code, such as 'USD' or 'EUR', to which the currency will be formatted. */ currency: Intl.NumberFormatOptions['currency']; /** * The locale according to which the currency will be formatted. */ locale?: string | string[]; /** * Shortens the number, e.g. 1500 → 1.5k */ abbreviate?: boolean; } /** * Definition type for the DataTableV2 column definition formatter options * @public */ export type DataTableV2CellFormatter = FormatOptions | FormatDateOptions | FormatterCurrencyOptions; /** * Defines the options passed to the format function. * @public */ export type DataTableV2CellFormatterColumnDef = { /** Allows formatter options from the `@dynatrace-sdk/units` package to be set. */ formatter?: DataTableV2CellFormatter; }; /** * Updates the cell renderer with the formatter from the column definition * @param columnDef - column definition prop * * @returns the column definition with the formatter applied * @internal */ export declare function applyColumnFormatters(columnDef: DataTableV2DisplayColumnDef): { cell?: ColumnDefBase['cell']; }; /** * Formats the given value based on formatter options from the column definition. * For 'sparkline', 'meterbar', 'gantt', and 'log-content', returns an empty string. * If there is no other formatter possible then returns a stringified value. * @param value - the cell value to format. * @param column - column definition prop where `columnType` and `formatter` are relevant. * * @returns the formatted cell value * @internal */ export declare function formatCellValue(value: TValue, column: DataTableV2DisplayColumnDef): string;