import { DataPrimitiveFormatter } from '../Formatter'; import { DataType } from '../DataPrimitive'; import { DataPoint } from '../DataPoint'; import { DataSeries } from '../DataSeries'; import { DataFrame } from '../DataFrame'; interface ObjectConfig { rename: { [key: string]: string; }; } /** * Formatter which converts a DataPrimitive into an array of objects. This is typically used in conjunction with UDF inputs. * * ```js * // UDF inputs * { * "inputs": { * "input1": { * "context": { * "staticOptions": [["All Users"], ["*"]], * "field1": "> primary | seriesByName(\"users\") | renameSeries(\"label\")", * "field2": "> primary | seriesByName(\"ids\") | renameSeries(\"value\")"", * }, * "type": "input.multiselect", * "options": { * "items": "> frame(field1, field2) | prepend(staticOptions) | objects()" * // returns [ * // { label: 'All users', value: '*' }, * // { label: 'jane doe', value: 'jdoe' }, * // { label: 'joe schmo', value: 'jschmo' }, * // { label: 'jack schmidt', value: 'jschmidt' }, * // ] * ] * }, * "dataSources": { * "primary": { * "data": { * "fields": [{ "name": 'users' } , { "name": "ids" } ], * "columns": [[ "jane doe", "joe schmo", "jack schmidt"], ["jdoe", "jschmo", "jschmidt"]] * } * } * }, * } * } * } * ``` */ export declare class Objects implements DataPrimitiveFormatter { /** * Helper to attach enumerable isSearchResult property to an object. * Enumerable so it survives worker serialization via structured clone / postMessage. * Writable to avoid issues with Object.assign and other cloning operations. */ static attachMeta(target: Record, isSearchResult: boolean): void; private readonly config; constructor(objectConfig?: ObjectConfig); format(dp: DataPoint | DataSeries | DataFrame): Record; private seriesToObjects; } export {};