export interface NativeNDArray<T = any> {
    data(): T;
    size(): number;
    ndim(): number;
    shape(): number[];
    shape_at(i: number): number;
    set_shape(shape: number[]): void;
    row(i: number): NativeNDArray<T>;
    slice(start: number, end: number): NativeNDArray<T>;
    destroy(): void;
    is_valid(): boolean;
    shared_view(): NativeNDArray<T>;
    delete(): void;
}
/**
 * A WASM-resident typed array with shape metadata.
 *
 * Data lives in the WASM heap. Views (row, slice) share the same
 * underlying buffer via reference counting.
 *
 * Iteration behavior depends on dimensionality:
 * - 1D: yields individual values (numbers)
 * - 2D: yields subarray views (rows)
 * - 3D+: yields NDArray views (sub-arrays via C++ row())
 */
export declare class NDArray<T = any> {
    /** @internal */
    readonly _handle: NativeNDArray<T>;
    /** Runtime type discriminator: "int8", "int32", "float32", or "bool". */
    readonly dtype: string;
    /** @internal */
    constructor(handle: NativeNDArray<T>, dtype: string);
    /** Typed array view into the WASM heap (Float32Array, Int32Array, or Int8Array). */
    get data(): T;
    /** Total number of elements. */
    get length(): number;
    /** Shape tuple, e.g. `[N, 3]`. Settable to reshape in-place. */
    get shape(): number[];
    /** Reshape in-place (must preserve total element count). */
    set shape(newShape: number[]);
    /** Number of dimensions. */
    get ndim(): number;
    /** Extract row `i` as a shared view (zero-copy). */
    row(i: number): NDArray<T>;
    /** Get element at index `i`. Returns a number for 1D, or a row view for nD. */
    get(i: number): number | NDArray<T>;
    /** Slice along axis 0: `[start, end)`. Returns a shared view (zero-copy). */
    slice(start: number, end?: number): NDArray<T>;
    /** Iterate over elements (1D → numbers, nD → row views). */
    [Symbol.iterator](): Iterator<number | NDArray<T>>;
    /** Cast to a different dtype. Same-storage casts (int8 ↔ bool) are zero-copy. */
    as(dtype: "float32"): NDArrayFloat32;
    as(dtype: "int32"): NDArrayInt32;
    as(dtype: "int8"): NDArrayInt8;
    as(dtype: "bool"): NDArrayBool;
    /** Sum of elements. Without axis: scalar. With axis: reduced NDArray. */
    sum(axis?: number): number | NDArray;
    /** Minimum value. Without axis: scalar. With axis: reduced NDArray. */
    min(axis?: number): number | NDArray<T>;
    /** Maximum value. Without axis: scalar. With axis: reduced NDArray. */
    max(axis?: number): number | NDArray<T>;
    /** Arithmetic mean. Without axis: scalar. With axis: reduced NDArray (float32). */
    mean(axis?: number): number | NDArray;
    /** L2 norm. Without axis: scalar. With axis: per-slice norms (float32). */
    norm(axis?: number): number | NDArray;
    /** Element-wise addition. Broadcasts. */
    add(other: NDArray | number): NDArray<T>;
    /** Element-wise subtraction. Broadcasts. */
    sub(other: NDArray | number): NDArray<T>;
    /** Element-wise multiplication. Broadcasts. */
    mul(other: NDArray | number): NDArray<T>;
    /** Element-wise division. Broadcasts. */
    div(other: NDArray | number): NDArray<T>;
    /** Element-wise remainder (truncated division). Broadcasts. */
    mod(other: NDArray | number): NDArray<T>;
    /** Matrix multiplication. Supports batch broadcasting on leading dims. */
    matMul(other: NDArray): NDArray<T>;
    /** Clamp values to `[lo, hi]`. */
    clip(lo: number, hi: number): NDArray<T>;
    /** In-place division. Broadcasts. */
    div_(other: NDArray | number): this;
    /** In-place clamp to `[lo, hi]`. */
    clip_(lo: number, hi: number): this;
    /** In-place addition. Broadcasts. */
    add_(other: NDArray | number): this;
    /** In-place subtraction. Broadcasts. */
    sub_(other: NDArray | number): this;
    /** In-place multiplication. Broadcasts. */
    mul_(other: NDArray | number): this;
    /** In-place remainder. Broadcasts. */
    mod_(other: NDArray | number): this;
    /** Element-wise equal. Broadcasts. */
    eq(other: NDArray | number): NDArrayBool;
    /** Element-wise not-equal. Broadcasts. */
    neq(other: NDArray | number): NDArrayBool;
    /** Element-wise less-than. Broadcasts. */
    lt(other: NDArray | number): NDArrayBool;
    /** Element-wise greater-than. Broadcasts. */
    gt(other: NDArray | number): NDArrayBool;
    /** Element-wise less-than-or-equal. Broadcasts. */
    lte(other: NDArray | number): NDArrayBool;
    /** Element-wise greater-than-or-equal. Broadcasts. */
    gte(other: NDArray | number): NDArrayBool;
    /** Element-wise NaN detection. Returns true where value is NaN. */
    isNaN(): NDArrayBool;
    /** Logical NOT (bool arrays only). */
    not(): NDArrayBool;
    /** Logical AND (bool arrays only). */
    and(other: NDArray): NDArrayBool;
    /** Logical OR (bool arrays only). */
    or(other: NDArray): NDArrayBool;
    /** Index of minimum value. Without axis: flat index. With axis: per-slice indices. */
    argmin(axis?: number): number | NDArrayInt32;
    /** Index of maximum value. Without axis: flat index. With axis: per-slice indices. */
    argmax(axis?: number): number | NDArrayInt32;
    /** True if any element is nonzero (bool arrays). Without axis: scalar. With axis: per-slice. */
    any(axis?: number): number | NDArrayBool;
    /** True if all elements are nonzero (bool arrays). Without axis: scalar. With axis: per-slice. */
    all(axis?: number): number | NDArrayBool;
    /**
     * Select elements by index.
     *
     * Single-axis: `take(indices, axis?)` — gather along one axis (default 0).
     *
     * Multi-axis (Cartesian): `take(spec0, spec1, ...)` where each spec is:
     * - `null` — keep whole axis
     * - `number` — single index (squeezes that dimension)
     * - `number[]` or `NDArrayInt32` — fancy index
     *
     * Unspecified trailing axes default to `null`.
     *
     * @example
     * ```ts
     * pts.take(null, 0)       // column 0: [N]
     * pts.take(null, [0, 2])  // columns 0,2: [N, 2]
     * pts.take([0, 2])        // rows 0,2: [2, 3]
     * pts.take(5)             // row 5 squeezed: [3]
     * ```
     */
    take(indices: NDArray<Int32Array>, axis?: number): NDArray<T>;
    take(...specs: (null | number | number[] | NDArray<Int32Array>)[]): NDArray<T>;
    /** Gather per-element along axis using index array (np.take_along_axis). */
    takeAlongAxis(indices: NDArray<Int32Array>, axis: number): NDArray<T>;
    /** Return sorted copy (lexicographic row sort for nD). */
    sort(): NDArray<T>;
    /** Sort in-place (lexicographic row sort for nD). */
    sort_(): this;
    /** Return int32 indices that would sort this array (lexicographic for nD). */
    argsort(): NDArrayInt32;
    /** Filter elements (1D) or rows (nD) by boolean mask. */
    booleanIndex(mask: NDArrayBool): NDArray<T>;
    /**
     * In-place assignment with broadcasting.
     *
     * - `assign(value)` — fill with scalar or broadcast array.
     * - `assign(boolMask, value)` — masked assignment (set where mask is true).
     * - `assign(int32Indices, value)` — indexed assignment (set at given row indices).
     */
    assign(value: number): this;
    assign(value: NDArray): this;
    assign(selector: NDArray | number[], value: number): this;
    assign(selector: NDArray | number[], value: NDArray): this;
    /** Transpose (reverse axes). Shorthand for `transpose()`. */
    get T(): NDArray<T>;
    /** Transpose with optional axis permutation. Without axes: reverses all dimensions. */
    transpose(axes?: number[]): NDArray<T>;
    /** Flatten to 1D. Zero-copy (shared view). */
    flatten(): NDArray<T>;
    /** Remove size-1 dimensions. If axis given, only squeeze that axis. Zero-copy. */
    squeeze(axis?: number): NDArray<T>;
    /** Insert a size-1 dimension at the given axis. Zero-copy. */
    unsqueeze(axis: number): NDArray<T>;
    /** Reshape to new dimensions (must preserve total element count). Zero-copy. */
    reshape(shape: number[]): NDArray<T>;
    /** Deep copy of this array. */
    clone(): NDArray<T>;
    /** Free WASM memory. Called automatically by GC via FinalizationRegistry. */
    delete(): void;
    /** Disposable protocol — allows `using arr = ...`. */
    [Symbol.dispose](): void;
}
/** WASM-resident int8 NDArray. */
export type NDArrayInt8 = NDArray<Int8Array>;
/** WASM-resident int32 NDArray. */
export type NDArrayInt32 = NDArray<Int32Array>;
/** WASM-resident float32 NDArray. */
export type NDArrayFloat32 = NDArray<Float32Array>;
/** WASM-resident boolean NDArray (int8 storage, 0/1 values). */
export type NDArrayBool = NDArray<Int8Array>;
//# sourceMappingURL=NDArray.d.ts.map