import { InstancedEntity } from "../InstancedEntity";
/**
 * Represents an extended entity type with custom data.
 */
export type Entity<T> = InstancedEntity & T;
/**
 * A callback function used to update or initialize an entity.
 */
export type UpdateEntityCallback<T = InstancedEntity> = (obj: Entity<T>, index: number) => void;
declare module "../InstancedMesh2" {
    interface InstancedMesh2<TData = {}> {
        /**
         * Updates instances by applying a callback function to each instance. It calls `updateMatrix` for each instance.
         * @param onUpdate A callback function to update each entity.
         * @returns The current `InstancedMesh2` instance.
         */
        updateInstances(onUpdate: UpdateEntityCallback<Entity<TData>>): this;
        /**
         * Updates instances position by applying a callback function to each instance. It calls `updateMatrixPosition` for each instance.
         * This method updates only the position attributes of the matrix.
         * @param onUpdate A callback function to update each entity.
         * @returns The current `InstancedMesh2` instance.
         */
        updateInstancesPosition(onUpdate: UpdateEntityCallback<Entity<TData>>): this;
        /**
         * Adds new instances and optionally initializes them using a callback function.
         * @param count The number of new instances to add.
         * @param onCreation An optional callback to initialize each new entity.
         * @returns The current `InstancedMesh2` instance.
         */
        addInstances(count: number, onCreation?: UpdateEntityCallback<Entity<TData>>): this;
        /**
         * Removes instances by their ids.
         * @param ids The ids of the instances to remove.
         * @returns The current `InstancedMesh2` instance.
         */
        removeInstances(...ids: number[]): this;
        /**
         * Clears all instances and resets the instance count.
         * @returns The current `InstancedMesh2` instance.
         */
        clearInstances(): this;
        /** @internal */ clearTempInstance(index: number): InstancedEntity;
        /** @internal */ clearTempInstancePosition(index: number): InstancedEntity;
        /** @internal */ clearInstance(instance: InstancedEntity): InstancedEntity;
        /** @internal */ createEntities(start: number): this;
        /** @internal */ addInstance(id: number, onCreation?: UpdateEntityCallback): void;
    }
}
