import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
import { PrismaService } from '@hed-hog/api-prisma';
import { OnModuleInit } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { SettingService } from '../setting/setting.service';
import { DeleteDTO } from './dto/delete.dto';
import { AbstractProvider } from './provider/abstract.provider';
export declare class FileService implements OnModuleInit {
    private readonly prismaService;
    private readonly paginationService;
    private readonly settingService;
    private readonly jwtService;
    private providerId;
    private mimetypes;
    private hasMojibake;
    private normalizeUploadedFilename;
    constructor(prismaService: PrismaService, paginationService: PaginationService, settingService: SettingService, jwtService: JwtService);
    onModuleInit(): Promise<void>;
    getProvider(): Promise<AbstractProvider>;
    getMimeType(mimetype: string): Promise<number>;
    acceptMimetypes(mimetype: string): Promise<boolean>;
    maxFileSize(size: number): Promise<boolean>;
    uploadFromString(destination: string, filename: string, filecontent: string, mimetype?: string): Promise<{
        filename: string;
        location: string;
        id: number;
        path: string;
        size: number;
        created_at: Date;
        updated_at: Date;
        provider_id: number;
        mimetype_id: number;
    }>;
    getStorage(): Promise<any>;
    private getProviderPath;
    private mapStorageNotFoundError;
    openReadStreamById(fileId: number): Promise<{
        file: {
            file_mimetype: {
                name: string;
                id: number;
                created_at: Date;
                updated_at: Date;
            };
        } & {
            filename: string;
            location: string;
            id: number;
            path: string;
            size: number;
            created_at: Date;
            updated_at: Date;
            provider_id: number;
            mimetype_id: number;
        };
        stream: any;
        size: number;
    }>;
    downloadToPath(fileId: number, destinationPath: string, options?: {
        maxBytes?: number;
    }): Promise<{
        file: {
            file_mimetype: {
                name: string;
                id: number;
                created_at: Date;
                updated_at: Date;
            };
        } & {
            filename: string;
            location: string;
            id: number;
            path: string;
            size: number;
            created_at: Date;
            updated_at: Date;
            provider_id: number;
            mimetype_id: number;
        };
        path: string;
        size: number;
    }>;
    getBuffer(fileId: number): Promise<{
        file: {
            file_mimetype: {
                name: string;
                id: number;
                created_at: Date;
                updated_at: Date;
            };
        } & {
            filename: string;
            location: string;
            id: number;
            path: string;
            size: number;
            created_at: Date;
            updated_at: Date;
            provider_id: number;
            mimetype_id: number;
        };
        buffer: Buffer<ArrayBuffer>;
    }>;
    getLocalFile(fileId: number, res: any): Promise<void>;
    upload(destination: string, fileBuffer: MulterFile): Promise<{
        filename: string;
        location: string;
        id: number;
        path: string;
        size: number;
        created_at: Date;
        updated_at: Date;
        provider_id: number;
        mimetype_id: number;
    }>;
    uploadFromPath(destination: string, filePath: string, metadata?: {
        originalname?: string;
        filename?: string;
        mimetype?: string;
        size?: number;
        encoding?: string;
    }): Promise<{
        filename: string;
        location: string;
        id: number;
        path: string;
        size: number;
        created_at: Date;
        updated_at: Date;
        provider_id: number;
        mimetype_id: number;
    }>;
    delete(locale: string, { ids }: DeleteDTO): Promise<number[]>;
    getFiles(paginationParams: PaginationDTO): Promise<{
        total: any;
        lastPage: number;
        page: number;
        pageSize: number;
        prev: number;
        next: number;
        data: any[];
    }>;
    get(fileId: number): Promise<{
        filename: string;
        location: string;
        id: number;
        path: string;
        size: number;
        created_at: Date;
        updated_at: Date;
        provider_id: number;
        mimetype_id: number;
    }>;
    readStream(filepath: string): Promise<any>;
    private getFileSizeFromMetadata;
    download(locale: string, token: string): Promise<{
        stream: any;
        filename: string;
        mimetype: string;
        size: number;
    }>;
    openById(locale: string, fileId: number): Promise<{
        stream: any;
        filename: string;
        mimetype: string;
        size: number;
    }>;
    tempURL(filepath: string, expires?: number): Promise<any>;
    tempOpenURL(filepath: string, expires?: number): Promise<any>;
    createDownloadToken(filepath: string, expires?: number): string;
}
//# sourceMappingURL=file.service.d.ts.map