import { Expr, GpuFragmentParams } from '../../gpu/contract'; import { PropRef } from '../values'; /** The GPU half a media noun contributes to a custom-tier definition — spread it. */ export interface MediaSurfaceHalf { gpu: { fragment: (params: GpuFragmentParams) => Expr; }; } /** The fit-surface slots every media noun shares. */ interface MediaFitSlots { /** The structural object-fit prop (`compileTime` — only the selected mode's math is emitted). */ fit: PropRef; /** * How the sample is decoded. Required rather than defaulted so each consumer states its * choice (kit/media's D-1 rule). */ decode: 'srgb-linear-alpha-cut'; } /** * A static image, fetched → decoded → written into a media texture sized to the image's * NATIVE pixels. A 1×1 transparent placeholder shows until the image lands; the real texture * is swapped in when it loads (the pass manager rebuilds the sampling bind group on the swap — * no recompose), which is what makes `textureDimensions` report the real aspect. sRGB samples * are decoded to linear in-shader (the media analog of the external-texture decode). */ export declare function imageMedia(opts: MediaFitSlots & { /** The URL prop, read live via the URL-loader state machine. */ src: PropRef; /** Debug label for the media texture. */ label: string; /** Load-failure reporting — phrasing stays with the consumer. */ onError?: (error: unknown, url: string) => void; }): MediaSurfaceHalf; /** * A URL video: the shared video-element lifecycle (created once at composition, torn down in * its onCleanup) feeding a per-frame zero-copy `importExternalTexture` sample. The registered * getter returns the element only when it has a decodable frame; the pass manager re-imports * it each frame and skips the pass while it is null (the WGSL is fixed, so readiness never * recompiles). Firefox's CanvasTexture copy-path fallback is not implemented — its single * site is in the host module. */ export declare function videoMedia(opts: MediaFitSlots & { /** The URL prop. */ src: PropRef; /** The loop prop, synced to `video.loop` each frame. */ loop: PropRef; /** Milliseconds to wait for `loadedmetadata` before giving up. */ metadataTimeoutMs: number; onError?: (error: unknown, info: { url: string | null; stage: 'acquire' | 'autoplay'; }) => void; }): MediaSurfaceHalf; /** * The user's camera: the exact `videoMedia` path, only the source is `getUserMedia` instead * of a URL (which is why both share the host's `createVideoElementSource`). Autoplay is * required — a webcam element that would not play is not a usable feed, unlike a URL video * where a blocked autoplay still yields a first frame. `mirror` is a runtime uniform (selfie * flip must not recompose) applied to the fitted UV BEFORE the letterbox alpha cut, so the * cut sees the same UV that was sampled. */ export declare function webcamMedia(opts: MediaFitSlots & { /** The selfie-mirror boolean prop (runtime uniform). */ mirror: PropRef; /** `getUserMedia` constraints — behaviour data, stated by the consumer. */ constraints: MediaStreamConstraints; /** The fixed natural-size registry key (a webcam has no URL). */ naturalSizeKey: string; onError?: (error: unknown, info: { url: string | null; stage: 'acquire' | 'autoplay'; }) => void; }): MediaSurfaceHalf; export {}; //# sourceMappingURL=media.d.ts.map