import type { AFManifest } from './AFContainer.js'; import type { AFEncodedSource, AFEncodedStream } from './AFEncodedSource.js'; import type { AFSegmentCache } from './AFSegmentCache.js'; import type { BakedMotionAlbedoResource, BakedMotionDepthResource, BakedMotionFrameRate } from '../BakedMotion/BakedMotionManifest.js'; export declare const DEFAULT_AF_FULL_FILE_MAX_BYTES: number; export interface AFRangeFetchHeaders { get(name: string): string | null; } export interface AFRangeFetchResponse { readonly status: number; readonly headers?: AFRangeFetchHeaders; readonly body?: ReadableStream | null; arrayBuffer(): Promise; } export type AFRangeFetch = (input: string, init?: RequestInit) => PromiseLike; export interface AFRangeSourceOptions { url: string; resource: BakedMotionAlbedoResource | BakedMotionDepthResource; width: number; height: number; frameRate: BakedMotionFrameRate; fetchImpl?: AFRangeFetch; cache?: AFSegmentCache; maxFullFileBytes?: number; } export interface AFRangeSourceDisposeOptions { /** Leave verified entries unowned in the page LRU for an ordered rendition fallback. */ preserveCache?: boolean; } export type AFRangeNetworkMode = 'unknown' | 'range' | 'full'; export interface AFRangeSourceDiagnostics { networkMode: AFRangeNetworkMode; requestCount: number; requestedBytes: number; receivedBytes: number; verifiedBytes: number; retries: number; cacheHits: number; joinedRequests: number; rangeValidatedResponses: number; hashOnlyResponses: number; fullFallbacks: number; contentLengthUnavailableResponses: number; strongETag?: string; residentBytes: number; cacheResidentBytes: number; cacheHighWaterBytes: number; disposed: boolean; } export declare function sha256Hex(bytes: Uint8Array): Promise; export declare class AFRangeSource implements AFEncodedSource { readonly manifest: AFManifest; readonly url: string; readonly resource: BakedMotionAlbedoResource | BakedMotionDepthResource; readonly cache: AFSegmentCache; readonly maxFullFileBytes: number; private readonly width; private readonly height; private readonly frameRate; private readonly fetchImpl; private readonly owner; private readonly streams; private readonly segmentKeys; private readonly segmentByKey; private readonly touchedKeys; private readonly ownedKeys; private readonly keyLengths; private readonly demands; private readonly retained; private readonly verifiedFullSegments; private readonly disposeController; private readonly counters; private mode; private strongETag; private probePromise; private preloadPromise; private fullFallbackPromise; private fullMetadataValidated; private probing; private preloadedFull; private disposed; private cachePreserved; private readonly fullKey; constructor(options: AFRangeSourceOptions); ensureFrames(streamName: AFEncodedStream, frames: readonly number[], signal?: AbortSignal): Promise; /** * Fetch and authenticate the complete indexed resource with one exact range request. * Always-resident low-resolution fields use this path so an all-intra package does not turn * hundreds of tiny GOPs into hundreds of independent RTTs. */ preloadAll(signal?: AbortSignal): Promise; releaseExcept(streamName: AFEncodedStream, frames: readonly number[]): void; getDiagnostics(): Readonly; dispose({ preserveCache }?: AFRangeSourceDisposeOptions): void; private addStream; private segmentKey; private resolveMode; private acquireSegment; private acquireFromFull; private verifyTrailer; private loadPreloadedFull; private acceptTrailerResponse; private loadSegment; private acceptRangeResponse; private acceptFullResponse; private validateFullContainer; private pinETag; private attachSegmentBytes; private attachFullSegment; private detachSegment; private incrementDemand; private decrementDemand; private neededSegmentKeys; private releaseUnused; private recordCacheStatus; private assertActive; private waitForCaller; }