generaltranslation 7.0.0 → 7.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +108 -0
- package/dist/index.cjs.min.cjs +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +223 -5
- package/dist/index.esm.min.mjs +1 -1
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/logging/errors.d.ts +10 -0
- package/dist/logging/logger.d.ts +117 -0
- package/dist/logging/warnings.d.ts +2 -0
- package/dist/translate/checkFileTranslations.d.ts +1 -0
- package/dist/translate/checkTranslationStatus.d.ts +1 -0
- package/dist/translate/downloadFile.d.ts +1 -0
- package/dist/translate/downloadFileBatch.d.ts +1 -0
- package/dist/translate/enqueueEntries.d.ts +1 -0
- package/dist/translate/enqueueFiles.d.ts +1 -0
- package/dist/translate/fetchTranslations.d.ts +1 -0
- package/dist/translate/translate.d.ts +1 -0
- package/dist/translate/translateMany.d.ts +1 -0
- package/dist/translate/utils/fetchWithTimeout.d.ts +1 -0
- package/dist/translate/utils/generateRequestHeaders.d.ts +6 -0
- package/dist/translate/utils/handleFetchError.d.ts +1 -0
- package/dist/translate/utils/validateResponse.d.ts +1 -0
- package/dist/types-dir/checkFileTranslations.d.ts +12 -0
- package/dist/types-dir/content.d.ts +49 -0
- package/dist/types-dir/downloadFile.d.ts +3 -0
- package/dist/types-dir/downloadFileBatch.d.ts +22 -0
- package/dist/types-dir/enqueueEntries.d.ts +20 -0
- package/dist/types-dir/enqueueFiles.d.ts +45 -0
- package/dist/types-dir/entry.d.ts +37 -0
- package/dist/types-dir/fetchTranslations.d.ts +11 -0
- package/dist/types-dir/file.d.ts +23 -0
- package/dist/types-dir/translate.d.ts +34 -0
- package/dist/types-dir/translateMany.d.ts +5 -0
- package/dist/types-dir/translationStatus.d.ts +9 -0
- package/dist/types-dir/variables.d.ts +9 -0
- package/dist/types.cjs.min.cjs.map +1 -1
- package/dist/types.d.ts +262 -27
- package/dist/types.esm.min.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/settings/errors.d.ts +0 -4
package/dist/internal.d.ts
CHANGED
@@ -2,8 +2,8 @@ export { defaultBaseUrl, defaultCacheUrl, defaultRuntimeApiUrl, } from './settin
|
|
2
2
|
export { libraryDefaultLocale } from './settings/settings';
|
3
3
|
export { pluralForms, isAcceptedPluralForm } from './settings/plurals';
|
4
4
|
import _getPluralForm from './locales/getPluralForm';
|
5
|
-
import {
|
5
|
+
import { _Content, JsxChild, JsxChildren, JsxElement } from './types';
|
6
6
|
import { LocaleProperties } from './types';
|
7
7
|
import isVariable from './utils/isVariable';
|
8
8
|
import { minifyVariableType } from './utils/minify';
|
9
|
-
export { _getPluralForm as getPluralForm, JsxChildren,
|
9
|
+
export { _getPluralForm as getPluralForm, JsxChildren, _Content, JsxChild, JsxElement, LocaleProperties, isVariable, minifyVariableType, };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare const translationTimeoutError: (timeout: number) => string;
|
2
|
+
export declare const translationRequestFailedError: (error: string) => string;
|
3
|
+
export declare const apiError: (status: number, statusText: string, error: string) => string;
|
4
|
+
export declare const invalidAuthError = "GT error: Invalid authentication.";
|
5
|
+
export declare const noTargetLocaleProvidedError: (functionName: string) => string;
|
6
|
+
export declare const noSourceLocaleProvidedError: (functionName: string) => string;
|
7
|
+
export declare const noProjectIdProvidedError: (functionName: string) => string;
|
8
|
+
export declare const noApiKeyProvidedError: (functionName: string) => string;
|
9
|
+
export declare const invalidLocaleError: (locale: string) => string;
|
10
|
+
export declare const invalidLocalesError: (locales: string[]) => string;
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/**
|
2
|
+
* Comprehensive logging system for the General Translation library
|
3
|
+
* Provides structured logging with multiple levels and configurable output
|
4
|
+
*/
|
5
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
6
|
+
export interface LogEntry {
|
7
|
+
level: LogLevel;
|
8
|
+
message: string;
|
9
|
+
timestamp: Date;
|
10
|
+
context?: string;
|
11
|
+
metadata?: Record<string, any>;
|
12
|
+
}
|
13
|
+
export interface LoggerConfig {
|
14
|
+
/** Minimum log level to output */
|
15
|
+
level: LogLevel;
|
16
|
+
/** Whether to include timestamps in log output */
|
17
|
+
includeTimestamp: boolean;
|
18
|
+
/** Whether to include context information */
|
19
|
+
includeContext: boolean;
|
20
|
+
/** Custom prefix for all log messages */
|
21
|
+
prefix?: string;
|
22
|
+
/** Whether to output to console (default: true) */
|
23
|
+
enableConsole: boolean;
|
24
|
+
/** Custom log handlers */
|
25
|
+
handlers?: LogHandler[];
|
26
|
+
}
|
27
|
+
export interface LogHandler {
|
28
|
+
handle(entry: LogEntry): void;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Console log handler that outputs formatted messages to console
|
32
|
+
*/
|
33
|
+
export declare class ConsoleLogHandler implements LogHandler {
|
34
|
+
private config;
|
35
|
+
constructor(config: LoggerConfig);
|
36
|
+
handle(entry: LogEntry): void;
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Main Logger class providing structured logging capabilities
|
40
|
+
*/
|
41
|
+
export declare class Logger {
|
42
|
+
private config;
|
43
|
+
private handlers;
|
44
|
+
constructor(config?: Partial<LoggerConfig>);
|
45
|
+
/**
|
46
|
+
* Add a custom log handler
|
47
|
+
*/
|
48
|
+
addHandler(handler: LogHandler): void;
|
49
|
+
/**
|
50
|
+
* Remove a log handler
|
51
|
+
*/
|
52
|
+
removeHandler(handler: LogHandler): void;
|
53
|
+
/**
|
54
|
+
* Update logger configuration
|
55
|
+
*/
|
56
|
+
configure(config: Partial<LoggerConfig>): void;
|
57
|
+
/**
|
58
|
+
* Check if a log level should be output based on current configuration
|
59
|
+
*/
|
60
|
+
private shouldLog;
|
61
|
+
/**
|
62
|
+
* Internal logging method that creates log entries and passes them to handlers
|
63
|
+
*/
|
64
|
+
private log;
|
65
|
+
/**
|
66
|
+
* Log a debug message
|
67
|
+
* Used for detailed diagnostic information, typically of interest only when diagnosing problems
|
68
|
+
*/
|
69
|
+
debug(message: string, context?: string, metadata?: Record<string, any>): void;
|
70
|
+
/**
|
71
|
+
* Log an info message
|
72
|
+
* Used for general information about application operation
|
73
|
+
*/
|
74
|
+
info(message: string, context?: string, metadata?: Record<string, any>): void;
|
75
|
+
/**
|
76
|
+
* Log a warning message
|
77
|
+
* Used for potentially problematic situations that don't prevent operation
|
78
|
+
*/
|
79
|
+
warn(message: string, context?: string, metadata?: Record<string, any>): void;
|
80
|
+
/**
|
81
|
+
* Log an error message
|
82
|
+
* Used for error events that might still allow the application to continue
|
83
|
+
*/
|
84
|
+
error(message: string, context?: string, metadata?: Record<string, any>): void;
|
85
|
+
/**
|
86
|
+
* Create a child logger with a specific context
|
87
|
+
*/
|
88
|
+
child(context: string): ContextLogger;
|
89
|
+
/**
|
90
|
+
* Get current logger configuration
|
91
|
+
*/
|
92
|
+
getConfig(): LoggerConfig;
|
93
|
+
}
|
94
|
+
/**
|
95
|
+
* Context logger that automatically includes context information
|
96
|
+
*/
|
97
|
+
export declare class ContextLogger {
|
98
|
+
private logger;
|
99
|
+
private context;
|
100
|
+
constructor(logger: Logger, context: string);
|
101
|
+
debug(message: string, metadata?: Record<string, any>): void;
|
102
|
+
info(message: string, metadata?: Record<string, any>): void;
|
103
|
+
warn(message: string, metadata?: Record<string, any>): void;
|
104
|
+
error(message: string, metadata?: Record<string, any>): void;
|
105
|
+
child(childContext: string): ContextLogger;
|
106
|
+
}
|
107
|
+
export declare const defaultLogger: Logger;
|
108
|
+
export declare const debug: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
109
|
+
export declare const info: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
110
|
+
export declare const warn: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
111
|
+
export declare const error: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
112
|
+
export declare const fetchLogger: ContextLogger;
|
113
|
+
export declare const validationLogger: ContextLogger;
|
114
|
+
export declare const formattingLogger: ContextLogger;
|
115
|
+
export declare const localeLogger: ContextLogger;
|
116
|
+
export declare const gtInstanceLogger: ContextLogger;
|
117
|
+
export { Logger as GTLogger };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export declare const formatI18nextWarning = "Warning: formatI18next is not currently supported but will be implemented in a future version. Use _formatMessage for current ICU message format support.";
|
2
|
+
export declare const formatJsxWarning = "Warning: formatJsx is not currently supported but will be implemented in a future version. Use _formatMessage for current ICU message format support.";
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { TranslationRequestConfig } from '../../types';
|
2
|
+
export default function generateRequestHeaders(config: TranslationRequestConfig, excludeContentType?: boolean): {
|
3
|
+
'x-gt-project-id': string;
|
4
|
+
'x-gt-api-key'?: string | undefined;
|
5
|
+
'Content-Type'?: string | undefined;
|
6
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function handleFetchError(error: unknown, timeout: number): never;
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function validateResponse(response: Response): Promise<void>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CompletedFileTranslationData } from './file';
|
2
|
+
export type FileTranslationQuery = {
|
3
|
+
versionId: string;
|
4
|
+
fileName: string;
|
5
|
+
locale: string;
|
6
|
+
};
|
7
|
+
export type CheckFileTranslationsOptions = {
|
8
|
+
timeout?: number;
|
9
|
+
};
|
10
|
+
export type CheckFileTranslationsResult = {
|
11
|
+
translations: CompletedFileTranslationData[];
|
12
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { Variable } from './variables';
|
2
|
+
/**
|
3
|
+
* Map of data-_gt properties to their corresponding React props
|
4
|
+
*/
|
5
|
+
export declare const HTML_CONTENT_PROPS: {
|
6
|
+
readonly pl: "placeholder";
|
7
|
+
readonly ti: "title";
|
8
|
+
readonly alt: "alt";
|
9
|
+
readonly arl: "aria-label";
|
10
|
+
readonly arb: "aria-labelledby";
|
11
|
+
readonly ard: "aria-describedby";
|
12
|
+
};
|
13
|
+
export type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
|
14
|
+
export type HtmlContentPropValuesRecord = Partial<Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>>;
|
15
|
+
/**
|
16
|
+
* GTProp is an internal property used to contain data for translating and rendering elements.
|
17
|
+
* note, transformations are only read on the server side if they are 'plural' or 'branch'
|
18
|
+
*/
|
19
|
+
export type GTProp = {
|
20
|
+
b?: Record<string, JsxChildren>;
|
21
|
+
t?: 'p' | 'b';
|
22
|
+
} & HtmlContentPropKeysRecord;
|
23
|
+
export type JsxElement = {
|
24
|
+
t?: string;
|
25
|
+
i?: number;
|
26
|
+
d?: GTProp;
|
27
|
+
c?: JsxChildren;
|
28
|
+
};
|
29
|
+
export type JsxChild = string | JsxElement | Variable;
|
30
|
+
/**
|
31
|
+
* The format of the content
|
32
|
+
*/
|
33
|
+
export type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
|
34
|
+
/**
|
35
|
+
* A content type representing JSX, ICU, and I18next messages
|
36
|
+
*/
|
37
|
+
export type Content = JsxChildren | IcuMessage | I18nextMessage;
|
38
|
+
/**
|
39
|
+
* A content type representing JSX elements
|
40
|
+
*/
|
41
|
+
export type JsxChildren = JsxChild | JsxChild[];
|
42
|
+
/**
|
43
|
+
* A content type representing ICU messages
|
44
|
+
*/
|
45
|
+
export type IcuMessage = string;
|
46
|
+
/**
|
47
|
+
* A content type representing I18next messages
|
48
|
+
*/
|
49
|
+
export type I18nextMessage = string;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export type DownloadFileBatchOptions = {
|
2
|
+
timeout?: number;
|
3
|
+
};
|
4
|
+
export type BatchDownloadResult = {
|
5
|
+
translationId: string;
|
6
|
+
fileName?: string;
|
7
|
+
success: boolean;
|
8
|
+
content?: string;
|
9
|
+
contentType?: string;
|
10
|
+
error?: string;
|
11
|
+
};
|
12
|
+
type File = {
|
13
|
+
id: string;
|
14
|
+
fileName: string;
|
15
|
+
data: string;
|
16
|
+
metadata: any;
|
17
|
+
};
|
18
|
+
export type DownloadFileBatchResult = {
|
19
|
+
files: File[];
|
20
|
+
count: number;
|
21
|
+
};
|
22
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { DataFormat } from './content';
|
2
|
+
export type { Updates } from './enqueueFiles';
|
3
|
+
export type EnqueueEntriesOptions = {
|
4
|
+
timeout?: number;
|
5
|
+
sourceLocale?: string;
|
6
|
+
targetLocales?: string[];
|
7
|
+
dataFormat?: DataFormat;
|
8
|
+
version?: string;
|
9
|
+
description?: string;
|
10
|
+
requireApproval?: boolean;
|
11
|
+
};
|
12
|
+
export type EnqueueEntriesResult = {
|
13
|
+
versionId: string;
|
14
|
+
locales: string[];
|
15
|
+
message: string;
|
16
|
+
projectSettings: {
|
17
|
+
cdnEnabled: boolean;
|
18
|
+
requireApproval: boolean;
|
19
|
+
};
|
20
|
+
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { DataFormat, JsxChildren } from './content';
|
2
|
+
import { CompletedFileTranslationData, FileFormat } from './file';
|
3
|
+
export type Updates = ({
|
4
|
+
metadata: Record<string, any>;
|
5
|
+
} & ({
|
6
|
+
dataFormat: 'JSX';
|
7
|
+
source: JsxChildren;
|
8
|
+
} | {
|
9
|
+
dataFormat: 'ICU';
|
10
|
+
source: string;
|
11
|
+
} | {
|
12
|
+
dataFormat: 'I18NEXT';
|
13
|
+
source: string;
|
14
|
+
}))[];
|
15
|
+
/**
|
16
|
+
* File object structure for enqueueing files
|
17
|
+
* @param content - The content of the file
|
18
|
+
* @param fileName - The name of the file
|
19
|
+
* @param fileFormat - The format of the file (JSON, MDX, MD, etc.)
|
20
|
+
* @param dataFormat - The format of the data within the file
|
21
|
+
*/
|
22
|
+
export interface FileToTranslate {
|
23
|
+
content: string;
|
24
|
+
fileName: string;
|
25
|
+
fileFormat: FileFormat;
|
26
|
+
dataFormat?: DataFormat;
|
27
|
+
}
|
28
|
+
export type EnqueueFilesOptions = {
|
29
|
+
publish: boolean;
|
30
|
+
description?: string;
|
31
|
+
sourceLocale?: string;
|
32
|
+
targetLocales: string[];
|
33
|
+
_versionId?: string;
|
34
|
+
timeout?: number;
|
35
|
+
};
|
36
|
+
export type RequiredEnqueueFilesOptions = EnqueueFilesOptions & Required<Pick<EnqueueFilesOptions, 'sourceLocale'>>;
|
37
|
+
export type EnqueueFilesResult = {
|
38
|
+
translations: CompletedFileTranslationData[];
|
39
|
+
data: Record<string, {
|
40
|
+
fileName: string;
|
41
|
+
versionId: string;
|
42
|
+
}>;
|
43
|
+
locales: string[];
|
44
|
+
message: string;
|
45
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { Content, DataFormat } from '../types';
|
2
|
+
/**
|
3
|
+
* ActionType is the type of action to perform on the request.
|
4
|
+
*
|
5
|
+
* @param standard - The standard action type (standard model).
|
6
|
+
* @param fast - The fast action type (mini model).
|
7
|
+
* @param string - Other model
|
8
|
+
*/
|
9
|
+
export type ActionType = 'standard' | 'fast' | string;
|
10
|
+
/**
|
11
|
+
* EntryMetadata is the metadata for a GTRequest.
|
12
|
+
*
|
13
|
+
* @param context - The context of the request.
|
14
|
+
* @param id - The id of the request.
|
15
|
+
* @param hash - The hash of the request.
|
16
|
+
*/
|
17
|
+
export type EntryMetadata = {
|
18
|
+
context?: string;
|
19
|
+
id?: string;
|
20
|
+
hash?: string;
|
21
|
+
dataFormat?: DataFormat;
|
22
|
+
sourceLocale?: string;
|
23
|
+
actionType?: ActionType;
|
24
|
+
timeout?: number;
|
25
|
+
};
|
26
|
+
/**
|
27
|
+
* GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage}
|
28
|
+
*
|
29
|
+
* @param source - The source content to translate.
|
30
|
+
* @param targetLocale - The target locale to translate to.
|
31
|
+
* @param requestMetadata - The metadata for the request.
|
32
|
+
*/
|
33
|
+
export type Entry = {
|
34
|
+
source: Content;
|
35
|
+
targetLocale?: string;
|
36
|
+
requestMetadata?: EntryMetadata;
|
37
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export type FetchTranslationsOptions = {
|
2
|
+
timeout?: number;
|
3
|
+
};
|
4
|
+
export type RetrievedTranslation = {
|
5
|
+
locale: string;
|
6
|
+
translation: any;
|
7
|
+
};
|
8
|
+
export type RetrievedTranslations = RetrievedTranslation[];
|
9
|
+
export type FetchTranslationsResult = {
|
10
|
+
translations: RetrievedTranslations;
|
11
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Entry } from './entry';
|
2
|
+
export type FileFormat = 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS';
|
3
|
+
export type FileMetadata = {
|
4
|
+
filePath: string;
|
5
|
+
fileFormat: FileFormat;
|
6
|
+
context?: string;
|
7
|
+
sourceLocale?: string;
|
8
|
+
hash?: string;
|
9
|
+
};
|
10
|
+
export type File = {
|
11
|
+
source: Entry[] | string;
|
12
|
+
fileMetadata: FileMetadata;
|
13
|
+
};
|
14
|
+
export type CompletedFileTranslationData = {
|
15
|
+
locale: string;
|
16
|
+
metadata: any;
|
17
|
+
fileId: string;
|
18
|
+
fileName: string;
|
19
|
+
versionId: string;
|
20
|
+
id: string;
|
21
|
+
isReady: boolean;
|
22
|
+
downloadUrl: string;
|
23
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { I18nextMessage, IcuMessage, JsxChildren } from './content';
|
2
|
+
/**
|
3
|
+
* TranslationResultReference is used to store the reference for a translation result.
|
4
|
+
*/
|
5
|
+
export type TranslationResultReference = {
|
6
|
+
id?: string;
|
7
|
+
hash: string;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* TypedResult is a union type that represents the different types of translations that can be returned.
|
11
|
+
*/
|
12
|
+
export type TypedResult = {
|
13
|
+
translation: JsxChildren;
|
14
|
+
dataFormat: 'JSX';
|
15
|
+
} | {
|
16
|
+
translation: I18nextMessage | IcuMessage;
|
17
|
+
dataFormat: 'ICU' | 'I18NEXT';
|
18
|
+
};
|
19
|
+
/**
|
20
|
+
* RequestError is a type that represents an error that occurred during a translation request.
|
21
|
+
*/
|
22
|
+
export type TranslationError = {
|
23
|
+
error: string;
|
24
|
+
code: number;
|
25
|
+
reference?: TranslationResultReference;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* RequestSuccess is a type that represents a successful translation request.
|
29
|
+
*/
|
30
|
+
export type RequestSuccess = TypedResult & {
|
31
|
+
locale: string;
|
32
|
+
reference: TranslationResultReference;
|
33
|
+
};
|
34
|
+
export type TranslationResult = RequestSuccess | TranslationError;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.cjs.min.cjs","sources":["../src/types.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"file":"types.cjs.min.cjs","sources":["../src/types-dir/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content = JsxChildren | IcuMessage | I18nextMessage;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n"],"names":["pl","ti","alt","arl","arb","ard"],"mappings":"wCAKkC,CAChCA,GAAI,cACJC,GAAI,QACJC,IAAK,MACLC,IAAK,aACLC,IAAK,kBACLC,IAAK"}
|