import { type SplatData } from '../../core/splat-data'; import { type SplatRequestOptions } from '../../loaders/loading'; /** * Parses a bundled `.sog` file into flat, GPU-friendly arrays, including * the palette-compressed higher-order SH coefficients (`shN`) if present. * * @param options.signal - Optional abort signal; the decode stages check it * between steps and inside the dequantization loop. * @throws {Error} if the archive or its `meta.json` is malformed; * a `DOMException` named `AbortError` when cancelled. * * A direct parser call sits outside the `SplatLoadError`-or-`AbortError` * contract of the worker-mediated loaders ({@link loadSplatData}, * {@link loadSplatDataFile}, `ChunkLoader`, `StreamedSplatMesh`): malformed input * surfaces here as a plain `Error`. */ export declare function parseSog(buffer: ArrayBuffer, options?: SogParseOptions): Promise; /** Options for {@link parseSog}. */ export interface SogParseOptions { /** Checked between decode stages and inside the dequantization loop. */ signal?: AbortSignal; /** * Keep at most this many splats, the most visible ones (opacity × size), * thinned while decoding so the discarded splats are never written out: * the decode's peak memory scales with what is kept, not with the file. * The kept set is exactly the one `limitSplatCount` would choose from the * fully decoded scene, and `sourceCount` is set when anything was dropped. * A function is called once with the file's splat count and may resolve * asynchronously (the loaders ask a scene budget). Default: keep all. */ maxSplats?: number | ((count: number) => number | Promise); } /** * Parses an unbundled SOG directory (`meta.json` + WebP files fetched * individually) into flat, GPU-friendly arrays - the layout Streamed SOG * chunks use. * * @param baseUrl - Absolute URL of the directory containing `meta.json`. * @param options.signal - Optional abort signal; in-flight fetches are * cancelled when it fires, and the decode stages check it between steps. * @throws {Error} on fetch failures or a malformed `meta.json`; * a `DOMException` named `AbortError` when cancelled. * * A direct parser call sits outside the `SplatLoadError`-or-`AbortError` * contract of the worker-mediated loaders ({@link loadSplatData}, * {@link loadSplatDataFile}, `ChunkLoader`, `StreamedSplatMesh`): malformed input * surfaces here as a plain `Error`. */ export declare function parseSogDirectory(baseUrl: string, options?: { signal?: AbortSignal; request?: SplatRequestOptions; /** * The directory's files as `name → URL`, for a chunk that has no * directory URL to resolve against - a folder dropped into the page, * whose files are reached through `blob:` URLs. */ files?: Readonly>; }): Promise;