@asgerami/zemenay-blog
Version:
Plug-and-play blog system for Next.js - Get a fully functional blog running in minutes with zero configuration
28 lines (27 loc) • 723 B
TypeScript
import type { BlogImage } from '../types';
export interface UploadImageOptions {
file: File;
altText?: string;
folder?: string;
}
export interface UploadImageResult {
success: boolean;
image?: BlogImage;
error?: string;
publicUrl?: string;
}
/**
* Upload an image to Supabase Storage and create a database record
*/
export declare function uploadImage({ file, altText, folder }: UploadImageOptions): Promise<UploadImageResult>;
/**
* Get public URL for an image
*/
export declare function getImageUrl(filePath: string): string;
/**
* Delete an image from storage and database
*/
export declare function deleteImage(imageId: string): Promise<{
success: boolean;
error?: string;
}>;