import { CrowdinApi , DownloadLink , PatchRequest , ResponseList , ResponseObject , Status } from '../core' ; export class TranslationMemory extends CrowdinApi { param groupId param limit param offset listTm ( groupId ? , limit ? , offset ? ) { let url = `${ this . url }/tms` ; url = this . addQueryParam ( url , 'groupId' , groupId ) ; return this . getList ( url , limit , offset ) ; } param request addTm ( request ) { const url = `${ this . url }/tms` ; return this . post ( url , request , this . defaultConfig ( ) ) ; } param tmId getTm ( tmId ) { const url = `${ this . url }/tms/${ tmId }` ; return this . get ( url , this . defaultConfig ( ) ) ; } param tmId deleteTm ( tmId ) { const url = `${ this . url }/tms/${ tmId }` ; return this . delete ( url , this . defaultConfig ( ) ) ; } param tmId param request editTm ( tmId , request ) { const url = `${ this . url }/tms/${ tmId }` ; return this . patch ( url , request , this . defaultConfig ( ) ) ; } param tmId clearTm ( tmId ) { const url = `${ this . url }/tms/${ tmId }/segments` ; return this . delete ( url , this . defaultConfig ( ) ) ; } param tmId param exportId downloadTm ( tmId , exportId ) { const url = `${ this . url }/tms/${ tmId }/exports/${ exportId }/download` ; return this . get ( url , this . defaultConfig ( ) ) ; } param tmId param request exportTm ( tmId , request ) { const url = `${ this . url }/tms/${ tmId }/exports` ; return this . post ( url , request , this . defaultConfig ( ) ) ; } param tmId param exportId checkExportStatus ( tmId , exportId ) { const url = `${ this . url }/tms/${ tmId }/exports/${ exportId }` ; return this . get ( url , this . defaultConfig ( ) ) ; } param tmId param request importTm ( tmId , request ) { const url = `${ this . url }/tms/${ tmId }/imports` ; return this . post ( url , request , this . defaultConfig ( ) ) ; } param tmId param importId checkImportStatus ( tmId , importId ) { const url = `${ this . url }/tms/${ tmId }/imports/${ importId }` ; return this . get ( url , this . defaultConfig ( ) ) ; } } export namespace TranslationMemoryModel { export interface TranslationMemory { id : number ; groupId : number ; userId : number ; name : string ; languageIds : string [ ] ; segmentsCount : number ; defaultProjectId : number ; projectIds : number [ ] ; createdAt : string ; } export interface AddTranslationMemoryRequest { name : string ; groupId ? : number ; } export interface ExportTranslationMemoryRequest { sourceLanguageId ? : number ; targetLanguageId ? : number ; format ? : Format ; } export interface ImportTranslationMemoryRequest { storageId : number ; firstLineContainsHeader ? : boolean ; scheme ? : Scheme ; } export interface ExportTranslationMemoryAttribute { sourceLanguageId : string ; targetLanguageId : string ; format : string ; } export interface ImportTranslationMemoryAttribute { tmId : number ; storageId : number ; firstLineContainsHeader : number ; scheme : Scheme ; } export enum Format { TMX = 'tmx' , CSV = 'csv' , XLSX = 'xlsx' } export interface Scheme { [ key ] : number ; } }