import * as THREE from "three"; import { CBTextureType } from "./CBTypes"; import { CanvasContext } from "react-three-fiber"; export declare enum CBTextureLoadErrorReason { None = "none", Aborted = "aborted", Timeout = "timeout", InvalidUrl = "invalid-url" } export declare function getGlobalCanvas(label: string): HTMLCanvasElement; export declare function destroyAllCanvases(): void; export declare function nearestPowerOf2(n: number): number; export declare class CBTextureLoader { context: CanvasContext; textureLoader: THREE.TextureLoader; imageLoader: THREE.ImageLoader; image?: HTMLImageElement | null; constructor(context: CanvasContext); private _aborted; abort(): void; load(type: CBTextureType, url: string, canvas: HTMLCanvasElement | null, onLoad?: (texture: THREE.Texture, width: number, height: number) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: CBTextureLoadError) => void): void; dispose(): void; } export declare class CBTextureLoadError extends Error { type: CBTextureType; path: string; reason: CBTextureLoadErrorReason; constructor(type: CBTextureType, path: string, _reason?: CBTextureLoadErrorReason, message?: string); }