import { Content, Content as Content$1, CustomMapping as CustomMapping$1, CustomRegionMapping as CustomRegionMapping$1, CutoffFormatOptions as CutoffFormatOptions$1, DataFormat, DataFormat as DataFormat$1, FormatVariables as FormatVariables$1, GTProp, HTML_CONTENT_PROPS, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, I18nextMessage as I18nextMessage$1, IcuMessage, IcuMessage as IcuMessage$1, JsxChild, JsxChildren, JsxChildren as JsxChildren$1, JsxElement, LocaleProperties as LocaleProperties$1, StringContent, StringFormat as StringFormat$1, StringMessage, StringMessage as StringMessage$1, Variable, Variable as Variable$1, VariableType } from "@generaltranslation/format/types"; //#region src/types-dir/api/entry.d.ts /** * ActionType is the type of action to perform on the request. * * @param fast - The fast action type (mini model). */ type ActionType = 'fast'; /** * EntryMetadata is the metadata for a GTRequest. * * @param context - The context of the request. * @param id - The ID of the request. * @param maxChars - The maxChars of the request. * @param hash - The hash of the request. */ type EntryMetadata = { id?: string; hash?: string; context?: string; maxChars?: number; dataFormat?: DataFormat$1; actionType?: ActionType; }; type RuntimeTranslateManyOptions = { sourceLocale?: string; modelProvider?: string; [key: string]: unknown; }; type TranslateOptions = RuntimeTranslateManyOptions & { targetLocale: string; }; /** * TranslateManyEntry is the input type for translateMany. * Can be a plain string or an object with source and entry metadata fields. */ type TranslateManyEntry = string | { source: Content$1; metadata?: EntryMetadata; }; //#endregion //#region src/id/types.d.ts type HashMetadata = { context?: string; id?: string; maxChars?: number; dataFormat?: DataFormat; }; //#endregion //#region src/types-dir/api/translationStatus.d.ts type TranslationStatusResult = { count: number; availableLocales: string[]; locales: string[]; localesWaitingForApproval: string[]; }; //#endregion //#region src/types-dir/api/json.d.ts type JsonPrimitive = string | number | boolean | null; type JsonValue = JsonPrimitive | JsonValue[] | JsonObject; type JsonObject = { [key: string]: JsonValue; }; //#endregion //#region src/types-dir/api/checkFileTranslations.d.ts type FileTranslationQuery = { versionId: string; fileName?: string; fileId?: string; locale: string; }; type CheckFileTranslationsOptions = { timeout?: number; }; type FileQuery = { fileId: string; branchId?: string; versionId?: string; }; type FileQueryResult = { sourceFile: { id: string; fileId: string; versionId: string; sourceLocale: string; fileName: string; fileFormat: string; dataFormat: string | null; createdAt: string; updatedAt: string; approvalRequiredAt: string | null; locales: string[]; }; translations: { locale: string; completedAt: string | null; approvedAt: string | null; publishedAt: string | null; createdAt: string | null; updatedAt: string | null; }[]; }; //#endregion //#region src/types-dir/api/enqueueFiles.d.ts type UpdateMetadata = { id?: string; hash?: string; context?: string; maxChars?: number; dataFormat?: DataFormat; actionType?: 'standard' | 'fast' | string; staticId?: string; format?: string; filePaths?: string[]; sourceCode?: unknown; contextDeriveExpr?: unknown; _contextDeriveExpr?: unknown; [key: string]: unknown; }; type Updates = ({ metadata: UpdateMetadata; } & ({ dataFormat: 'JSX'; source: JsxChildren; } | { dataFormat: 'ICU'; source: string; } | { dataFormat: 'I18NEXT'; source: string; } | { dataFormat: 'STRING'; source: string; }))[]; /** * Options for enqueueing files * @param requireApproval - Whether to require approval for the files. * @param description - Optional description for the project. * @param sourceLocale - The project's source locale. * @param targetLocales - The locales to translate the files to. * @param version - Optional custom version ID to specify. * @param timeout - Optional timeout for the request. * @param modelProvider - Optional model provider to use. */ type EnqueueFilesOptions = { requireApproval?: boolean; description?: string; sourceLocale?: string; targetLocales: string[]; version?: string; _versionId?: string; timeout?: number; modelProvider?: string; force?: boolean; }; type EnqueueFilesResult = { jobData: { [jobId: string]: { sourceFileId: string; fileId: string; versionId: string; branchId: string; targetLocale: string; projectId: string; force: boolean; modelProvider?: string; }; }; locales: string[]; message: string; }; //#endregion //#region src/types-dir/api/file.d.ts type FileFormat = 'GTJSON' | 'JSON' | 'PO' | 'POT' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML' | 'TXT' | 'TWILIO_CONTENT_JSON'; /** * Metadata for files or entries. */ type FormatMetadata = JsonObject | Updates[number]['metadata']; /** * File object structure for uploading files. * @see {@link FileReferenceOptionalBranchId} * @property {string} content - Content of the file. * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.) * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file * @property {string} [incomingBranchId] - The ID of the incoming branch of the file. * @property {string} [checkedOutBranchId] - The ID of the checked-out branch of the file. */ type FileToUpload = Omit & { content: string; locale: string; transformFormat?: FileFormat; formatMetadata?: FormatMetadata; branchId?: string; incomingBranchId?: string; checkedOutBranchId?: string; }; /** * File object structure for referencing files. * @property {string} fileId - The ID of the file. * @property {string} versionId - The ID of the version of the file * @property {string} branchId - The ID of the branch of the file * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.) * @property {string} fileName - The name of the file. * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.). * @property {DataFormat} [dataFormat] - Optional format of the data within the file. */ type FileReference = { fileId: string; versionId: string; branchId: string; fileName: string; fileFormat: FileFormat; transformFormat?: FileFormat; dataFormat?: DataFormat; }; /** * File reference object structure for referencing files. * @see {@link FileReference} * @property {string} [branchId] - The ID of the branch of the file */ type FileReferenceIds = Omit & { branchId?: string; fileName?: string; fileFormat?: FileFormat; transformFormat?: FileFormat; dataFormat?: DataFormat; }; //#endregion //#region src/types-dir/api/downloadFileBatch.d.ts type DownloadFileBatchRequest = { fileId: string; branchId?: string; versionId?: string; locale?: string; useLatestAvailableVersion?: boolean; }[]; type DownloadFileBatchOptions = { timeout?: number; }; type DownloadedFile = { id: string; branchId: string; fileId: string; versionId: string; locale?: string; fileName?: string; data: string; metadata: JsonObject; fileFormat: FileFormat; }; type DownloadFileBatchResult = { files: DownloadedFile[]; count: number; }; //#endregion //#region src/types-dir/api/fetchTranslations.d.ts type FetchTranslationsOptions = { timeout?: number; }; type RetrievedTranslation = { locale: string; translation: Content; }; type RetrievedTranslations = RetrievedTranslation[]; type FetchTranslationsResult = { translations: RetrievedTranslations; }; //#endregion //#region src/translate/createTag.d.ts type CreateTagFileReference = { fileId: string; versionId: string; branchId: string; }; type CreateTagOptions = { tagId: string; files: CreateTagFileReference[]; message?: string; }; type CreateTagResult = { tag: { id: string; tagId: string; message: string | null; createdAt: string; updatedAt: string; }; }; //#endregion //#region src/types-dir/api/uploadFiles.d.ts /** * Metadata stored alongside GTJSON file entries. * Keys correspond to the entry id/hash in the GTJSON body. */ type GTJsonFormatMetadata = Record; type FileUpload = { branchId?: string; incomingBranchId?: string; checkedOutBranchId?: string; content: string; fileName: string; fileFormat: FileFormat; transformFormat?: FileFormat; dataFormat?: DataFormat; locale: string; formatMetadata?: GTJsonFormatMetadata | FormatMetadata; versionId?: string; fileId?: string; }; type UploadFilesOptions = { sourceLocale: string; modelProvider?: string; timeout?: number; }; type UploadFilesResponse = { uploadedFiles: FileReference[]; count: number; message: string; }; //#endregion //#region src/types-dir/api/enqueueEntries.d.ts type EnqueueEntriesOptions = { timeout?: number; sourceLocale?: string; targetLocales?: string[]; dataFormat?: DataFormat; version?: string; description?: string; requireApproval?: boolean; modelProvider?: string; }; type EnqueueEntriesResult = { versionId: string; locales: string[]; message: string; projectSettings: { cdnEnabled: boolean; requireApproval: boolean; }; }; //#endregion //#region src/translate/publishFiles.d.ts type PublishFileEntry = { fileId: string; versionId: string; branchId?: string; publish: boolean; fileName?: string; }; type PublishFilesResult = { results: { fileId: string; versionId: string; locale?: string; branchId: string; success: boolean; error?: string; }[]; }; //#endregion //#region src/types-dir/api/downloadFile.d.ts type DownloadFileOptions = { timeout?: number; }; //#endregion //#region src/types-dir/api/translate.d.ts /** * TranslationResultReference is used to store the reference for a translation result. */ type TranslationResultReference = { id?: string; hash: string; }; /** * TypedResult is a union type that represents the different types of translations that can be returned. */ type TypedResult = { translation: JsxChildren; dataFormat: 'JSX'; } | { translation: I18nextMessage | IcuMessage | StringMessage; dataFormat: 'ICU' | 'I18NEXT' | 'STRING'; }; /** * RequestError is a type that represents an error that occurred during a translation request. */ type TranslationError = { success: false; error: string; code: number; }; /** * RequestSuccess is a type that represents a successful translation request. */ type RequestSuccess = TypedResult & { success: true; locale: string; }; type TranslationResult = RequestSuccess | TranslationError; //#endregion //#region src/types-dir/api/translateMany.d.ts /** * BatchTranslationResult is the result of a batch translation request. */ type TranslateManyResult = TranslationResult[]; //#endregion //#region src/types-dir/api/branch.d.ts type BranchDataResult = { branches: { id: string; name: string; }[]; defaultBranch: { id: string; name: string; } | null; }; //#endregion //#region src/translate/queryBranchData.d.ts type BranchQuery = { branchNames: string[]; }; //#endregion //#region src/translate/queryFileData.d.ts type FileDataQuery = { sourceFiles?: { fileId: string; versionId: string; branchId: string; }[]; translatedFiles?: { fileId: string; versionId: string; branchId: string; locale: string; }[]; }; type FileDataResult = { sourceFiles?: { branchId: string; fileId: string; versionId: string; fileName: string; fileFormat: string; dataFormat: string | null; createdAt: string; updatedAt: string; approvalRequiredAt: string | null; publishedAt: string | null; locales: string[]; sourceLocale: string; }[]; translatedFiles?: { branchId: string; fileId: string; versionId: string; fileFormat: string; dataFormat: string | null; createdAt: string; updatedAt: string; approvedAt: string | null; publishedAt: string | null; completedAt: string | null; locale: string; }[]; }; //#endregion //#region src/translate/getOrphanedFiles.d.ts type OrphanedFile = { fileId: string; versionId: string; fileName: string; }; type GetOrphanedFilesResult = { orphanedFiles: OrphanedFile[]; }; //#endregion //#region src/translate/processFileMoves.d.ts type MoveMapping = { oldFileId: string; newFileId: string; newFileName: string; }; type MoveResult = { oldFileId: string; newFileId: string; success: boolean; newSourceFileId?: string; clonedTranslationsCount?: number; error?: string; }; type ProcessMovesResponse = { results: MoveResult[]; summary: { total: number; succeeded: number; failed: number; }; }; type ProcessMovesOptions = { timeout?: number; branchId?: string; }; //#endregion //#region src/translate/checkJobStatus.d.ts type JobStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'unknown'; type CheckJobStatusResult = { jobId: string; status: JobStatus; error?: { message: string; }; }[]; //#endregion //#region src/translate/awaitJobs.d.ts type AwaitJobsOptions = { /** Polling interval in seconds. Defaults to 5. */pollingIntervalSeconds?: number; /** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */ timeoutSeconds?: number; }; type JobResult = { jobId: string; status: JobStatus; error?: { message: string; }; }; type AwaitJobsResult = { /** Whether all jobs completed (none still in progress). */complete: boolean; jobs: JobResult[]; }; //#endregion //#region src/translate/submitUserEditDiffs.d.ts type SubmitUserEditDiff = { fileName: string; locale: string; diff: string; branchId: string; versionId: string; fileId: string; localContent: string; }; type SubmitUserEditDiffsPayload = { diffs: SubmitUserEditDiff[]; }; //#endregion //#region src/types-dir/transformations.d.ts /** * Transformations are made from a prefix and a suffix. */ type Transformation = BaseTransformation | `${BaseTransformation}-${InjectionType}`; type BaseTransformation = 'translate-client' | 'translate-server' | 'translate-runtime' | 'variable-variable' | 'variable-currency' | 'variable-datetime' | 'variable-number' | 'variable-relative-time' | 'plural' | 'branch' | 'derive'; type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment' | 'derive'; type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'relative-time'; type InjectionType = 'automatic' | 'manual'; //#endregion //#region src/types.d.ts /** * @deprecated Use {@link Content} instead. */ type _Content = string | Array; type Metadata = { maxChars?: number; context?: string; id?: string; hash?: string; format?: string; dataFormat?: DataFormat; sourceLocale?: string; actionType?: 'standard' | 'fast' | string; filePaths?: string[]; [key: string]: unknown; }; /** * @deprecated This type is deprecated and will be removed in a future version. */ type Update = { type: 'content'; data: { source: _Content; metadata: Metadata; }; } | { type: 'jsx'; data: { source: JsxChildren; metadata: Metadata; }; }; /** * @deprecated This type is deprecated and will be removed in a future version. */ type Request = { type: 'content'; data: { source: _Content; targetLocale: string; metadata: Metadata; }; } | { type: 'jsx'; data: { source: JsxChildren; targetLocale: string; metadata: Metadata; }; }; /** * @deprecated Use {@link TranslationResult} instead. */ type ContentTranslationResult = { translation: _Content; locale: string; reference?: { id: string; key: string; }; }; /** * @deprecated Use {@link TranslationResult} instead. */ type IcuTranslationResult = { translation: string; locale: string; reference?: { id: string; key: string; }; }; /** * @deprecated Use {@link TranslationResult} instead. */ type JsxTranslationResult = { translation: JsxChildren; locale: string; reference?: { id: string; key: string; }; }; /** * TranslationRequestConfig is used to configure the translation request. * * @param projectId - The project ID of the translation request. * @param baseUrl - The base URL of the translation request. * @param apiKey - The API key of the translation request. */ type TranslationRequestConfig = { projectId: string; baseUrl?: string; apiKey?: string; }; //#endregion export { TranslationResult as $, InjectionType as A, JsonPrimitive as At, JobStatus as B, StringFormat$1 as C, EnqueueFilesResult as Ct, Variable$1 as D, FileQueryResult as Dt, Update as E, FileQuery as Et, SubmitUserEditDiffsPayload as F, EntryMetadata as Ft, GetOrphanedFilesResult as G, MoveResult as H, AwaitJobsOptions as I, RuntimeTranslateManyOptions as It, FileDataResult as J, OrphanedFile as K, AwaitJobsResult as L, TranslateManyEntry as Lt, TransformationPrefix as M, TranslationStatusResult as Mt, VariableTransformationSuffix as N, HashMetadata as Nt, VariableType as O, FileTranslationQuery as Ot, SubmitUserEditDiff as P, ActionType as Pt, TranslationError as Q, JobResult as R, TranslateOptions as Rt, StringContent as S, EnqueueFilesOptions as St, TranslationRequestConfig as T, CheckFileTranslationsOptions as Tt, ProcessMovesOptions as U, MoveMapping as V, ProcessMovesResponse as W, BranchDataResult as X, BranchQuery as Y, TranslateManyResult as Z, JsxElement as _, DownloadedFile as _t, CutoffFormatOptions$1 as a, EnqueueEntriesResult as at, Metadata as b, FileReferenceIds as bt, GTProp as c, UploadFilesResponse as ct, HtmlContentPropValuesRecord as d, FetchTranslationsOptions as dt, TranslationResultReference as et, I18nextMessage$1 as f, FetchTranslationsResult as ft, JsxChildren$1 as g, DownloadFileBatchResult as gt, JsxChild as h, DownloadFileBatchRequest as ht, CustomRegionMapping$1 as i, EnqueueEntriesOptions as it, Transformation as j, JsonValue as jt, _Content as k, JsonObject as kt, HTML_CONTENT_PROPS as l, CreateTagOptions as lt, IcuTranslationResult as m, DownloadFileBatchOptions as mt, ContentTranslationResult as n, PublishFileEntry as nt, DataFormat$1 as o, FileUpload as ot, IcuMessage$1 as p, RetrievedTranslations as pt, FileDataQuery as q, CustomMapping$1 as r, PublishFilesResult as rt, FormatVariables$1 as s, UploadFilesOptions as st, Content$1 as t, DownloadFileOptions as tt, HtmlContentPropKeysRecord as u, CreateTagResult as ut, JsxTranslationResult as v, FileFormat as vt, StringMessage$1 as w, Updates as wt, Request as x, FileToUpload as xt, LocaleProperties$1 as y, FileReference as yt, CheckJobStatusResult as z }; //# sourceMappingURL=types-Db2Dn3oN.d.mts.map