import { type TypedArray } from "@babylonjs/core/types.js"; import { type AccessorComponentType, type AccessorType, type IAccessor, type IBufferView } from "babylonjs-gltf2interface"; type TypedArrayForglTF = Exclude; interface IPropertyWithBufferView { bufferView?: number; } /** * Utility class to centralize the management of binary data, bufferViews, and the objects that reference them. * @internal */ export declare class BufferManager { /** * Maps a bufferView to its data */ private _bufferViewToData; /** * Maps a bufferView to glTF objects that reference it via a "bufferView" property (e.g. accessors, images) */ private _bufferViewToProperties; /** * Maps an accessor to its bufferView */ private _accessorToBufferView; /** * Generates a binary buffer from the stored bufferViews. Also populates the bufferViews list. * @param bufferViews The list of bufferViews to be populated while writing the binary * @returns The binary buffer */ generateBinary(bufferViews: IBufferView[]): Uint8Array; /** * Creates a buffer view based on the supplied arguments * @param data a TypedArray to create the bufferView for * @param byteStride byte distance between consecutive elements * @returns bufferView for glTF */ createBufferView(data: TypedArrayForglTF, byteStride?: number): IBufferView; /** * Creates an accessor based on the supplied arguments and assigns it to the bufferView * @param bufferView The glTF bufferView referenced by this accessor * @param type The type of the accessor * @param componentType The datatype of components in the attribute * @param count The number of attributes referenced by this accessor * @param byteOffset The offset relative to the start of the bufferView in bytes * @param minMax Minimum and maximum value of each component in this attribute * @param normalized Specifies whether integer data values are normalized before usage * @returns accessor for glTF */ createAccessor(bufferView: IBufferView, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset?: number, minMax?: { min: number[]; max: number[]; }, normalized?: boolean): IAccessor; /** * Assigns a bufferView to a glTF object that references it * @param object The glTF object * @param bufferView The bufferView to assign */ setBufferView(object: IPropertyWithBufferView, bufferView: IBufferView): void; /** * Removes buffer view from the binary data, as well as from all its known references * @param bufferView the bufferView to remove */ removeBufferView(bufferView: IBufferView): void; getBufferView(accessor: IAccessor): IBufferView; getPropertiesWithBufferView(bufferView: IBufferView): IPropertyWithBufferView[]; getData(bufferView: IBufferView): TypedArrayForglTF; private _verifyBufferView; } export {};