import { Vector2, Box2, Vector3 } from 'three'; import { PatchKey } from '../utils/common_types.js'; export type PatchElement = { pos: Vector2; index: number; localPos: Vector2; data: T; }; export type PatchStub = { key?: string; id?: Vector2; bounds: Box2; margin?: number; }; /** * Generic patch struct */ export declare class PatchBase { bounds: Box2; dimensions: Vector2; margin: number; key: string; id: Vector2 | undefined; constructor(bounds?: Box2, margin?: number); get patchId(): Vector2 | undefined; get patchKey(): string; set patchKey(patchKey: string); get localBox(): Box2; init(bounds: Box2): void; get extendedBounds(): Box2; get extendedDims(): Vector2; get localExtendedBox(): Box2; inLocalRange(localPos: Vector2): boolean; inWorldRange(globalPos: Vector2): boolean; getIndex(localPos: Vector2 | Vector3): number; getLocalPosFromIndex(index: number): Vector2; toLocalPos(globalPos: Vector2): Vector2; toWorldPos(localPos: Vector2): Vector2; isOverlapping(bounds: Box2): boolean; containsPoint(pos: Vector2): boolean; /** * by default will iterrate whole patch excluding margins * @param globalBounds * @param includeMargins */ iterDataQuery(globalBounds?: Box2, includeMargins?: boolean): Generator, void, unknown>; toStub(): PatchStub; fromStub(patchStub: PatchStub): this; fromKey(patchKey: PatchKey, patchDim: Vector2, patchMargin?: number): this; } export interface DataContainer { rawData: Uint8Array | Uint16Array | Uint32Array; } export type PatchDataContainer = PatchBase & DataContainer;