import type { IntlShape } from 'react-intl'; import type { FilterSegmentVariableDefinition, ResultRecord, ResultRecordValue } from '@dynatrace-sdk/client-query'; import type { CachedSegment } from './contexts/SegmentsCache/SegmentsCache.js'; /** * @internal */ export declare function convertQueryRecordToStoreSegmentVariables(records: (ResultRecord | null)[]): FilterSegmentVariableDefinition[]; /** * We try to parse a string that might be JSON, if it fails we return the original data. * In case the parse fails due to a SyntaxError, we assume it's not JSON (standard JSON.parse error type). * If it fails for any other reason, we return 'null' to avoid breaking the flow. * @param data * @returns */ export declare const parsePossibleJson: (data: unknown) => any; /** * * @param record - ResultRecordValue * @returns stringified version of the result * @internal */ export declare function flattenQueryResultToValues(base: string[], row: ResultRecordValue[]): string[]; /** * Helper function to return a readable textvalue for segment variable values * that can be rendered in triggers, options, tooltips and presets. * @internal */ export declare function getReadableValue(value: string | null | undefined, intl: IntlShape): string | null | undefined; /** * Returns the readable values of the first variable of a segment as a comma separated string, * which is what options and presets display. Returns an empty string if there are none. * @internal */ export declare function getFirstVariableValues(variables: ReadonlyArray<{ values: ReadonlyArray; }> | undefined, intl: IntlShape): string; /** * Returns the segment name, falling back to the given value if the name is missing or empty. * @internal */ export declare function getSafeSegmentName(segment: CachedSegment['segment'] | null | undefined, fallback: string): string; //# sourceMappingURL=utils.d.ts.map