UNPKG

@crowdin/app-project-module

Version:

Module that generates for you all common endpoints for serving standalone Crowdin App

25 lines (24 loc) 836 B
import Crowdin, { SourceStringsModel } from '@crowdin/crowdin-api-client'; import { CrowdinContextInfo, ModuleKey } from '../../types'; export interface CustomMTLogic extends ModuleKey { withContext?: boolean; batchSize?: number; maskEntities?: boolean; translate: (client: Crowdin, context: CrowdinContextInfo, projectId: number, source: string, target: string, strings: CustomMtString[]) => Promise<string[]>; validate?: (client: Crowdin) => Promise<void>; } export interface CustomMTRequest { strings: CustomMtString[]; } export type CustomMtString = string | { id: number; projectId: number; fileId: number; identifier: string; context: string; maxLength: number; isHidden: boolean; text: string | SourceStringsModel.PluralText; isPlural: boolean; pluralForm: any; };