languages.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { Language } from "../models/language";
  2. import { BaseCollection } from "./base_collection";
  3. import { PaginatedResult } from "../interfaces/paginated_result";
  4. import { ProjectWithPagination } from "../interfaces/project_with_pagination";
  5. import { ProjectOnly } from "../interfaces/project_only";
  6. import { BulkResult } from "../interfaces/bulk_result";
  7. import { PaginationParams } from "../interfaces/pagination_params";
  8. type LanguageDeleted = {
  9. project_id: string;
  10. language_deleted: boolean;
  11. };
  12. type CreateLanguageData = {
  13. lang_iso: string;
  14. custom_iso?: string;
  15. custom_name?: string;
  16. custom_plural_forms?: string[];
  17. };
  18. type UpdateLanguageData = {
  19. lang_iso?: string;
  20. lang_name?: string;
  21. plural_forms?: string[];
  22. };
  23. export declare class Languages extends BaseCollection {
  24. protected static rootElementName: string;
  25. protected static rootElementNameSingular: string;
  26. protected static prefixURI: string;
  27. protected static elementClass: typeof Language;
  28. system_languages(params?: PaginationParams): Promise<PaginatedResult<Language>>;
  29. list(request_params: ProjectWithPagination): Promise<PaginatedResult<Language>>;
  30. create(raw_body: CreateLanguageData | CreateLanguageData[], request_params: ProjectOnly): Promise<BulkResult<Language>>;
  31. get(lang_id: string | number, request_params: ProjectOnly): Promise<Language>;
  32. update(lang_id: string | number, lang_params: UpdateLanguageData, request_params: ProjectOnly): Promise<Language>;
  33. delete(lang_id: string | number, request_params: ProjectOnly): Promise<LanguageDeleted>;
  34. }
  35. export {};