/**
 * Zero-copy buffer utilities for converting protobuf bytes to Three.js typed arrays.
 *
 * Proto messages pack float32 data as `Uint8Array` (bytes fields). These utilities
 * provide efficient conversion to `Float32Array` for Three.js BufferAttributes.
 */
import { Color } from 'three';
/**
 * Stride constants for proto binary data formats.
 * Each value represents the number of float32 elements per item.
 */
export declare const STRIDE: {
    /** Arrows: [x, y, z, ox, oy, oz] per arrow */
    readonly ARROWS: 6;
    /** Line/Points: [x, y, z] per point */
    readonly POSITIONS: 3;
    /** Nurbs control points: [x, y, z, ox, oy, oz, theta] per point */
    readonly NURBS_CONTROL_POINTS: 7;
    /** Nurbs knots/weights: single float per element */
    readonly NURBS_KNOTS: 1;
    /** Colors: [r, g, b, a] per color (uint8) */
    readonly COLORS_RGBA: 4;
    /** Colors: [r, g, b] */
    readonly COLORS_RGB: 3;
};
/**
 * Creates a Float32Array view over a Uint8Array without copying data.
 * Falls back to a copy if the buffer is not 4-byte aligned (rare with protobuf).
 *
 * @param bytes - The raw bytes from a protobuf bytes field
 * @returns A Float32Array view or copy of the data
 *
 * @example
 * ```ts
 * const positions = asFloat32Array(line.positions)
 * geometry.setAttribute('position', new BufferAttribute(positions, 3))
 * ```
 */
export declare const asFloat32Array: (bytes: Uint8Array<ArrayBuffer>) => Float32Array<ArrayBuffer>;
/**
 * Sets a Three.js Color from 3 bytes of a uint8 color array starting at `offset`.
 * Mutates and returns `target` — pass a pre-allocated Color to avoid allocations
 * in hot paths.
 *
 * @param bytes - Uint8Array with at least `offset + 3` elements [r, g, b, ...]
 * @param target - Color instance to write into
 * @param offset - Byte offset to start reading from (default 0)
 * @returns The mutated `target`, or black if the array has fewer than `offset + 3` elements
 *
 * @example
 * ```ts
 * asColor(colors.current, material.color)
 * asColor(colors.current, pointColorUtil, stride) // read second color
 * ```
 */
export declare const asColor: (bytes: Uint8Array<ArrayBuffer>, target: Color, offset?: number) => Color;
/**
 * Creates a Uint8Array from a Three.js Color.
 *
 * @param color - The Three.js Color to convert
 * @returns A Uint8Array with the RGBA values
 *
 * @example
 * ```ts
 * const color = fromColor(new Color(0, 1, 0))
 * ```
 */
export declare const fromColor: (color: Color) => Uint8Array<ArrayBuffer>;
/**
 * Reads a byte from a uint8 color array at `offset` and normalizes it to 0-1.
 * Returns `fallback` when the array has fewer than `offset + 1` elements.
 *
 * @param bytes - ArrayLike of uint8 color values
 * @param fallback - Value to return when no alpha byte is present (default 1)
 * @param offset - Byte index to read from (default 3, the alpha channel of the first color)
 * @returns Normalized opacity in 0-1 range, or the fallback value
 *
 * @example
 * ```ts
 * material.opacity = asOpacity(colors.current)
 * material.opacity = asOpacity(colors.current, 1, stride + 3) // alpha of second color
 * ```
 */
export declare const asOpacity: (bytes: Uint8Array<ArrayBuffer>, fallback?: number, offset?: number) => number;
/**
 * Returns true when `colors` contains exactly one color entry per point (RGB or RGBA).
 * Use this to distinguish per-vertex color buffers from a single uniform color.
 *
 * @param colors - Uint8Array of packed color bytes
 * @param numVertex - Number of points/vertices the color buffer should cover
 *
 * @example
 * ```ts
 * if (isPerVertexColors(colors, positions.length / STRIDE.POSITIONS)) {
 *   // treat as per-vertex
 * } else {
 *   addColorTraits(entityTraits, colors)
 * }
 * ```
 */
export declare const isPerVertexColors: (colors: Uint8Array<ArrayBuffer>, numVertex: number) => boolean;
