import ApolloClient from "apollo-boost"; import LangFileClient from "./LangFileClient"; import { BatchTranslationRequest, FRAMEWORKS, LangConfig, StatusCode, TranslateFunctionCall, TranslationRequest } from "./types"; export default class TranslationClient { sourceDir: string; apolloClient: ApolloClient; apiKey: string; production: boolean; config: LangConfig; constructor(sourceDir: string, apiKey: string, configData: LangConfig); compileProgramAndFindTranslateCalls: (sourceDir: string, detectedFramework?: FRAMEWORKS | null) => Promise<{ javascript: TranslateFunctionCall[]; typescript: TranslateFunctionCall[]; python: TranslateFunctionCall[]; po: TranslateFunctionCall[]; }>; compilePythonProgramAndFindTranslateCalls: (source: string, isDirectory?: boolean) => Promise; compilePoFilesAndFindTranslateCalls: (source: string, isDirectory?: boolean) => Promise; compileTypescriptProgramAndFindTranslateCalls: (source: string, isDirectory?: boolean) => Promise; compileJavascriptProgramAndFindTranslateCalls: (source: string, isDirectory?: boolean) => Promise; requestManualTranslationsCost: (translateCalls: TranslateFunctionCall[], langFileClient: LangFileClient) => Promise<{ cost: number; translations: TranslationRequest[]; }>; updateRemoteTranslations: (srcPath: string) => Promise; requestTranslations: (translateCalls: TranslateFunctionCall[], langFileClient: LangFileClient) => Promise<{ validTranslationCalls: TranslateFunctionCall[]; invalidTranslationCalls: TranslateFunctionCall[]; error: StatusCode | null; newTranslatedStrings: string[]; jobId: string | null; }>; getValidTranslationRequests: (translateCalls: TranslateFunctionCall[], langFileClient: LangFileClient) => { batchTranslationRequests: BatchTranslationRequest[]; validTranslationCalls: TranslateFunctionCall[]; invalidTranslationCalls: TranslateFunctionCall[]; }; batchTranslationRequests: (translateCalls: TranslateFunctionCall[], langFileClient: LangFileClient) => BatchTranslationRequest[]; receiveCompletedTranslations: () => Promise; isNotJustVariablesAndParameters: (translateCall: TranslateFunctionCall) => boolean; doesNotContainVariables: (translateCall: TranslateFunctionCall) => boolean; canBeParsedByMessageFormat: (translateCall: TranslateFunctionCall) => boolean; }