import type { GeoJsonDataType } from './types'; import { DataPrimitive, TypedValue, DataType, IDataPoint } from './DataPrimitive'; import { TypeSafeValue } from './TypeSafeValue'; /** * Base DataPoint class and associated DataPoint selectors * @implements {DataPrimitive} * @implements {IDataPoint} */ export declare class DataPoint implements DataPrimitive, IDataPoint { private value; field: string; /** * Optional prop indicating if this DataPoint originated from a search result. */ isSearchResult?: boolean; static count: number; static isDataPoint(o: any): o is DataPoint; static fromRaw(value: any): DataPoint; /** * @param {string} field data field * @param {object} value data value + it's type (number, string, time, color, geojson) * @param {object} isSearchResult optional prop for search result tagging */ constructor(field: string, value: TypedValue, isSearchResult?: boolean); getValue(): TypeSafeValue; /** * Sets the data point's value to a static TypedValue. * @param {TypedValue} v */ setValue(v: TypedValue): void; /** * Get only value of the data point. * @returns {string|number|GeoJsonDataType|null} */ getRawValue(): string | number | GeoJsonDataType | null; /** * Get only the coerced value of the data point. * @returns {string|number|null} */ getCoercedValue(): string | number | GeoJsonDataType | null; /** * Returns the data field of the point. * @public * @returns {DataPoint<'string'>} */ getField(): DataPoint<'string'>; /** * Returns the data type of the point. * @public * @returns {string} */ getType(): string; /** * Adds a number to the current data point value and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @param {number} value amount to add to the current point * @returns {DataPoint<'number'>} DataPoint with the adjusted numeric value, or undefined for non-numeric input */ plus(value: number): DataPoint<'number'>; /** * Subtracts a number from the current data point value and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @param {number} value amount to subtract from the current point * @returns {DataPoint<'number'>} DataPoint with the adjusted numeric value, or undefined for non-numeric input */ minus(value: number): DataPoint<'number'>; /** * Multiplies the current data point value by a number and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @param {number} value amount to multiply the current point by * @returns {DataPoint<'number'>} DataPoint with the adjusted numeric value, or undefined for non-numeric input */ multiply(value: number): DataPoint<'number'>; /** * Divides the current data point value by a number and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @param {number} value amount to divide the current point by * @returns {DataPoint<'number'>} DataPoint with the adjusted numeric value, or undefined for non-numeric input */ divide(value: number): DataPoint<'number'>; /** * Returns the absolute value of the current data point as a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @returns {DataPoint<'number'>} DataPoint with absolute value, or undefined for non-numeric input */ abs(): DataPoint<'number'>; /** * Rounds the current data point value to the nearest integer and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @returns {DataPoint<'number'>} DataPoint with rounded value, or undefined for non-numeric input */ round(): DataPoint<'number'>; /** * Floors the current data point value to the nearest lower integer and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @returns {DataPoint<'number'>} DataPoint with floored value, or undefined for non-numeric input */ floor(): DataPoint<'number'>; /** * Ceils the current data point value to the nearest higher integer and returns a new DataPoint. * Numeric types and numeric strings are both supported. * * @public * @returns {DataPoint<'number'>} DataPoint with ceiled value, or undefined for non-numeric input */ ceil(): DataPoint<'number'>; }