@crowdin/crowdin-api-client
Version:
JavaScript library for Crowdin API
47 lines (46 loc) • 2.11 kB
TypeScript
import { CrowdinApi, PaginationOptions, ResponseList, ResponseObject } from '../core';
/**
* Storage is a separate container for each file. You need to use Add Storage method before adding files to your projects via API.
* Files that should be uploaded into storage include files for localization, screenshots, Glossaries, and Translation Memories.
*
* Storage id is the identifier of the file uploaded to the Storage.
*
* Note: Files uploaded to the storage are kept during the next 24 hours.
*/
export declare class UploadStorage extends CrowdinApi {
/**
* @param options optional pagination parameters for the request
* @see https://developer.crowdin.com/api/v2/#operation/api.storages.getMany
*/
listStorages(options?: PaginationOptions): Promise<ResponseList<UploadStorageModel.Storage>>;
/**
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @deprecated optional parameters should be passed through an object
* @see https://developer.crowdin.com/api/v2/#operation/api.storages.getMany
*/
listStorages(limit?: number, offset?: number): Promise<ResponseList<UploadStorageModel.Storage>>;
/**
* @param fileName file name
* @param request binary file data
* @param contentType content type header
* @see https://developer.crowdin.com/api/v2/#operation/api.storages.post
*/
addStorage(fileName: string, request: any, contentType?: string): Promise<ResponseObject<UploadStorageModel.Storage>>;
/**
* @param storageId storage identifier
* @see https://developer.crowdin.com/api/v2/#operation/api.storages.get
*/
getStorage(storageId: number): Promise<ResponseObject<UploadStorageModel.Storage>>;
/**
* @param storageId storage identifier
* @see https://developer.crowdin.com/api/v2/#operation/api.storages.delete
*/
deleteStorage(storageId: number): Promise<void>;
}
export declare namespace UploadStorageModel {
interface Storage {
id: number;
fileName: string;
}
}