type PromiseType = "texture" | "mesh"; export type PromiseGroupOptions = { /** Name for debugging purposes */ name?: string; /** Define how many frames new LOD promises will at least be captured and awaited. The group will resolve after all promises captured during this time have resolved (or when the abort signal is triggered). * @default 2 frames, which means the group will capture promises for 2 frames before resolving. */ frames?: number; /** If set to true at least one LOD loading promise must be captured before this promise will resolve. * After the first promise has been captured the group will wait for the amount of frames specified in the `frames` option. */ waitForFirstCapture?: boolean; /** An optional signal to abort the promise */ signal?: AbortSignal; /** * If set to true, the group will only await one promise per object. * @default 1 */ maxPromisesPerObject?: number; }; type PromiseGroupResolveResult = { /** * `true` if the group was cancelled, `false` if it was resolved normally. */ cancelled: boolean; /** * The number of promises that started to being awaited */ awaited_count: number; /** * The number of promises that were resolved */ resolved_count: number; }; /** * A group of promises that can be awaited together. * This is used for awaiting LOD */ export declare class PromiseGroup { static readonly addPromise: (type: PromiseType, object: object, promise: Promise, groups: PromiseGroup[]) => void; readonly ready: Promise; /** The number of promises that have been added to this group so far */ get awaitedCount(): number; /** The number of promises that have been resolved */ get resolvedCount(): number; /** The number of promises that are in-flight */ get currentlyAwaiting(): number; private _resolve; private readonly _signal?; /** start frame can be undefined if the user configured this group to wait for the first promise. * Then the start frame will be set when the first promise has been added to the group */ private _frame_start; /** How many frames to capture since the start frame */ private _frames_to_capture; private _resolved; private _addedCount; private _resolvedCount; /** These promises are currently being awaited */ private readonly _awaiting; private _maxPromisesPerObject; constructor(frame: number, options: PromiseGroupOptions); private _currentFrame; update(frame: number): void; private readonly _seen; private add; private resolveNow; } export {};