UNPKG

@adonis-agora/media

Version:

Media-library for AdonisJS — owner collections (MIME whitelist, single-file replace, ordering), image conversions (eager/lazy), pluggable content transformers (HLS video via mediabunny, metadata probe, image blur-up placeholder), and column attachments, a

29 lines • 1.69 kB
import type { WatcherContext } from './telescope-sdk.js'; /** * A media-specific Telescope watcher: records a richer, per-operation `media` entry for every * milestone `agora:media:*` event the library emits (uploads, conversions, attaches, deletes, …), * flattening the event's payload into structured content rather than storing the raw envelope like * the generic diagnostics bridge does. * * Zero coupling: media publishes via the structural `@adonis-agora/diagnostics` emit slot, this * subscribes to the same `node:diagnostics_channel` channels — neither package is imported. * * De-dup: `register()` CLAIMS every recorded channel via {@link claimMediaDiagnostics} (the * reference-counted `Symbol.for('@agora/diagnostics:claims')` registry), so the generic * `DiagnosticsWatcher` (its `recordClaimed: false` default) skips them and no event is recorded * twice. `upload.progress` is deliberately NOT claimed or recorded here. `dispose()` releases the * claim and detaches every subscription. * * The Adonis `TelescopeExtension` SDK doesn't itself accept watchers (its watchers are core and * emitter-based), so this is offered for standalone wiring by a host that wants the richer typed * entries — mirroring nestjs-media's `MediaWatcher`, "kept for standalone use". */ export declare class MediaWatcher { readonly type = "media"; private readonly disposers; /** Claim the recorded channels and start recording a richer `media` entry for each event. */ register(ctx: WatcherContext): void; /** Release the channel claims and detach every subscription (e.g. on shutdown). */ dispose(): void; } //# sourceMappingURL=media_watcher.d.ts.map