@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
25 lines • 1.17 kB
TypeScript
import type { ApplicationService } from '@adonisjs/core/types';
/**
* Wires `@adonis-agora/media` into the AdonisJS application: binds a singleton {@link MediaManager}
* built from `config/media.ts`. Storage is delegated to `@adonisjs/drive` — the manager resolves disks
* from the booted Drive manager, so this package never reimplements disk drivers. The selected store
* (`memory` / `lucid`) and image processor (`processors.sharp()`) are built lazily from the config so
* their peer dependencies (`@adonisjs/lucid`, `sharp`) load only when chosen.
*
* ```ts
* const media = await app.container.make(MediaManager)
* await media.library.attach({ ownerType: 'Post', ownerId: '1', collection: 'gallery', ... })
* ```
*/
export default class MediaProvider {
#private;
protected app: ApplicationService;
constructor(app: ApplicationService);
register(): void;
/**
* Mount the media routes once the app has booted (see the comment inside for why). No-ops when
* neither the TUS resumable routes nor the direct-upload routes are enabled in config.
*/
boot(): Promise<void>;
}
//# sourceMappingURL=media_provider.d.ts.map