import type { BinaryAttribute, Color, PickingInfo } from '@deck.gl/core'; import { TypedArray } from '@math.gl/types'; import * as arrow from 'apache-arrow'; /** * An individual layer's data */ export type GeoArrowLayerData = { data: T; length: number; attributes?: Record; }; /** * Internal type for layer data handling, used in `wrapAccessorFunction`. */ export type _GeoArrowInternalLayerData = GeoArrowLayerData & { /** * A lookup table from expanded multi-geometry index to original index. * * This is omitted from the user-facing type because in `wrapAccessorFunction` * in `utils.ts` we apply the lookup from "exploded" row to "original" row. */ invertedGeomOffsets?: Uint8Array | Uint16Array | Uint32Array; }; export type AccessorContext = { /** The current row index of the current iteration */ index: number; /** The value of the `data` prop */ data: GeoArrowLayerData; /** A pre-allocated array. The accessor function can optionally fill data into this array and return it, * instead of creating a new array for every object. In some browsers this improves performance significantly * by reducing garbage collection. */ target: number[]; }; /** * Internal type for layer data handling, used in `wrapAccessorFunction`. */ export type _InternalAccessorContext = AccessorContext & { /** The value of the `data` prop */ data: _GeoArrowInternalLayerData; }; /** Function that returns a value for each object. */ export type AccessorFunction = ( /** Contextual information of the current element. */ objectInfo: AccessorContext) => Out; /** Either a uniform value for all objects, or a function that returns a value for each object. */ export type Accessor = Out | AccessorFunction; export type GeoArrowPickingInfo = PickingInfo & { object?: arrow.StructRowProxy; }; export type FloatAccessor = arrow.Vector | Accessor; export type TimestampAccessor = arrow.Vector>; export type ColorAccessor = arrow.Vector> | Accessor; export type NormalAccessor = arrow.Vector> | Accessor>>; export type ExtensionProps = { getFiltered?: ({ index }: { index: number; }) => number; getFilterValue?: (d: any, objectInfo?: { index: number; }) => (number | number[])[]; };