/* tslint:disable */ /* eslint-disable */ /** */ export function set_panic_hook(): void; /** * Read a GeoParquet file into GeoArrow memory * * Example: * * ```js * import { tableFromIPC } from "apache-arrow"; * // Edit the `parquet-wasm` import as necessary * import { readParquet } from "parquet-wasm/node2"; * * const resp = await fetch("https://example.com/file.parquet"); * const parquetUint8Array = new Uint8Array(await resp.arrayBuffer()); * const arrowUint8Array = readParquet(parquetUint8Array); * const arrowTable = tableFromIPC(arrowUint8Array); * ``` * * @param file Uint8Array containing GeoParquet data * @returns Uint8Array containing Arrow data in [IPC Stream format](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format). To parse this into an Arrow table, pass to `tableFromIPC` in the Arrow JS bindings. * @param {Uint8Array} file * @returns {Table} */ export function readGeoParquet(file: Uint8Array): Table; /** * Write table to GeoParquet * * Note that this consumes the table input * @param {Table} table * @returns {Uint8Array} */ export function writeGeoParquet(table: Table): Uint8Array; /** * Returns a handle to this wasm instance's `WebAssembly.Memory` * @returns {Memory} */ export function wasmMemory(): Memory; /** * Returns a handle to this wasm instance's `WebAssembly.Table` which is the indirect function * table used by Rust * @returns {FunctionTable} */ export function _functionTable(): FunctionTable; /** */ export enum Type { /** * The default placeholder type */ NONE = 0, /** * A NULL type having no physical storage */ Null = 1, /** * Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */ Int = 2, /** * 2, 4, or 8-byte floating point value */ Float = 3, /** * Variable-length bytes (no guarantee of UTF8-ness) */ Binary = 4, /** * UTF8 variable-length string as List */ Utf8 = 5, /** * Boolean as 1 bit, LSB bit-packed ordering */ Bool = 6, /** * Precision-and-scale-based decimal type. Storage type depends on the parameters. */ Decimal = 7, /** * int32_t days or int64_t milliseconds since the UNIX epoch */ Date = 8, /** * Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, * microseconds, or nanoseconds since midnight since midnight */ Time = 9, /** * Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */ Timestamp = 10, /** * YEAR_MONTH or DAY_TIME interval in SQL style */ Interval = 11, /** * A list of some logical data type */ List = 12, /** * Struct of logical types */ Struct = 13, /** * Union of logical types */ Union = 14, /** * Fixed-size binary. Each value occupies the same number of bytes */ FixedSizeBinary = 15, /** * Fixed-size list. Each value occupies the same number of bytes */ FixedSizeList = 16, /** * Map of named logical types */ Map = 17, /** * Measure of elapsed time in either seconds, milliseconds, microseconds or nanoseconds. */ Duration = 18, } /** */ export enum Precision { Half = 0, Single = 1, Double = 2, } /** */ export enum TimeUnit { Second = 0, Millisecond = 1, Microsecond = 2, Nanosecond = 3, } /** */ export enum IntervalUnit { YearMonth = 0, DayTime = 1, MonthDayNano = 2, } /** */ export enum UnionMode { Sparse = 0, Dense = 1, } /** */ export enum BufferType { /** * * * used in List type, Dense Union and variable length primitive types (String, Binary) * */ Offset = 0, /** * * * actual data, either fixed width primitive types in slots or variable width delimited by an OFFSET vector * */ Data = 1, /** * * * Bit vector indicating if each value is null * */ Validity = 2, /** * * * Type vector used in Union type * */ Type = 3, } /** * An enum of geometry types */ export enum GeometryType { Point = 0, LineString = 1, Polygon = 3, MultiPoint = 4, MultiLineString = 5, MultiPolygon = 6, } /** */ export enum DateUnit { Day = 0, Millisecond = 1, } export type FieldMetadata = Map; export type SchemaMetadata = Map; export type FunctionTable = WebAssembly.Table; export type Memory = WebAssembly.Memory; /** * Opaque binary data of variable length. * * A single Binary array can store up to [`i32::MAX`] bytes * of binary data in total */ export class Binary { free(): void; } /** * A boolean datatype representing the values `true` and `false`. */ export class Boolean { free(): void; } /** */ export class BroadcastableAffine { free(): void; /** * @param {Float64Array} transform * @returns {BroadcastableAffine} */ static fromScalar(transform: Float64Array): BroadcastableAffine; /** * @param {Float64Array} transform * @returns {BroadcastableAffine} */ static fromArray(transform: Float64Array): BroadcastableAffine; } /** */ export class BroadcastableFloat { free(): void; /** * @param {number} value * @returns {BroadcastableFloat} */ static fromScalar(value: number): BroadcastableFloat; /** * @param {Float64Array} values * @returns {BroadcastableFloat} */ static fromArray(values: Float64Array): BroadcastableFloat; } /** * An immutable buffer of coordinates in WebAssembly memory, that can be either interleaved or * separated. */ export class CoordBuffer { free(): void; /** * Create a new CoordBuffer from a `Float64Array` of interleaved XY coordinates * @param {Float64Array} coords * @returns {CoordBuffer} */ static fromInterleaved(coords: Float64Array): CoordBuffer; /** * Create a new CoordBuffer from two `Float64Array`s of X and Y * @param {Float64Array} x * @param {Float64Array} y * @returns {CoordBuffer} */ static fromSeparated(x: Float64Array, y: Float64Array): CoordBuffer; /** * Create a new CoordBuffer from an `InterleavedCoordBuffer` object * @param {InterleavedCoordBuffer} coords * @returns {CoordBuffer} */ static fromInterleavedCoords(coords: InterleavedCoordBuffer): CoordBuffer; /** * Create a new CoordBuffer from a `SeparatedCoordBuffer` object * @param {SeparatedCoordBuffer} coords * @returns {CoordBuffer} */ static fromSeparatedCoords(coords: SeparatedCoordBuffer): CoordBuffer; } /** * A representation of an Arrow `Data` instance in WebAssembly memory. * * This has the same underlying representation as an Arrow JS `Data` object. */ export class Data { free(): void; /** * Export this to FFI. * @returns {FFIData} */ toFFI(): FFIData; /** * Copy the values of this `Data` instance to a TypedArray in the JavaScript heap. * * This will silently ignore any null values. This will error on non-primitive data types for * which a TypedArray does not exist in JavaScript. * @returns {any} */ toTypedArray(): any; } /** * A 32-bit date representing the elapsed time since UNIX epoch (1970-01-01) * in days (32 bits). */ export class Date32 { free(): void; } /** * A 64-bit date representing the elapsed time since UNIX epoch (1970-01-01) * in milliseconds (64 bits). Values are evenly divisible by 86400000. */ export class Date64 { free(): void; } /** * Exact 128-bit width decimal value with precision and scale * * * precision is the total number of digits * * scale is the number of digits past the decimal * * For example the number 123.45 has precision 5 and scale 2. * * In certain situations, scale could be negative number. For * negative scale, it is the number of padding 0 to the right * of the digits. * * For example the number 12300 could be treated as a decimal * has precision 3 and scale -2. */ export class Decimal128 { free(): void; } /** * Exact 256-bit width decimal value with precision and scale * * * precision is the total number of digits * * scale is the number of digits past the decimal * * For example the number 123.45 has precision 5 and scale 2. * * In certain situations, scale could be negative number. For * negative scale, it is the number of padding 0 to the right * of the digits. * * For example the number 12300 could be treated as a decimal * has precision 3 and scale -2. */ export class Decimal256 { free(): void; } /** * A dictionary encoded array (`key_type`, `value_type`), where * each array element is an index of `key_type` into an * associated dictionary of `value_type`. * * Dictionary arrays are used to store columns of `value_type` * that contain many repeated values using less memory, but with * a higher CPU overhead for some operations. * * This type mostly used to represent low cardinality string * arrays or a limited set of primitive types as integers. */ export class Dictionary { free(): void; } /** * Measure of elapsed time in either seconds, milliseconds, microseconds or nanoseconds. */ export class Duration { free(): void; } /** * An Arrow array exported to FFI. * * Using [`arrow-js-ffi`](https://github.com/kylebarron/arrow-js-ffi), you can view or copy Arrow * these objects to JavaScript. * * Note that this also includes an ArrowSchema C struct as well, so that extension type * information can be maintained. * ## Memory management * * Note that this array will not be released automatically. You need to manually call `.free()` to * release memory. */ export class FFIData { free(): void; /** * Access the pointer to the * [`ArrowArray`](https://arrow.apache.org/docs/format/CDataInterface.html#structure-definitions) * struct. This can be viewed or copied (without serialization) to an Arrow JS `RecordBatch` by * using [`arrow-js-ffi`](https://github.com/kylebarron/arrow-js-ffi). You can access the * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory) * instance by using {@linkcode wasmMemory}. * * **Example**: * * ```ts * import { parseRecordBatch } from "arrow-js-ffi"; * * const wasmRecordBatch: FFIRecordBatch = ... * const wasmMemory: WebAssembly.Memory = wasmMemory(); * * // Pass `true` to copy arrays across the boundary instead of creating views. * const jsRecordBatch = parseRecordBatch( * wasmMemory.buffer, * wasmRecordBatch.arrayAddr(), * wasmRecordBatch.schemaAddr(), * true * ); * ``` * @returns {number} */ arrayAddr(): number; /** * Access the pointer to the * [`ArrowSchema`](https://arrow.apache.org/docs/format/CDataInterface.html#structure-definitions) * struct. This can be viewed or copied (without serialization) to an Arrow JS `Field` by * using [`arrow-js-ffi`](https://github.com/kylebarron/arrow-js-ffi). You can access the * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory) * instance by using {@linkcode wasmMemory}. * * **Example**: * * ```ts * import { parseRecordBatch } from "arrow-js-ffi"; * * const wasmRecordBatch: FFIRecordBatch = ... * const wasmMemory: WebAssembly.Memory = wasmMemory(); * * // Pass `true` to copy arrays across the boundary instead of creating views. * const jsRecordBatch = parseRecordBatch( * wasmMemory.buffer, * wasmRecordBatch.arrayAddr(), * wasmRecordBatch.schemaAddr(), * true * ); * ``` * @returns {number} */ schemaAddr(): number; } /** */ export class FFISchema { free(): void; /** * Access the pointer to the * [`ArrowSchema`](https://arrow.apache.org/docs/format/CDataInterface.html#structure-definitions) * struct. This can be viewed or copied (without serialization) to an Arrow JS `Field` by * using [`arrow-js-ffi`](https://github.com/kylebarron/arrow-js-ffi). You can access the * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory) * instance by using {@linkcode wasmMemory}. * * **Example**: * * ```ts * import { parseRecordBatch } from "arrow-js-ffi"; * * const wasmRecordBatch: FFIRecordBatch = ... * const wasmMemory: WebAssembly.Memory = wasmMemory(); * * // Pass `true` to copy arrays across the boundary instead of creating views. * const jsRecordBatch = parseRecordBatch( * wasmMemory.buffer, * wasmRecordBatch.arrayAddr(), * wasmRecordBatch.schemaAddr(), * true * ); * ``` * @returns {number} */ addr(): number; } /** * A representation of an Arrow C Stream in WebAssembly memory exposed as FFI-compatible * structs through the Arrow C Data Interface. * * Unlike other Arrow implementations outside of JS, this always stores the "stream" fully * materialized as a sequence of Arrow chunks. */ export class FFIStream { free(): void; /** * Get the total number of elements in this stream * @returns {number} */ numArrays(): number; /** * Get the pointer to the ArrowSchema FFI struct * @returns {number} */ schemaAddr(): number; /** * Get the pointer to one ArrowArray FFI struct for a given chunk index and column index * * Access the pointer to one * [`ArrowArray`](https://arrow.apache.org/docs/format/CDataInterface.html#structure-definitions) * struct representing one of the internal `RecordBatch`es. This can be viewed or copied (without serialization) to an Arrow JS `RecordBatch` by * using [`arrow-js-ffi`](https://github.com/kylebarron/arrow-js-ffi). You can access the * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory) * instance by using {@linkcode wasmMemory}. * * **Example**: * * ```ts * import * as arrow from "apache-arrow"; * import { parseRecordBatch } from "arrow-js-ffi"; * * const wasmTable: FFITable = ... * const wasmMemory: WebAssembly.Memory = wasmMemory(); * * const jsBatches: arrow.RecordBatch[] = [] * for (let i = 0; i < wasmTable.numBatches(); i++) { * // Pass `true` to copy arrays across the boundary instead of creating views. * const jsRecordBatch = parseRecordBatch( * wasmMemory.buffer, * wasmTable.arrayAddr(i), * wasmTable.schemaAddr(), * true * ); * jsBatches.push(jsRecordBatch); * } * const jsTable = new arrow.Table(jsBatches); * ``` * * @param chunk number The chunk index to use * @returns number pointer to an ArrowArray FFI struct in Wasm memory * @param {number} chunk * @returns {number} */ arrayAddr(chunk: number): number; /** * @returns {Uint32Array} */ arrayAddrs(): Uint32Array; /** */ drop(): void; } /** */ export class Field { free(): void; /** * Export this field to an `FFISchema`` object, which can be read with arrow-js-ffi. * @returns {FFISchema} */ toFFI(): FFISchema; /** * Returns the `Field`'s name. * @returns {string} */ name(): string; /** * Sets the name of this `Field` and returns a new object * @param {string} name * @returns {Field} */ withName(name: string): Field; /** * @returns {any} */ dataType(): any; /** * Indicates whether this [`Field`] supports null values. * @returns {boolean} */ isNullable(): boolean; /** * @returns {FieldMetadata} */ metadata(): FieldMetadata; /** * Sets the metadata of this `Field` to be `metadata` and returns a new object * @param {FieldMetadata} metadata * @returns {Field} */ withMetadata(metadata: FieldMetadata): Field; } /** * Opaque binary data of fixed size. * Enum parameter specifies the number of bytes per value. */ export class FixedSizeBinary { free(): void; } /** * A list of some logical data type with fixed length. */ export class FixedSizeList { free(): void; } /** * A 16-bit floating point number. */ export class Float16 { free(): void; } /** * A 32-bit floating point number. */ export class Float32 { free(): void; } /** * A 64-bit floating point number. */ export class Float64 { free(): void; } /** *r" An immutable array of GeometryCollection geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class GeometryCollectionData { free(): void; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** * A signed 16-bit integer. */ export class Int16 { free(): void; } /** * A signed 32-bit integer. */ export class Int32 { free(): void; } /** * A signed 64-bit integer. */ export class Int64 { free(): void; } /** * A signed 8-bit integer. */ export class Int8 { free(): void; } /** * An immutable buffer of interleaved coordinates in WebAssembly memory. */ export class InterleavedCoordBuffer { free(): void; /** * @param {Float64Array} coords */ constructor(coords: Float64Array); } /** * A "calendar" interval which models types that don't necessarily * have a precise duration without the context of a base timestamp (e.g. * days can differ in length during day light savings time transitions). */ export class Interval { free(): void; } /** */ export class IntoUnderlyingByteSource { free(): void; /** * @param {ReadableByteStreamController} controller */ start(controller: ReadableByteStreamController): void; /** * @param {ReadableByteStreamController} controller * @returns {Promise} */ pull(controller: ReadableByteStreamController): Promise; /** */ cancel(): void; /** */ readonly autoAllocateChunkSize: number; /** */ readonly type: string; } /** */ export class IntoUnderlyingSink { free(): void; /** * @param {any} chunk * @returns {Promise} */ write(chunk: any): Promise; /** * @returns {Promise} */ close(): Promise; /** * @param {any} reason * @returns {Promise} */ abort(reason: any): Promise; } /** */ export class IntoUnderlyingSource { free(): void; /** * @param {ReadableStreamDefaultController} controller * @returns {Promise} */ pull(controller: ReadableStreamDefaultController): Promise; /** */ cancel(): void; } /** * Opaque binary data of variable length and 64-bit offsets. * * A single LargeBinary array can store up to [`i64::MAX`] bytes * of binary data in total */ export class LargeBinary { free(): void; } /** * A list of some logical data type with variable length and 64-bit offsets. * * A single LargeList array can store up to [`i64::MAX`] elements in total */ export class LargeList { free(): void; } /** * A variable-length string in Unicode with UFT-8 encoding and 64-bit offsets. * * A single LargeUtf8 array can store up to [`i64::MAX`] bytes * of string data in total */ export class LargeUtf8 { free(): void; } /** *r" An immutable array of LineString geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class LineStringData { free(): void; /** * @param {CoordBuffer} coords * @param {Int32Array} geom_offsets */ constructor(coords: CoordBuffer, geom_offsets: Int32Array); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** * A list of some logical data type with variable length. * * A single List array can store up to [`i32::MAX`] elements in total */ export class List { free(): void; } /** * A Map is a logical nested type that is represented as * * `List>` * * The keys and values are each respectively contiguous. * The key and value types are not constrained, but keys should be * hashable and unique. * Whether the keys are sorted can be set in the `bool` after the `Field`. * * In a field with Map type, the field has a child Struct field, which then * has two children: key type and the second the value type. The names of the * child fields may be respectively "entries", "key", and "value", but this is * not enforced. */ export class Map_ { free(): void; } /** *r" An immutable array of Geometry geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class MixedGeometryData { free(): void; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** *r" An immutable array of MultiLineString geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class MultiLineStringData { free(): void; /** * @param {CoordBuffer} coords * @param {Int32Array} geom_offsets * @param {Int32Array} ring_offsets */ constructor(coords: CoordBuffer, geom_offsets: Int32Array, ring_offsets: Int32Array); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** *r" An immutable array of MultiPoint geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class MultiPointData { free(): void; /** * @param {CoordBuffer} coords * @param {Int32Array} geom_offsets */ constructor(coords: CoordBuffer, geom_offsets: Int32Array); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** *r" An immutable array of MultiPolygon geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class MultiPolygonData { free(): void; /** * @param {CoordBuffer} coords * @param {Int32Array} geom_offsets * @param {Int32Array} polygon_offsets * @param {Int32Array} ring_offsets */ constructor(coords: CoordBuffer, geom_offsets: Int32Array, polygon_offsets: Int32Array, ring_offsets: Int32Array); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** * Null type */ export class Null { free(): void; } /** */ export class ParquetDataset { free(): void; /** * @param {string} root_url * @param {(string)[]} fragment_urls */ constructor(root_url: string, fragment_urls: (string)[]); /** * @param {any} options * @returns {Promise} */ read(options: any): Promise
; /** * The total number of row groups across all files */ readonly numRowGroups: number; /** * The total number of rows across all files. */ readonly numRows: number; } /** */ export class ParquetFile { free(): void; /** * @param {string} url */ constructor(url: string); /** * Get the bounds of a single row group. * * This fetches bounds for the row group from the column statistics in the row group metadata. * @param {number} row_group_idx * @param {any} bbox_paths * @returns {Float64Array | undefined} */ rowGroupBounds(row_group_idx: number, bbox_paths: any): Float64Array | undefined; /** * Get the bounds of all row groups. * * As of GeoParquet 1.1 you won't need to pass in these column names, as they'll be specified * in the metadata. * @param {any} bbox_paths * @returns {RectData} */ rowGroupsBounds(bbox_paths: any): RectData; /** * Access the bounding box of the given column for the entire file * * If no column name is passed, retrieves the bbox from the primary geometry column. * * An Err will be returned if the column name does not exist in the dataset * None will be returned if the metadata does not contain bounding box information. * @param {string | undefined} [column_name] * @returns {Float64Array | undefined} */ fileBbox(column_name?: string): Float64Array | undefined; /** * @param {any} options * @returns {Promise
} */ read(options: any): Promise
; /** * @param {any} options * @returns {Promise} */ read_stream(options: any): Promise; /** * The number of row groups in this file. */ readonly numRowGroups: number; /** * The number of rows in this file. */ readonly numRows: number; } /** *r" An immutable array of Point geometries in WebAssembly memory using GeoArrow's in-memory *r" representation. */ export class PointData { free(): void; /** * @param {CoordBuffer} coords */ constructor(coords: CoordBuffer); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** *r" An immutable array of Polygon geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class PolygonData { free(): void; /** * @param {CoordBuffer} coords * @param {Int32Array} geom_offsets * @param {Int32Array} ring_offsets */ constructor(coords: CoordBuffer, geom_offsets: Int32Array, ring_offsets: Int32Array); /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** * A group of columns of equal length in WebAssembly memory with an associated {@linkcode Schema}. */ export class RecordBatch { free(): void; /** * Export this RecordBatch to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the RecordBatch, so you must remember to call {@linkcode * RecordBatch.free} to release the resources. The underlying arrays are reference counted, so * this method does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this RecordBatch to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the RecordBatch, so the original RecordBatch will be * inaccessible after this call. You must still call {@linkcode FFIRecordBatch.free} after * you've finished using the FFIRecordBatch. * @returns {FFIData} */ intoFFI(): FFIData; /** * Consume this RecordBatch and convert to an Arrow IPC Stream buffer * @returns {Uint8Array} */ intoIPCStream(): Uint8Array; /** * Override the schema of this [`RecordBatch`] * * Returns an error if `schema` is not a superset of the current schema * as determined by [`Schema::contains`] * @param {Schema} schema * @returns {RecordBatch} */ withSchema(schema: Schema): RecordBatch; /** * Return a new RecordBatch where each column is sliced * according to `offset` and `length` * @param {number} offset * @param {number} length * @returns {RecordBatch} */ slice(offset: number, length: number): RecordBatch; /** * Returns the total number of bytes of memory occupied physically by this batch. * @returns {number} */ getArrayMemorySize(): number; /** * The number of columns in this RecordBatch. */ readonly numColumns: number; /** * The number of rows in this RecordBatch. */ readonly numRows: number; /** * The {@linkcode Schema} of this RecordBatch. */ readonly schema: Schema; } /** *r" An immutable array of Rect geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class RectData { free(): void; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Data, so you must remember to call `free` to * release the resources. The underlying arrays are reference counted, so this method * does not copy data, it only prevents the data from being released. * @returns {FFIData} */ toFFI(): FFIData; /** * Export this Data to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Data, so the original Data will be * inaccessible after this call. You must still call {@linkcode FFIData.free} after * you've finished using the FFIData. * @returns {FFIData} */ intoFFI(): FFIData; } /** * A run-end encoding (REE) is a variation of run-length encoding (RLE). These * encodings are well-suited for representing data containing sequences of the * same value, called runs. Each run is represented as a value and an integer giving * the index in the array where the run ends. * * A run-end encoded array has no buffers by itself, but has two child arrays. The * first child array, called the run ends array, holds either 16, 32, or 64-bit * signed integers. The actual values of each run are held in the second child array. * * These child arrays are prescribed the standard names of "run_ends" and "values" * respectively. */ export class RunEndEncoded { free(): void; } /** * A named collection of types that defines the column names and types in a RecordBatch or Table * data structure. * * A Schema can also contain extra user-defined metadata either at the Table or Column level. * Column-level metadata is often used to define [extension * types](https://arrow.apache.org/docs/format/Columnar.html#extension-types). */ export class Schema { free(): void; /** * Export this schema to an FFISchema object, which can be read with arrow-js-ffi. * * This method **does not consume** the Schema, so you must remember to call {@linkcode * Schema.free} to release the resources. The underlying arrays are reference counted, so * this method does not copy data, it only prevents the data from being released. * @returns {FFISchema} */ toFFI(): FFISchema; /** * Export this Table to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Table, so the original Table will be * inaccessible after this call. You must still call {@linkcode FFITable.free} after * you've finished using the FFITable. * @returns {FFISchema} */ intoFFI(): FFISchema; /** * Consume this schema and convert to an Arrow IPC Stream buffer * @returns {Uint8Array} */ intoIPCStream(): Uint8Array; /** * Returns an immutable reference of a specific [`Field`] instance selected using an * offset within the internal `fields` vector. * @param {number} i * @returns {Field} */ field(i: number): Field; /** * Returns an immutable reference of a specific [`Field`] instance selected by name. * @param {string} name * @returns {Field} */ fieldWithName(name: string): Field; /** * Sets the metadata of this `Schema` to be `metadata` and returns a new object * @param {SchemaMetadata} metadata * @returns {Schema} */ withMetadata(metadata: SchemaMetadata): Schema; /** * Find the index of the column with the given name. * @param {string} name * @returns {number} */ indexOf(name: string): number; /** * Returns an immutable reference to the Map of custom metadata key-value pairs. * @returns {SchemaMetadata} */ metadata(): SchemaMetadata; } /** * An immutable buffer of separated coordinates in WebAssembly memory. */ export class SeparatedCoordBuffer { free(): void; /** * @param {Float64Array} x * @param {Float64Array} y */ constructor(x: Float64Array, y: Float64Array); } /** * A nested datatype that contains a number of sub-fields. */ export class Struct { free(): void; } /** * A Table in WebAssembly memory conforming to the Apache Arrow spec. * * A Table consists of one or more {@linkcode RecordBatch} objects plus a {@linkcode Schema} that * each RecordBatch conforms to. */ export class Table { free(): void; /** * Access a RecordBatch from the Table by index. * * @param index The positional index of the RecordBatch to retrieve. * @returns a RecordBatch or `null` if out of range. * @param {number} index * @returns {RecordBatch | undefined} */ recordBatch(index: number): RecordBatch | undefined; /** * @returns {(RecordBatch)[]} */ recordBatches(): (RecordBatch)[]; /** * Export this Table to FFI structs according to the Arrow C Data Interface. * * This method **does not consume** the Table, so you must remember to call {@linkcode * Table.free} to release the resources. The underlying arrays are reference counted, so * this method does not copy data, it only prevents the data from being released. * @returns {FFIStream} */ toFFI(): FFIStream; /** * Export this Table to FFI structs according to the Arrow C Data Interface. * * This method **does consume** the Table, so the original Table will be * inaccessible after this call. You must still call {@linkcode FFITable.free} after * you've finished using the FFITable. * @returns {FFIStream} */ intoFFI(): FFIStream; /** * Consume this table and convert to an Arrow IPC Stream buffer * @returns {Uint8Array} */ intoIPCStream(): Uint8Array; /** * Create a table from an Arrow IPC Stream buffer * @param {Uint8Array} buf * @returns {Table} */ static fromIPCStream(buf: Uint8Array): Table; /** * Returns the total number of bytes of memory occupied physically by all batches in this * table. * @returns {number} */ getArrayMemorySize(): number; /** * The number of batches in the Table */ readonly numBatches: number; /** * Access the Table's {@linkcode Schema}. */ readonly schema: Schema; } /** * A 32-bit time representing the elapsed time since midnight in the unit of `TimeUnit`. */ export class Time32 { free(): void; } /** * A 64-bit time representing the elapsed time since midnight in the unit of `TimeUnit`. */ export class Time64 { free(): void; } /** * A timestamp with an optional timezone. * * Time is measured as a Unix epoch, counting the seconds from * 00:00:00.000 on 1 January 1970, excluding leap seconds, * as a 64-bit integer. * * The time zone is a string indicating the name of a time zone, one of: * * * As used in the Olson time zone database (the "tz database" or * "tzdata"), such as "America/New_York" * * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 * * Timestamps with a non-empty timezone * ------------------------------------ * * If a Timestamp column has a non-empty timezone value, its epoch is * 1970-01-01 00:00:00 (January 1st 1970, midnight) in the *UTC* timezone * (the Unix epoch), regardless of the Timestamp's own timezone. * * Therefore, timestamp values with a non-empty timezone correspond to * physical points in time together with some additional information about * how the data was obtained and/or how to display it (the timezone). * * For example, the timestamp value 0 with the timezone string "Europe/Paris" * corresponds to "January 1st 1970, 00h00" in the UTC timezone, but the * application may prefer to display it as "January 1st 1970, 01h00" in * the Europe/Paris timezone (which is the same physical point in time). * * One consequence is that timestamp values with a non-empty timezone * can be compared and ordered directly, since they all share the same * well-known point of reference (the Unix epoch). * * Timestamps with an unset / empty timezone * ----------------------------------------- * * If a Timestamp column has no timezone value, its epoch is * 1970-01-01 00:00:00 (January 1st 1970, midnight) in an *unknown* timezone. * * Therefore, timestamp values without a timezone cannot be meaningfully * interpreted as physical points in time, but only as calendar / clock * indications ("wall clock time") in an unspecified timezone. * * For example, the timestamp value 0 with an empty timezone string * corresponds to "January 1st 1970, 00h00" in an unknown timezone: there * is not enough information to interpret it as a well-defined physical * point in time. * * One consequence is that timestamp values without a timezone cannot * be reliably compared or ordered, since they may have different points of * reference. In particular, it is *not* possible to interpret an unset * or empty timezone as the same as "UTC". * * Conversion between timezones * ---------------------------- * * If a Timestamp column has a non-empty timezone, changing the timezone * to a different non-empty value is a metadata-only operation: * the timestamp values need not change as their point of reference remains * the same (the Unix epoch). * * However, if a Timestamp column has no timezone value, changing it to a * non-empty value requires to think about the desired semantics. * One possibility is to assume that the original timestamp values are * relative to the epoch of the timezone being set; timestamp values should * then adjusted to the Unix epoch (for example, changing the timezone from * empty to "Europe/Paris" would require converting the timestamp values * from "Europe/Paris" to "UTC", which seems counter-intuitive but is * nevertheless correct). */ export class Timestamp { free(): void; } /** * An unsigned 16-bit integer. */ export class UInt16 { free(): void; } /** * An unsigned 32-bit integer. */ export class UInt32 { free(): void; } /** * An unsigned 64-bit integer. */ export class UInt64 { free(): void; } /** * An unsigned 8-bit integer. */ export class UInt8 { free(): void; } /** * A nested datatype that can represent slots of differing types. Components: * * 1. [`UnionFields`] * 2. The type of union (Sparse or Dense) */ export class Union { free(): void; } /** * A variable-length string in Unicode with UTF-8 encoding * * A single Utf8 array can store up to [`i32::MAX`] bytes * of string data in total */ export class Utf8 { free(): void; } /** */ export class Vector { free(): void; } /** *r" An immutable array of WKB-encoded geometries in WebAssembly memory using GeoArrow's *r" in-memory representation. */ export class WKBData { free(): void; /** * @param {Uint8Array} values * @param {Int32Array} offsets */ constructor(values: Uint8Array, offsets: Int32Array); /** * Convert this WKBData into a PointArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {PointData} */ intoPointArray(): PointData; /** * Convert this WKBData into a LineStringArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {LineStringData} */ intoLineStringArray(): LineStringData; /** * Convert this WKBData into a PolygonArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {PolygonData} */ intoPolygonArray(): PolygonData; /** * Convert this WKBData into a MultiPointArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {MultiPointData} */ intoMultiPointArray(): MultiPointData; /** * Convert this WKBData into a MultiLineStringArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {MultiLineStringData} */ intoMultiLineStringArray(): MultiLineStringData; /** * Convert this WKBData into a MultiPolygonArray * * ## Memory management * * This operation consumes and neuters the existing WKBData, so it will no longer be valid * and the original wkb array's memory does not need to be freed manually. * @returns {MultiPolygonData} */ intoMultiPolygonArray(): MultiPolygonData; }