tasks.d.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { BaseCollection } from "./base_collection";
  2. import { Task } from "../models/task";
  3. import { PaginatedResult } from "../interfaces/paginated_result";
  4. import { ProjectWithPagination } from "../interfaces/project_with_pagination";
  5. import { ProjectOnly } from "../interfaces/project_only";
  6. interface ListTaskParams extends ProjectWithPagination {
  7. filter_title?: string;
  8. filter_statuses?: string;
  9. }
  10. type TaskLanguage = {
  11. language_iso: string;
  12. users?: string[] | number[];
  13. groups?: string[] | number[];
  14. };
  15. type CreateTaskParams = {
  16. title: string;
  17. description?: string;
  18. due_date?: string;
  19. keys?: string[] | number[];
  20. languages?: Array<TaskLanguage>;
  21. source_language_iso?: string;
  22. auto_close_languages?: boolean;
  23. auto_close_task?: boolean;
  24. auto_close_items?: boolean;
  25. task_type?: string;
  26. parent_task_id?: string | number;
  27. closing_tags?: string[];
  28. do_lock_translations?: boolean;
  29. custom_translation_status_ids?: string[] | number[];
  30. };
  31. type UpdateTaskParams = Omit<CreateTaskParams, "title" | "keys" | "source_language_iso" | "task_type" | "parent_task_id" | "custom_translation_status_ids"> & {
  32. title?: string;
  33. close_task?: boolean;
  34. languages?: Array<TaskLanguage & {
  35. close_language?: boolean;
  36. }>;
  37. };
  38. type TaskDeleted = {
  39. project_id: string;
  40. task_deleted: boolean;
  41. };
  42. export declare class Tasks extends BaseCollection {
  43. protected static rootElementName: string;
  44. protected static rootElementNameSingular: string;
  45. protected static prefixURI: string;
  46. protected static elementClass: typeof Task;
  47. list(request_params: ListTaskParams): Promise<PaginatedResult<Task>>;
  48. create(task_params: CreateTaskParams, request_params: ProjectOnly): Promise<Task>;
  49. get(task_id: string | number, request_params: ProjectOnly): Promise<Task>;
  50. update(task_id: string | number, task_params: UpdateTaskParams, request_params: ProjectOnly): Promise<Task>;
  51. delete(task_id: string | number, request_params: ProjectOnly): Promise<TaskDeleted>;
  52. }
  53. export {};