generaltranslation
Version:
A language toolkit for AI developers
42 lines (41 loc) • 1.23 kB
TypeScript
import { Content, DataFormat } from '../../types';
/**
* ActionType is the type of action to perform on the request.
*
* @param standard - The standard action type (standard model).
* @param fast - The fast action type (mini model).
* @param string - Other model
*/
export type ActionType = 'standard' | 'fast' | string;
/**
* 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.
*/
export type EntryMetadata = {
context?: string;
id?: string;
maxChars?: number;
hash?: string;
dataFormat?: DataFormat;
sourceLocale?: string;
actionType?: ActionType;
timeout?: number;
regionCode?: string;
scriptCode?: string;
};
/**
* GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage}
*
* @param source - The source content to translate.
* @param targetLocale - The target locale to translate to.
* @param metadata - The metadata for the request.
*/
export type Entry = {
source: Content;
targetLocale?: string;
metadata?: EntryMetadata;
};