import { Content, CustomMapping, 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, 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; metadata?: EntryMetadata; }; //#endregion //#region src/id/types.d.ts type HashMetadata = { context?: string; /** * @deprecated Custom IDs are not used by current translation tooling. This * field will be removed in the next major version. Omit it to use the * content-based hash. */ id?: string; maxChars?: number; requiresReview?: boolean; dataFormat?: DataFormat; }; //#endregion //#region src/types-dir/config.d.ts /** * Options shared by the CLI, compiler, and runtimes under * `files.gt.parsingFlags` in gt.config.json. */ type GTParsingFlags = { autoderive?: boolean | { jsx?: boolean; strings?: boolean; }; includeSourceCodeContext?: boolean; enableAutoJsxInjection?: boolean; legacyGtReactImportSource?: boolean; devHotReload?: boolean | { strings?: boolean; jsx?: boolean; }; }; /** Configuration for generated GT translation files. */ type GTOutputFileConfig = { output?: string; publish?: boolean; parsingFlags?: GTParsingFlags; /** @deprecated Use `parsingFlags.includeSourceCodeContext` instead. */ includeSourceCodeContext?: boolean; }; /** * File configuration is primarily consumed by the CLI. Other packages only * inspect `files.gt`, but must still accept the complete gt.config.json shape. */ type GTFilesConfig = { gt?: GTOutputFileConfig; [fileType: string]: unknown; }; /** * The configuration stored in gt.config.json. * * All settings are optional. Runtimes default `defaultLocale` to * `libraryDefaultLocale` and `locales` to an empty list before resolving the * effective locale set. */ type GTConfig = { defaultLocale?: string; locales?: string[]; customMapping?: CustomMapping; enableI18n?: boolean; projectId?: string; devApiKey?: string; apiKey?: string; _versionId?: string; _branchId?: string; cacheUrl?: string | null; cacheExpiryTime?: number; runtimeUrl?: string | null; modelProvider?: string; _disableDevHotReload?: boolean; files?: GTFilesConfig; }; //#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 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; 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; requiresReview?: boolean; 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; }))[]; 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/translate/enqueueFiles.d.ts type EnqueueFilesOptions = { sourceLocale?: string; targetLocales: string[]; modelProvider?: string; force?: boolean; timeout?: number; }; //#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/translate/setupProject.d.ts type SetupProjectFileReference = Pick; type SetupProjectResult = { setupJobId: string; status: 'queued'; } | { status: 'completed'; }; type SetupProjectOptions = { force?: boolean; locales?: string[]; timeoutMs?: number; }; //#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/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; 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 type Metadata = { maxChars?: number; context?: string; id?: string; hash?: string; format?: string; requiresReview?: boolean; dataFormat?: DataFormat; sourceLocale?: string; actionType?: 'standard' | 'fast' | string; filePaths?: string[]; [key: string]: unknown; }; /** * 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 { UploadFilesOptions as $, AwaitJobsOptions as A, RuntimeTranslateManyOptions as At, OrphanedFile as B, VariableType as C, GTConfig as Ct, VariableTransformationSuffix as D, HashMetadata as Dt, TransformationPrefix as E, GTParsingFlags as Et, MoveMapping as F, TranslateManyResult as G, FileDataResult as H, MoveResult as I, TranslationResultReference as J, TranslationError as K, ProcessMovesOptions as L, JobResult as M, TranslateOptions as Mt, CheckJobStatusResult as N, SubmitUserEditDiff as O, ActionType as Ot, JobStatus as P, FileUpload as Q, ProcessMovesResponse as R, Variable as S, JsonValue as St, Transformation as T, GTOutputFileConfig as Tt, BranchQuery as U, FileDataQuery as V, BranchDataResult as W, PublishFileEntry as X, DownloadFileOptions as Y, PublishFilesResult as Z, Metadata as _, CheckFileTranslationsOptions as _t, DataFormat$1 as a, CreateTagResult as at, StringMessage$1 as b, JsonObject as bt, HTML_CONTENT_PROPS as c, DownloadFileBatchRequest as ct, I18nextMessage$1 as d, FileFormat as dt, UploadFilesResponse as et, IcuMessage$1 as f, FileReference as ft, LocaleProperties$1 as g, Updates as gt, JsxElement as h, EnqueueFilesResult as ht, CutoffFormatOptions$1 as i, CreateTagOptions as it, AwaitJobsResult as j, TranslateManyEntry as jt, SubmitUserEditDiffsPayload as k, EntryMetadata as kt, HtmlContentPropKeysRecord as l, DownloadFileBatchResult as lt, JsxChildren$1 as m, FileToUpload as mt, CustomMapping$1 as n, SetupProjectOptions as nt, FormatVariables$1 as o, EnqueueFilesOptions as ot, JsxChild as p, FileReferenceIds as pt, TranslationResult as q, CustomRegionMapping$1 as r, SetupProjectResult as rt, GTProp as s, DownloadFileBatchOptions as st, Content as t, SetupProjectFileReference as tt, HtmlContentPropValuesRecord as u, DownloadedFile as ut, StringContent as v, FileQuery as vt, InjectionType as w, GTFilesConfig as wt, TranslationRequestConfig as x, JsonPrimitive as xt, StringFormat$1 as y, FileQueryResult as yt, GetOrphanedFilesResult as z }; //# sourceMappingURL=types-algPgkHv.d.mts.map