import { Platform } from '@ionic/angular'; import Parse from "parse"; import { Diagnostic } from '@awesome-cordova-plugins/diagnostic/ngx'; /** * MediaCapture插件 * @private * @description * 依赖:File * npm i -S cordova-plugin-file @awesome-cordova-plugins/file */ import { MediaFile } from "@awesome-cordova-plugins/media-capture"; import * as i0 from "@angular/core"; /** * NovaFile 文件类型 * @public */ export interface NovaFile { id: string; key: string; url: string; name: string; type: string; size: number; md5?: string; } /** * NovaUploadService 上传服务 * @public */ export declare class NovaUploadService { private platform; private diagnostic; company: string; uptoken: string; qiniuConf: any; domain: string; constructor(platform: Platform, diagnostic: Diagnostic); /** * 全端通用上传方法 * @params file:File 待上传文件 * @params onProgress:Function 上传进度回调函数 * @returns * progressData { "total": { "size": 8491, "loaded": 8490, "percent": 99.98822282416675 } } * novafileData { "id":"xxxxxxxxxx" // Attachment.objectId "hash": "FoYHjpyTif1t8uOMv6N6sVIeGTvq", "key": "E4KpGvTEto/20230901/053605467.jpg", "url": "https://file-cloud.fmode.cn/E4KpGvTEto/20230901/053605467.jpg", "name": "20230901173605.jpg", "type": "image/jpg", "size": 7853 } */ upload(file: File, onProgress?: Function): Promise; /** * 移动端上传专用方法 * @returns */ isCapacitor(): boolean; requestPermission(): Promise; requestStoagePermission(): Promise; requestCameraPermission(): Promise; /** * 上传Token获取方法 * @returns */ getUptoken(refresh?: boolean): Promise; /** * 生成文件上传Key值:<公司id>//. * @desc 用于对象存储含全路径的文件名称 */ genFileKey(file: { id: string; name: string; }, company?: any): string; /** * 获取当前登录用户公司ID * @returns 公司ID */ getCompanyId(): string; qiniuDomain: string; queryDomain(): Promise; /** * 保存上传信息至附件表 Attachment * @param file 附件信息 * @returns attachment Parse.Object */ saveAttachment(file: NovaFile | { url: string; size: string; name: string; type: string; md5?: string; }, domain: any, cateId?: any, company?: any): Promise; /** * 录像并上传 */ captureVideo(conf: any): Promise; cameraCaptureVideoFile(): Promise; getMediaFileDataString(mediafile: any): Promise; /** * 拍照并上传 * @returns -- {hash?:string,url:string,name:string,size:number,key:stirng} */ takePicture(conf: any): Promise; cameraTakePictureDataUrl(): Promise; maxSize: number; /** * 七牛上传函数:无需前端组件 * @param imageBlob: Blob * @param format: string */ saveQiniuImageFile(imageBlob: Blob, format: string, company?: string, onProgress?: Function): Promise; saveQiniuMediaFile(mediafile: any, fileBlob: Blob, company?: string, onProgress?: Function): Promise; base64ToBlobType(string: any, type: any): Promise; base64ToBlob(base64Img: string): Promise; fileToBlob(file: File): Blob; genMd5(inputString: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }