minerender 2.1.0-alpha.17 → 2.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,5 +22,3 @@ renderer.start();
22
22
  The package provides ESM and CommonJS entries for browsers and Node.js, plus
23
23
  `dist/bundle.js` for the `MineRender` browser global. Node imports require the optional
24
24
  native `canvas` dependency; headless rendering is still in development.
25
-
26
- Requires Node.js 22+ or a browser with Fetch, `AbortSignal.any()`, and `AbortSignal.timeout()`.
@@ -1,11 +1,14 @@
1
1
  import * as three from 'three';
2
- import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
2
+ import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Texture, Camera, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, BufferGeometry as BufferGeometry$1, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points, MOUSE, TOUCH } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
+ import { AxiosResponse, AxiosRequestConfig } from 'axios';
5
6
  import { Buffer as Buffer$1 } from 'buffer';
6
7
  import { NBT } from 'prismarine-nbt';
7
8
  import { ZipReader } from '@zip.js/zip.js';
8
9
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
10
+ import { BufferGeometry } from 'three/src/core/BufferGeometry';
11
+ import { Material as Material$1 } from 'three/src/materials/Material';
9
12
  import Stats from 'stats.js';
10
13
  import { EffectComposer } from 'postprocessing';
11
14
 
@@ -14,7 +17,7 @@ interface AnimatorFunction {
14
17
  }
15
18
 
16
19
  declare enum Axis {
17
- X = "x",
20
+ X = "X",
18
21
  Y = "y",
19
22
  Z = "z"
20
23
  }
@@ -59,11 +62,10 @@ declare function createCanvas(width: number, height: number): CompatCanvas;
59
62
  declare abstract class PersistentCache<B = unknown> {
60
63
  readonly backing: B;
61
64
  /** Bump to invalidate every persisted entry. */
62
- static readonly VERSION = 2;
65
+ static readonly VERSION = 1;
63
66
  static open(name: string): PersistentCache;
64
67
  protected constructor(backing: B);
65
68
  abstract get<T>(key: string): Promise<T>;
66
- /** Loads a missing entry and stores only non-nullish results. */
67
69
  getOrLoad<T>(key: string, loader: (key: string) => Promise<T>): Promise<T>;
68
70
  abstract put<T>(key: string, value: T): Promise<T>;
69
71
  abstract delete<T>(key: string): Promise<void>;
@@ -254,46 +256,6 @@ declare enum GuiLight {
254
256
  SIDE = "side"
255
257
  }
256
258
 
257
- interface RequestConfig extends RequestInit {
258
- url: string;
259
- /** Prepended to relative URLs, preserving any path in the base URL. */
260
- baseURL?: string;
261
- /** Timeout per attempt in milliseconds, including body reading. Defaults to 5000; 0 disables it. */
262
- timeout?: number;
263
- responseType?: "json" | "arraybuffer";
264
- }
265
- interface RequestResponse<T = any> {
266
- data: T;
267
- status: number;
268
- statusText: string;
269
- headers: Headers;
270
- /** Final URL after redirects. */
271
- url: string;
272
- }
273
- declare class RequestError extends Error {
274
- readonly response?: RequestResponse<undefined> | undefined;
275
- readonly cause?: unknown;
276
- constructor(message: string, response?: RequestResponse<undefined> | undefined, cause?: unknown);
277
- }
278
- declare class Requests {
279
- private static genericQueue;
280
- private static mcAssetRequestQueue;
281
- static genericRequest(request: RequestConfig): Promise<RequestResponse>;
282
- static mcAssetRequest(request: RequestConfig): Promise<RequestResponse>;
283
- static setMcAssetRoot(root: string): void;
284
- /** Counts unsettled calls, including retry delays and requests still running after shutdown. */
285
- static get queueSizes(): {
286
- generic: number;
287
- mcAsset: number;
288
- };
289
- /**
290
- * Permanently stops both queues and rejects waiting, retrying, and future requests.
291
- * Requests already running can finish. Idle queues hold no timer, so Node can exit without
292
- * this cleanup. See {@link shutdown}.
293
- */
294
- static end(): void;
295
- }
296
-
297
259
  declare class WrappedImage {
298
260
  readonly dta: ExtractableImageData;
299
261
  constructor(dta: ExtractableImageData);
@@ -329,7 +291,7 @@ declare class ImageLoader {
329
291
  static infoToData(info: ImageInfo): Promise<ImageData>;
330
292
  static getData(src: string): Promise<ImageData>;
331
293
  static getCanvasData(src: string): Promise<ExtractableImageData>;
332
- static processResponse(response: Pick<RequestResponse<ArrayBuffer>, "data" | "url">): Promise<ImageInfo>;
294
+ static processResponse(response: Partial<AxiosResponse>): Promise<ImageInfo>;
333
295
  static loadInfo(src: string): Promise<ImageInfo>;
334
296
  static getInfo(src: string): Promise<ImageInfo>;
335
297
  static loadWrapped(src: string): Promise<WrappedImage>;
@@ -469,7 +431,7 @@ interface Transformable {
469
431
  declare function isTransformable(obj: any): obj is Transformable;
470
432
 
471
433
  declare const changeEvent: {
472
- type: "change";
434
+ type: string;
473
435
  };
474
436
  type Maybe<T> = T | undefined;
475
437
  declare function md5(str: string): string;
@@ -574,13 +536,14 @@ declare class MinecraftFaceUV {
574
536
  }
575
537
 
576
538
  /**
577
- * Stops the shared Ticker and request queues, and clears the in-memory caches.
539
+ * Releases every long-lived timer MineRender holds, so a Node process can exit.
578
540
  *
579
- * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
580
- * and idle request queues hold no timer. Pending requests keep their normal timer references.
541
+ * Both `@inventivetalent/loading-cache` (cache expiry) and `jobqu` (request queue draining) use
542
+ * self-rescheduling timers that are not unref'd, which keeps the event loop alive for as long as
543
+ * the library is loaded. Browsers don't care, but anything headless - a render server, a CLI, a
544
+ * test run - has to call this when it's done.
581
545
  *
582
- * Call this only when finished with MineRender. Queued, retrying, and future requests reject;
583
- * HTTP requests already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
546
+ * The library stays usable afterwards; the caches and queues simply start over.
584
547
  */
585
548
  declare function shutdown(): void;
586
549
 
@@ -653,14 +616,6 @@ declare abstract class AssetSource {
653
616
  protected constructor();
654
617
  abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
655
618
  }
656
- /** A source failed to load or parse an asset; cause retains the original failure. */
657
- declare class AssetLoadError extends Error {
658
- readonly source: AssetSource;
659
- readonly key: AssetKey;
660
- readonly path: string;
661
- readonly cause: unknown;
662
- constructor(source: AssetSource, key: AssetKey, path: string, cause: unknown);
663
- }
664
619
 
665
620
  declare class AssetLoader {
666
621
  static ROOT: string;
@@ -668,13 +623,7 @@ declare class AssetLoader {
668
623
  static addSource(key: string, source: AssetSource, override?: boolean): void;
669
624
  static removeSource(key: string): Maybe<AssetSource>;
670
625
  static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
671
- /** Returns the first defined result in source-priority order, without merging assets. */
672
626
  static get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
673
- /** Tries each path within a source before considering lower-priority sources. */
674
- static getFirst<T extends MinecraftAsset>(keys: readonly AssetKey[], parser: AssetParser | string): Promise<Maybe<{
675
- key: AssetKey;
676
- asset: T;
677
- }>>;
678
627
  }
679
628
 
680
629
  interface BlockState extends MinecraftAsset {
@@ -689,19 +638,18 @@ interface BlockStateVariant {
689
638
  y?: number;
690
639
  x?: number;
691
640
  uvlock?: boolean;
692
- weight?: number;
693
641
  }
694
642
  interface BlockStateMultipart {
695
- when?: MultipartCondition;
696
- apply?: BlockStateVariant | BlockStateVariant[];
643
+ when?: MultipartCondition | {
644
+ OR: MultipartCondition[];
645
+ };
646
+ apply?: BlockStateVariant;
647
+ }
648
+ interface MultipartCondition {
649
+ [key: string]: string;
697
650
  }
698
- type MultipartCondition = Record<string, string> | {
699
- OR: MultipartCondition[];
700
- } | {
701
- AND: MultipartCondition[];
702
- };
703
651
 
704
- declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.21.11";
652
+ declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.17.1";
705
653
  declare const DEFAULT_NAMESPACE = "minecraft";
706
654
  declare class Assets {
707
655
  /**
@@ -766,8 +714,6 @@ declare class Models {
766
714
  private static get PERSISTENT_CACHE();
767
715
  static getItemList(): Promise<string[]>;
768
716
  static loadAndMerge(key: AssetKey): Promise<Maybe<Model>>;
769
- private static getItemModel;
770
- private static defaultItemModel;
771
717
  static getRaw(key: AssetKey): Promise<Maybe<Model>>;
772
718
  static getMerged(key: AssetKey): Promise<Maybe<Model>>;
773
719
  static get(key: AssetKey): Promise<Maybe<Model>>;
@@ -908,7 +854,6 @@ declare class EntityObject extends SceneObject {
908
854
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
909
855
  init(): Promise<void>;
910
856
  dispose(): void;
911
- private get textureKey();
912
857
  protected loadTextures(): Promise<void>;
913
858
  protected createMeshes(force?: boolean): void;
914
859
  protected applyTextures(): Promise<void>;
@@ -941,9 +886,7 @@ interface MineRenderSceneOptions {
941
886
  }
942
887
  declare function isMineRenderScene(obj: any): obj is MineRenderScene;
943
888
 
944
- declare class SceneObject extends Object3D<Object3DEventMap & {
945
- change: {};
946
- }> implements Disposable, Instanceable, Transformable {
889
+ declare class SceneObject extends Object3D implements Disposable, Instanceable, Transformable {
947
890
  readonly isSceneObject: true;
948
891
  static readonly DEFAULT_OPTIONS: SceneObjectOptions;
949
892
  readonly options: SceneObjectOptions;
@@ -969,9 +912,9 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
969
912
  */
970
913
  toggleGroupVisibility(name: string, visible?: boolean): boolean;
971
914
  protected addOrReplaceMesh(mesh: Mesh, parent: Object3D, name?: string): void;
972
- protected createAndAddMesh(name?: string, group?: Object3D, geometry?: BufferGeometry, material?: Material | Material[], offsetAxis?: Axis, offset?: number): Mesh;
973
- protected createMesh(name?: string, geometry?: BufferGeometry, material?: Material | Material[], offsetAxis?: Axis, offset?: number): Mesh;
974
- protected createInstancedMesh(name: Maybe<string>, geometry: BufferGeometry, material: Material | Material[], count: number): InstancedMesh;
915
+ protected createAndAddMesh(name?: string, group?: Object3D, geometry?: BufferGeometry, material?: Material$1 | Material$1[], offsetAxis?: Axis, offset?: number): Mesh;
916
+ protected createMesh(name?: string, geometry?: BufferGeometry, material?: Material$1 | Material$1[], offsetAxis?: Axis, offset?: number): Mesh;
917
+ protected createInstancedMesh(name: Maybe<string>, geometry: BufferGeometry, material: Material$1 | Material$1[], count: number): InstancedMesh;
975
918
  /**
976
919
  * Get a mesh by its name
977
920
  */
@@ -1140,8 +1083,8 @@ interface NBTAsset extends MinecraftAsset, NBT {
1140
1083
  }
1141
1084
 
1142
1085
  interface ResponseParser<T extends MinecraftAsset> {
1143
- config(request: RequestConfig): any;
1144
- parse(response: RequestResponse): Maybe<T> | Promise<Maybe<T>>;
1086
+ config(request: AxiosRequestConfig): any;
1087
+ parse(response: AxiosResponse): Maybe<T> | Promise<Maybe<T>>;
1145
1088
  }
1146
1089
 
1147
1090
  declare class HostedAssetSource extends AssetSource {
@@ -1269,18 +1212,14 @@ declare class Caching {
1269
1212
  static readonly mergedModelCache: AsyncLoadingCache<CacheKey, Model>;
1270
1213
  static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
1271
1214
  static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
1272
- static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
1273
- static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
1274
- static readonly entityModelsCache: AsyncLoadingCache<CacheKey, EntityModels>;
1275
- private static createAssetCache;
1276
1215
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1277
1216
  private static get all();
1278
1217
  static clear(): void;
1279
1218
  /**
1280
1219
  * Clears every cache and stops its expiry timer.
1281
1220
  *
1282
- * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
1283
- * Use {@link shutdown} to also stop requests and the shared Ticker.
1221
+ * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
1222
+ * this is called - see {@link shutdown}.
1284
1223
  */
1285
1224
  static end(): void;
1286
1225
  static get cacheSizes(): {};
@@ -1296,83 +1235,6 @@ declare class GuiObject extends SceneObject {
1296
1235
  interface GuiObjectOptions extends SceneObjectOptions {
1297
1236
  }
1298
1237
 
1299
- declare class OrbitControls {
1300
- constructor(object: Camera, domElement?: HTMLElement);
1301
-
1302
- object: Camera;
1303
- domElement: HTMLElement | HTMLDocument;
1304
-
1305
- // API
1306
- enabled: boolean;
1307
- target: Vector3;
1308
-
1309
- // deprecated
1310
- center: Vector3;
1311
-
1312
- minDistance: number;
1313
- maxDistance: number;
1314
-
1315
- minZoom: number;
1316
- maxZoom: number;
1317
-
1318
- minPolarAngle: number;
1319
- maxPolarAngle: number;
1320
-
1321
- minAzimuthAngle: number;
1322
- maxAzimuthAngle: number;
1323
-
1324
- enableDamping: boolean;
1325
- dampingFactor: number;
1326
-
1327
- enableZoom: boolean;
1328
- zoomSpeed: number;
1329
-
1330
- enableRotate: boolean;
1331
- rotateSpeed: number;
1332
-
1333
- enablePan: boolean;
1334
- panSpeed: number;
1335
- screenSpacePanning: boolean;
1336
- keyPanSpeed: number;
1337
-
1338
- autoRotate: boolean;
1339
- autoRotateSpeed: number;
1340
-
1341
- enableKeys: boolean;
1342
- keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
1343
- mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
1344
- touches: { ONE: TOUCH; TWO: TOUCH };
1345
-
1346
- update(): boolean;
1347
-
1348
- listenToKeyEvents(domElement: HTMLElement): void;
1349
-
1350
- saveState(): void;
1351
-
1352
- reset(): void;
1353
-
1354
- dispose(): void;
1355
-
1356
- getPolarAngle(): number;
1357
-
1358
- getAzimuthalAngle(): number;
1359
-
1360
- getDistance(): number;
1361
-
1362
- // EventDispatcher mixins
1363
- addEventListener(type: string, listener: (event: any) => void): void;
1364
-
1365
- hasEventListener(type: string, listener: (event: any) => void): boolean;
1366
-
1367
- removeEventListener(type: string, listener: (event: any) => void): void;
1368
-
1369
- dispatchEvent(event: { type: string; target: any }): void;
1370
- }
1371
-
1372
- declare class MapControls extends OrbitControls {
1373
- constructor(object: Camera, domElement?: HTMLElement);
1374
- }
1375
-
1376
1238
  declare class Renderer implements Disposable {
1377
1239
  static readonly DEFAULT_OPTIONS: RendererOptions;
1378
1240
  readonly options: RendererOptions;
@@ -1380,14 +1242,14 @@ declare class Renderer implements Disposable {
1380
1242
  protected _scene: MineRenderScene;
1381
1243
  protected _camera: Camera;
1382
1244
  protected _renderer: WebGLRenderer;
1383
- protected _composer?: EffectComposer;
1384
- protected _controls?: OrbitControls;
1245
+ protected _composer: EffectComposer;
1385
1246
  protected _stats?: Stats;
1386
1247
  protected _dirty: boolean;
1387
1248
  protected _animationLoop: any;
1388
- protected _frameInterval?: number;
1249
+ protected _fpsTimer: any;
1250
+ protected _animationTimer?: NodeJS.Timeout;
1251
+ protected _animationFrame?: number;
1389
1252
  protected _resizeListener?: () => void;
1390
- private _nextFrameTime?;
1391
1253
  private _disposed;
1392
1254
  private readonly _debugHelpers;
1393
1255
  private readonly _eventDispatchers;
@@ -1396,8 +1258,7 @@ declare class Renderer implements Disposable {
1396
1258
  protected createScene(): MineRenderScene;
1397
1259
  protected createCamera(): Camera;
1398
1260
  protected createRenderer(): WebGLRenderer;
1399
- protected createComposer(): Maybe<EffectComposer>;
1400
- protected createControls(): Maybe<OrbitControls>;
1261
+ protected createComposer(): EffectComposer;
1401
1262
  init(): void;
1402
1263
  get element(): Maybe<HTMLElement>;
1403
1264
  appendTo(element: HTMLElement): void;
@@ -1405,7 +1266,7 @@ declare class Renderer implements Disposable {
1405
1266
  * Redraws when the dispatcher emits the selected event. Registering the same pair twice has no effect.
1406
1267
  * The renderer removes its listener on disposal; the caller retains ownership of the dispatcher.
1407
1268
  */
1408
- registerEventDispatcher(dispatcher: EventDispatcher<any>, changeEvent?: string): void;
1269
+ registerEventDispatcher(dispatcher: EventDispatcher, changeEvent?: string): void;
1409
1270
  resize(width: number, height: number): void;
1410
1271
  get dirty(): boolean;
1411
1272
  set dirty(dirty: boolean);
@@ -1425,15 +1286,12 @@ declare class Renderer implements Disposable {
1425
1286
  get scene(): MineRenderScene;
1426
1287
  get camera(): Camera;
1427
1288
  get renderer(): WebGLRenderer;
1428
- get composer(): Maybe<EffectComposer>;
1429
- /** Renderer-owned controls, or undefined when disabled at construction or after disposal. */
1430
- get controls(): Maybe<OrbitControls>;
1289
+ get composer(): EffectComposer;
1431
1290
  }
1432
1291
  interface RendererOptions {
1433
1292
  camera: CameraOptions;
1434
1293
  render: RenderOptions;
1435
1294
  composer: ComposerOptions;
1436
- controls?: ControlsOptions;
1437
1295
  debug: DebugOptions;
1438
1296
  }
1439
1297
  interface CameraOptions {
@@ -1454,7 +1312,6 @@ interface CameraOptions {
1454
1312
  lookingAt: Vector3 | TripleArray;
1455
1313
  }
1456
1314
  interface RenderOptions {
1457
- /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1458
1315
  fpsLimit: number;
1459
1316
  stats: boolean;
1460
1317
  antialias: boolean;
@@ -1465,9 +1322,6 @@ interface RenderOptions {
1465
1322
  interface ComposerOptions {
1466
1323
  enabled: boolean;
1467
1324
  }
1468
- interface ControlsOptions {
1469
- enabled: boolean;
1470
- }
1471
1325
  interface DebugOptions {
1472
1326
  grid: boolean;
1473
1327
  axes: boolean;
@@ -1482,7 +1336,7 @@ declare class SceneInspector {
1482
1336
  private selectedObject?;
1483
1337
  constructor(renderer: Renderer);
1484
1338
  protected init(): void;
1485
- findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
1339
+ findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry, three.Material | three.Material[]>[];
1486
1340
  onClick(event: any): void;
1487
1341
  appendTo(el: HTMLElement): void;
1488
1342
  protected handleRaycasterObjects(intersections: Intersection[]): void;
@@ -1519,6 +1373,26 @@ declare class StatLine {
1519
1373
  update(): void;
1520
1374
  }
1521
1375
 
1376
+ declare class Requests {
1377
+ private static axiosInstance;
1378
+ private static mcAssetInstance;
1379
+ private static genericQueue;
1380
+ private static mcAssetRequestQueue;
1381
+ static genericRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1382
+ static mcAssetRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1383
+ private static shouldRetry;
1384
+ static setMcAssetRoot(root: string): void;
1385
+ static get queueSizes(): {
1386
+ generic: number;
1387
+ mcAsset: number;
1388
+ };
1389
+ /**
1390
+ * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
1391
+ * exit until this is called - see {@link shutdown}.
1392
+ */
1393
+ static end(): void;
1394
+ }
1395
+
1522
1396
  type SkinGeometries = Record<SkinPart, TripleArray>;
1523
1397
  declare const classicSkinGeometries: SkinGeometries;
1524
1398
  declare const slimSkinGeometries: SkinGeometries;
@@ -1551,9 +1425,6 @@ declare class Skins {
1551
1425
  }
1552
1426
 
1553
1427
  declare class TextureLoader {
1554
- private static readonly failedTextures;
1555
- /** Reports whether image loading failed, so cached textures can be retried. */
1556
- static hasFailed(texture: Texture): boolean;
1557
1428
  protected static createTexture(): Texture;
1558
1429
  static loadInBackground(src: string, format?: PixelFormat, rotation?: number): Texture;
1559
1430
  static load(src: string, format?: PixelFormat, rotation?: number): Texture;
@@ -1567,14 +1438,91 @@ declare class Textures {
1567
1438
  static getImage(key: TextureKey): Texture;
1568
1439
  }
1569
1440
 
1570
- declare function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
1441
+ declare function mergeBufferGeometries(geometries: BufferGeometry$1[], useGroups?: boolean): BufferGeometry$1;
1571
1442
  declare function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
1572
1443
  declare function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute;
1573
- declare function estimateBytesUsed(geometry: BufferGeometry): number;
1574
- declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): BufferGeometry;
1575
- declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1444
+ declare function estimateBytesUsed(geometry: BufferGeometry$1): number;
1445
+ declare function mergeVertices(geometry: BufferGeometry$1, tolerance?: number): BufferGeometry$1;
1446
+ declare function toTrianglesDrawMode(geometry: BufferGeometry$1, drawMode: TrianglesDrawModes): BufferGeometry$1;
1576
1447
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1577
1448
 
1449
+ declare class OrbitControls {
1450
+ constructor(object: Camera, domElement?: HTMLElement);
1451
+
1452
+ object: Camera;
1453
+ domElement: HTMLElement | HTMLDocument;
1454
+
1455
+ // API
1456
+ enabled: boolean;
1457
+ target: Vector3;
1458
+
1459
+ // deprecated
1460
+ center: Vector3;
1461
+
1462
+ minDistance: number;
1463
+ maxDistance: number;
1464
+
1465
+ minZoom: number;
1466
+ maxZoom: number;
1467
+
1468
+ minPolarAngle: number;
1469
+ maxPolarAngle: number;
1470
+
1471
+ minAzimuthAngle: number;
1472
+ maxAzimuthAngle: number;
1473
+
1474
+ enableDamping: boolean;
1475
+ dampingFactor: number;
1476
+
1477
+ enableZoom: boolean;
1478
+ zoomSpeed: number;
1479
+
1480
+ enableRotate: boolean;
1481
+ rotateSpeed: number;
1482
+
1483
+ enablePan: boolean;
1484
+ panSpeed: number;
1485
+ screenSpacePanning: boolean;
1486
+ keyPanSpeed: number;
1487
+
1488
+ autoRotate: boolean;
1489
+ autoRotateSpeed: number;
1490
+
1491
+ enableKeys: boolean;
1492
+ keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
1493
+ mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
1494
+ touches: { ONE: TOUCH; TWO: TOUCH };
1495
+
1496
+ update(): boolean;
1497
+
1498
+ listenToKeyEvents(domElement: HTMLElement): void;
1499
+
1500
+ saveState(): void;
1501
+
1502
+ reset(): void;
1503
+
1504
+ dispose(): void;
1505
+
1506
+ getPolarAngle(): number;
1507
+
1508
+ getAzimuthalAngle(): number;
1509
+
1510
+ getDistance(): number;
1511
+
1512
+ // EventDispatcher mixins
1513
+ addEventListener(type: string, listener: (event: any) => void): void;
1514
+
1515
+ hasEventListener(type: string, listener: (event: any) => void): boolean;
1516
+
1517
+ removeEventListener(type: string, listener: (event: any) => void): void;
1518
+
1519
+ dispatchEvent(event: { type: string; target: any }): void;
1520
+ }
1521
+
1522
+ declare class MapControls extends OrbitControls {
1523
+ constructor(object: Camera, domElement?: HTMLElement);
1524
+ }
1525
+
1578
1526
  interface BlockInfo {
1579
1527
  block: Block;
1580
1528
  object: BlockObject;
@@ -1663,8 +1611,8 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
1663
1611
  *
1664
1612
  * `image-size` pulls in `fs`/`path` at module scope, so it can only live in the Node build.
1665
1613
  * Everything MineRender loads is a PNG in practice; GIF and JPEG are handled as a courtesy and
1666
- * anything else falls through to an empty result, which ImageLoader rejects.
1614
+ * anything else falls through to an empty result (callers treat that as 0x0).
1667
1615
  */
1668
1616
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
1669
1617
 
1670
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1618
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };