import { Observable } from 'rxjs/Observable'; import { ErasConfigService } from './../eras-config.service'; import { ErasHttpService } from './../eras-http.service'; import { SomaStringUtils } from '../utils/string-utils.service'; import { AuthService } from '../auth.service'; export declare class ProjectFileDataService { private erasConfigService; private erasHttpService; private erasStringUtilsService; private authService; constructor(erasConfigService: ErasConfigService, erasHttpService: ErasHttpService, erasStringUtilsService: SomaStringUtils, authService: AuthService); /** * Retorna os metadados de um arquivo de determinado projeto * * @param projectId The ID of a project. * @param fileId The ID of a project file. The ID is the file path encoded in Base64. For example, the project file path "dir/subdir/note.txt" has the id "ZGlyL3N1YmRpci9ub3RlLnR4dA==" */ get(projectId: string, fileId: string): Observable; /** * Cria um novo diretório * * @param projectId id of the project that new folder will be created * @param parentId id of the parent folder * @param folderName folder name. Accents and Space will be removed. */ createFolder(projectId: string, parentId: string, folderName: string): Observable; /** * Lista os arquivos de determinado projeto * @param projectId id do proejto */ list(projectId: string): Observable; /** * Uploads a Blob to a project folder was new file. If file exist, the content will be replaced. * * @param projectId Id of the project * @param parentId Id of the parent fodler where the file will be sent. 'ROOT' for root. * @param content upload content. If you wanted to send text content, just create a Blob: `new Blob(['lorem ipsum....'],{type: 'text/plain'})` * @param fileName file name. Accents and Space will be removed. * */ upload(projectId: string, parentId: string, content: Blob, fileName: string): Observable<{ fileId: string; }>; /** * The object in result will be a Blob object. Useful to downloading binaries. * * @param projectId The ID of a project. * @param fileId The ID of a project file. The ID is the file path encoded in Base64. For example, the project file path "dir/subdir/note.txt" has the id "ZGlyL3N1YmRpci9ub3RlLnR4dA==" */ downloadBlob(projectId: string, fileId: string): Observable; /** * the object in result will be plain text. Useful for downloading TXT files. * * @param projectId The ID of a project. * @param fileId The ID of a project file. The ID is the file path encoded in Base64. For example, the project file path "dir/subdir/note.txt" has the id "ZGlyL3N1YmRpci9ub3RlLnR4dA==" */ downloadText(projectId: string, fileId: string): Observable; /** * * @param projectId The ID of a project. * @param fileId The ID of a project file. The ID is the file path encoded in Base64. For example, the project file path "dir/subdir/note.txt" has the id "ZGlyL3N1YmRpci9ub3RlLnR4dA==" */ private download(projectId, fileId, type); /** * download the file to the client machine. * Useful to make a funtion like 'save as' * * @param projectId * @param fileId * @param extraParams ( compress [boolean] ) - zip the file content */ downloadInNewTab(projectId: string, fileId: string, extraParams: { compress?: boolean; }): void; /** * return the file name to one file id * * @param fileId id of file * @returns fileName by fileId */ getFileNameByFileId(fileId: string): string; private _get(projectId, fileId); }