import type { AudioDecoderRegistry, AudioResourceFetch, AudioResourceReference, HostAudioDecodeCapabilities } from '@flighthq/audio/contract'; import type { ImageDecodeFallback } from '@flighthq/image-codec/contract'; import type { ImageResourceFetch, ImageResourceReference } from '@flighthq/image/contract'; import type { Node2D } from '@flighthq/scene2d/contract'; import type { Signal } from '@flighthq/signals/contract'; import type { Scene2DDocument, Scene2DSlotReference } from './Scene2DDocument.ts'; export interface Scene2DDocumentFetchProgress { loaded: number; total: number; url: string; } export type Scene2DDocumentFetcher = (url: string, signal: AbortSignal, progress: Signal> | null) => Promise; export interface Scene2DDocumentImportContext { mimeType: string | null; url: string | null; } export type Scene2DDocumentImporter = (source: Uint8Array, context: Readonly) => Scene2DDocument | null; export type Scene2DDocumentImporterMatcher = (source: Uint8Array, context: Readonly) => boolean; export interface Scene2DDocumentImporterEntry { importDocument: Scene2DDocumentImporter; kind: string; matches: Scene2DDocumentImporterMatcher; } export interface Scene2DDocumentImporterRegistry { entries: Scene2DDocumentImporterEntry[]; } export interface Scene2DDocumentLoadOptions { mimeType?: string | null; progress?: Signal>; signal?: AbortSignal; } export type Scene2DSlotContentResolver = (reference: Readonly) => Node2D | null; export interface Scene2DSlotResolution { content: Node2D; reference: Scene2DSlotReference; } export interface Scene2DResources { document: Scene2DDocument; resolved: Scene2DSlotResolution[]; root: Node2D; unresolved: Scene2DSlotReference[]; } export interface ResolveScene2DResourcesOptions { resolveSlotContent?: Scene2DSlotContentResolver; select?: (reference: Readonly) => boolean; } export interface Scene2DImageResourceLoadProgress { loaded: number; reference: ImageResourceReference; total: number; } export interface Scene2DImageResources { document: Scene2DDocument; resolved: ImageResourceReference[]; unresolved: ImageResourceReference[]; } export interface LoadScene2DImageResourcesOptions { decode?: ImageDecodeFallback; fetch?: ImageResourceFetch; progress?: Signal>; select?: (reference: Readonly) => boolean; signal?: AbortSignal; } export interface Scene2DAudioResourceLoadProgress { loaded: number; reference: AudioResourceReference; total: number; } export interface Scene2DAudioResources { document: Scene2DDocument; resolved: AudioResourceReference[]; unresolved: AudioResourceReference[]; } export interface LoadScene2DAudioResourcesOptions { audioDecode?: Readonly; decoders?: AudioDecoderRegistry; fetch?: AudioResourceFetch; progress?: Signal>; select?: (reference: Readonly) => boolean; signal?: AbortSignal; } export interface Scene2DResourceCoverageCount { readonly resolved: number; readonly total: number; } export interface Scene2DResourceCoverageExplanation { readonly audioResources: Readonly; readonly complete: boolean; readonly imageResources: Readonly; readonly requiredSlots: Readonly; } export type Scene2DResourceFailureOperation = 'createScene2DDocumentFromBytes' | 'loadScene2DAudioResources' | 'loadScene2DDocumentFromUrl' | 'loadScene2DImageResources' | 'resolveScene2DResources'; export type Scene2DResourceFailureReason = 'audio-resources-unresolved' | 'document-fetch-failed' | 'document-import-failed' | 'document-importer-missing' | 'image-resources-unresolved' | 'required-slots-unresolved'; export interface Scene2DResourceFailureNotice { readonly operation: Scene2DResourceFailureOperation; readonly reason: Scene2DResourceFailureReason; readonly total: number; readonly unresolved: number; readonly url: string | null; } export type Scene2DResourceFailureGuard = (notice: Readonly) => void; //# sourceMappingURL=Scene2DResources.d.ts.map