mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
43 lines
999 B
TypeScript
43 lines
999 B
TypeScript
declare module '@ioc:Adonis/Addons/Cloudinary' {
|
|
import {
|
|
ResponseCallback,
|
|
TransformationOptions,
|
|
UploadApiOptions,
|
|
UploadApiResponse,
|
|
ResourceType,
|
|
DeliveryType,
|
|
} from 'cloudinary';
|
|
import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
|
|
|
|
export interface CloudinaryConfig {
|
|
cloudName: string;
|
|
apiKey: string;
|
|
apiSecret: string;
|
|
secure: boolean;
|
|
[key: string]: TransformationOptions;
|
|
}
|
|
|
|
export interface CloudinaryInterface {
|
|
upload(
|
|
file: MultipartFileContract,
|
|
publicId: string | undefined,
|
|
uploadOptions?: UploadApiOptions,
|
|
callback?: ResponseCallback
|
|
): Promise<UploadApiResponse>;
|
|
|
|
destroy(
|
|
publicId: string,
|
|
options?: {
|
|
resource_type?: ResourceType;
|
|
type?: DeliveryType;
|
|
invalidate?: boolean;
|
|
}
|
|
): Promise<any>;
|
|
|
|
getConfig(): CloudinaryConfig;
|
|
}
|
|
|
|
const CloudinaryService: CloudinaryInterface;
|
|
export default CloudinaryService;
|
|
}
|