projects.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Project } from "../models/project";
  2. import { BaseCollection } from "./base_collection";
  3. import { PaginationParams } from "../interfaces/pagination_params";
  4. import { PaginatedResult } from "../interfaces/paginated_result";
  5. interface ProjectListParams extends PaginationParams {
  6. filter_team_id?: number | string;
  7. filter_names?: string;
  8. include_statistics?: string | number;
  9. include_settings?: string | number;
  10. }
  11. type ProjectParams = {
  12. name: string;
  13. team_id?: number | string;
  14. description?: string;
  15. languages?: Array<{
  16. lang_iso: string;
  17. custom_iso?: string;
  18. }>;
  19. base_lang_iso?: string;
  20. project_type?: "localization_files" | "paged_documents";
  21. is_segmentation_enabled?: boolean;
  22. };
  23. type ProjectUpdateParams = {
  24. name: string;
  25. description?: string;
  26. };
  27. type ProjectDeleted = {
  28. project_id: string;
  29. project_deleted: boolean;
  30. };
  31. type ProjectEmptied = {
  32. project_id: string;
  33. keys_deleted: boolean;
  34. };
  35. export declare class Projects extends BaseCollection {
  36. protected static rootElementName: string;
  37. protected static prefixURI: string;
  38. protected static elementClass: typeof Project;
  39. list(request_params?: ProjectListParams): Promise<PaginatedResult<Project>>;
  40. create(project_params: ProjectParams): Promise<Project>;
  41. get(project_id: string | number): Promise<Project>;
  42. update(project_id: string | number, project_params: ProjectUpdateParams): Promise<Project>;
  43. delete(project_id: string | number): Promise<ProjectDeleted>;
  44. empty(project_id: any): Promise<ProjectEmptied>;
  45. }
  46. export {};