import { NativeNDArray, NDArrayInt32, NDArrayFloat32 } from "../ndarray/NDArray";
import { OffsetBlockedBuffer } from "../ndarray/OffsetBlockedBuffer";
interface NativeOffsetBlockedIntBuffer {
    offsets(): NativeNDArray<Int32Array>;
    data(): NativeNDArray<Int32Array>;
    size(): number;
    get(i: number): NativeNDArray<Int32Array>;
    destroy(): void;
    is_valid(): boolean;
    delete(): void;
}
interface NativeMesh {
    faces(): NativeNDArray<Int32Array>;
    points(): NativeNDArray<Float32Array>;
    number_of_faces(): number;
    number_of_points(): number;
    set_faces(faces: NativeNDArray<Int32Array>): void;
    set_points(points: NativeNDArray<Float32Array>): void;
    shared_view(): NativeMesh;
    has_transformation(): boolean;
    transformation(): NativeNDArray<Float32Array>;
    set_transformation(t: NativeNDArray<Float32Array>): void;
    clear_transformation(): void;
    face_membership(): NativeOffsetBlockedIntBuffer;
    manifold_edge_link(): NativeNDArray<Int32Array>;
    face_link(): NativeOffsetBlockedIntBuffer;
    vertex_link(): NativeOffsetBlockedIntBuffer;
    set_face_membership(fm: NativeOffsetBlockedIntBuffer): void;
    set_vertex_link(vl: NativeOffsetBlockedIntBuffer): void;
    set_face_link(fl: NativeOffsetBlockedIntBuffer): void;
    set_manifold_edge_link(mel: NativeNDArray<Int32Array>): void;
    normals(): NativeNDArray<Float32Array>;
    point_normals(): NativeNDArray<Float32Array>;
    set_normals(n: NativeNDArray<Float32Array>): void;
    set_point_normals(pn: NativeNDArray<Float32Array>): void;
    ensure_tree(): void;
    destroy(): void;
    is_valid(): boolean;
    delete(): void;
}
/**
 * A WASM-resident triangle mesh with lazy topology structures.
 *
 * Holds flat face indices [F*3] and point coordinates [V*3] in the WASM heap.
 * Topology structures (faceMembership, faceLink, vertexLink, manifoldEdgeLink)
 * are built lazily on first access and cached. Mutating faces/points via
 * Setting faces/points invalidates stale caches.
 *
 * sharedView() creates a cheap copy that shares all data and caches.
 * Each accessor returns an independent handle safe against manual .delete().
 */
export declare class Mesh {
    /** @internal */
    readonly _handle: NativeMesh;
    /** @internal */
    constructor(handle: NativeMesh);
    /** Face indices as NDArrayInt32 [F, 3]. */
    get faces(): NDArrayInt32;
    /** Replace face indices. Accepts NDArray or Int32Array. Invalidates topology caches. */
    set faces(f: NDArrayInt32 | Int32Array);
    /** Vertex coordinates as NDArrayFloat32 [V, 3]. */
    get points(): NDArrayFloat32;
    /** Replace vertex coordinates. Accepts NDArray or Float32Array. */
    set points(p: NDArrayFloat32 | Float32Array);
    /** Number of triangular faces. */
    get numberOfFaces(): number;
    /** Number of vertices. */
    get numberOfPoints(): number;
    /** 4x4 transformation matrix as NDArrayFloat32 [4,4], or null if none. */
    get transformation(): NDArrayFloat32 | null;
    /** Set a 4x4 transformation matrix, or null to clear. */
    set transformation(t: NDArrayFloat32 | Float32Array | null);
    /**
     * Creates a shared view — cheap copy sharing all data and caches.
     * Transformation is not shared (the view has no transformation).
     */
    sharedView(): Mesh;
    /**
     * Per-vertex face membership: vertex i belongs to faces in block i.
     * Ranges are sorted in descending order.
     */
    get faceMembership(): OffsetBlockedBuffer;
    /** Set precomputed face membership (bypasses lazy computation). */
    set faceMembership(fm: OffsetBlockedBuffer);
    /**
     * Per-face neighbor faces via shared manifold edges, as NDArrayInt32 [F, 3].
     *
     * Sentinel values:
     * - `>= 0`: neighbor face index (simple manifold edge)
     * - `-1`: boundary edge (edge belongs to only one face)
     * - `-2`: non-manifold edge (3+ faces share this edge)
     * - `-3`: non-manifold representative edge
     */
    get manifoldEdgeLink(): NDArrayInt32;
    /** Set precomputed manifold edge link (bypasses lazy computation). */
    set manifoldEdgeLink(mel: NDArrayInt32);
    /** Per-face adjacent faces (faces sharing at least one vertex). */
    get faceLink(): OffsetBlockedBuffer;
    /** Set precomputed face link (bypasses lazy computation). */
    set faceLink(fl: OffsetBlockedBuffer);
    /** Per-vertex adjacent vertices (connected by an edge). */
    get vertexLink(): OffsetBlockedBuffer;
    /** Set precomputed vertex link (bypasses lazy computation). */
    set vertexLink(vl: OffsetBlockedBuffer);
    /** Face normals as NDArrayFloat32 [F, 3]. Lazily computed and cached. */
    get normals(): NDArrayFloat32;
    /** Set precomputed face normals (bypasses lazy computation). */
    set normals(n: NDArrayFloat32);
    /** Vertex normals as NDArrayFloat32 [V, 3]. Lazily computed and cached. */
    get pointNormals(): NDArrayFloat32;
    /** Set precomputed vertex normals (bypasses lazy computation). */
    set pointNormals(pn: NDArrayFloat32);
    /** Pre-build the spatial AABB tree. No-op if already built and up-to-date. */
    buildTree(): void;
    delete(): void;
    [Symbol.dispose](): void;
}
export {};
//# sourceMappingURL=Mesh.d.ts.map