UNPKG

@jrmc/adonis-attachment

Version:

Turn any field on your Lucid model to an attachment data type

37 lines 1.36 kB
/** * @jrmc/adonis-attachment * * @license MIT * @copyright Jeremy Chaufourier <jeremy@chaufourier.fr> */ import type { DriveService, SignedURLOptions } from '@adonisjs/drive/types'; import type { AttachmentAttributes, Attachment as AttachmentInterface, LucidOptions } from '../types/attachment.js'; import type { Input } from '../types/input.js'; import { AttachmentBase } from './attachment_base.js'; import { Variant } from './variant_attachment.js'; export declare class Attachment extends AttachmentBase implements AttachmentInterface { originalName: string; variants?: Variant[]; constructor(drive: DriveService, attributes: AttachmentAttributes, input?: Input); /** * Getters / setters */ get name(): string; set name(name: string); /** * Methods */ createVariant(key: string, input: Input): Promise<Variant>; getVariant(variantName: string): Variant | undefined; getUrl(variantName?: string): Promise<string>; getSignedUrl(variantNameOrOptions?: string | SignedURLOptions, signedUrlOptions?: SignedURLOptions): Promise<string>; setOptions(options: LucidOptions): this; moveFileForDelete(): Promise<void>; rollbackMoveFileForDelete(): Promise<void>; /** * */ toObject(): AttachmentAttributes; toJSON(): Object; } //# sourceMappingURL=attachment.d.ts.map