/// <reference types="dist" />
import { ViewableBuffer } from '../../../utils/ViewableBuffer';
import { BatchTextureArray } from './BatchTextureArray';
import type { BindGroup } from '../../renderers/gpu/shader/BindGroup';
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
import type { BLEND_MODES } from '../../renderers/shared/state/const';
import type { Texture } from '../../renderers/shared/texture/Texture';
export type BatchAction = 'startBatch' | 'renderBatch';
export declare class Batch {
    type: string;
    action: BatchAction;
    start: number;
    size: number;
    textures: BatchTextureArray;
    blendMode: BLEND_MODES;
    canBundle: boolean;
    /**
     * breaking rules slightly here in the name of performance..
     * storing references to these bindgroups here is just faster for access!
     * keeps a reference to the GPU bind group to set when rendering this batch for WebGPU. Will be null is using WebGL.
     */
    gpuBindGroup: GPUBindGroup;
    /**
     * breaking rules slightly here in the name of performance..
     * storing references to these bindgroups here is just faster for access!
     * keeps a reference to the bind group to set when rendering this batch for WebGPU. Will be null if using WebGl.
     */
    bindGroup: BindGroup;
    batcher: Batcher;
    destroy(): void;
}
export interface BatchableObject {
    indexStart: number;
    packAttributes: (float32View: Float32Array, uint32View: Uint32Array, index: number, textureId: number) => void;
    packIndex: (indexBuffer: Uint32Array, index: number, indicesOffset: number) => void;
    texture: Texture;
    blendMode: BLEND_MODES;
    vertexSize: number;
    indexSize: number;
    textureId: number;
    location: number;
    batcher: Batcher;
    batch: Batch;
}
export declare class Batcher {
    uid: number;
    attributeBuffer: ViewableBuffer;
    indexBuffer: Uint32Array;
    attributeSize: number;
    indexSize: number;
    elementSize: number;
    elementStart: number;
    dirty: boolean;
    batchIndex: number;
    batches: Batch[];
    geometry: import("../../..").Geometry;
    private readonly _vertexSize;
    private _elements;
    private readonly _batchPool;
    private _batchPoolIndex;
    private readonly _textureBatchPool;
    private _textureBatchPoolIndex;
    private _batchIndexStart;
    private _batchIndexSize;
    constructor(vertexSize?: number, indexSize?: number);
    begin(): void;
    add(batchableObject: BatchableObject): void;
    checkAndUpdateTexture(batchableObject: BatchableObject, texture: Texture): boolean;
    updateElement(batchableObject: BatchableObject): void;
    /**
     * breaks the batcher. This happens when a batch gets too big,
     * or we need to switch to a different type of rendering (a filter for example)
     * @param instructionSet
     */
    break(instructionSet: InstructionSet): void;
    private _finishBatch;
    finish(instructionSet: InstructionSet): void;
    ensureAttributeBuffer(size: number): void;
    ensureIndexBuffer(size: number): void;
    private _resizeAttributeBuffer;
    private _resizeIndexBuffer;
    destroy(): void;
}
