adonisjs-cloudinary
Version:
[![npm-image]][npm-url] [![license-image]][license-url] [![typescript-image]][typescript-url]
24 lines (23 loc) • 1.3 kB
TypeScript
/// <reference types="@adonisjs/bodyparser/build/adonis-typings" />
import { CloudinaryConfig } from '@ioc:Adonis/Addons/Cloudinary';
import { DeliveryType, ResourceType, ResponseCallback, TransformationOptions, UploadApiOptions, UploadApiResponse } from 'cloudinary';
import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
export default class Cloudinary {
private readonly config;
private readonly cloudinary;
private uploadResponse;
constructor(config: CloudinaryConfig, cloudinary: any);
getCloudinary(): any;
private static getPathFromFile;
upload(file: string | MultipartFileContract, publicId?: string | null, uploadOptions?: UploadApiOptions, callback?: ResponseCallback): Promise<any>;
unsignedUpload(file: string | MultipartFileContract, uploadPreset: string, publicId?: string | null, uploadOptions?: UploadApiOptions, callback?: ResponseCallback): Promise<any>;
getResult(): UploadApiResponse;
getPublicId(): string;
show(publicId: any, options?: TransformationOptions): any;
secureShow(publicId: any, options?: TransformationOptions): any;
destroy(publicId: any, options?: {
resource_type?: ResourceType;
type?: DeliveryType;
invalidate?: boolean;
}): Promise<any>;
}