import { D as Variable$1, It as RuntimeTranslateManyOptions, N as VariableTransformationSuffix, O as VariableType, _ as JsxElement, c as GTProp, g as JsxChildren, h as JsxChild, k as _Content, vt as FileFormat, y as LocaleProperties } from "./types-CdRgQtET.cjs";
import { IcuMessage } from "@generaltranslation/format/types";

//#region src/settings/settingsUrls.d.ts
declare const defaultCacheUrl: "https://cdn.gtx.dev";
declare const defaultBaseUrl: "https://api2.gtx.dev";
declare const defaultRuntimeApiUrl: "https://runtime2.gtx.dev";
//#endregion
//#region src/logging/diagnostics.d.ts
type DiagnosticSeverity = 'Error' | 'Warning';
/**
 * Text slots follow the five-part error message model:
 * what happened, reassurance, why it happened, how to fix it, and a way out.
 */
type DiagnosticMessageInput = {
  source?: string;
  severity?: DiagnosticSeverity;
  whatHappened: string;
  reassurance?: string;
  why?: string;
  fix?: string;
  wayOut?: string;
  details?: string | string[];
  docsUrl?: string;
};
declare function formatDiagnosticErrorDetails(error: unknown): string | undefined;
declare function createDiagnosticMessage({
  source,
  severity,
  whatHappened,
  reassurance,
  why,
  fix,
  wayOut,
  details,
  docsUrl
}: DiagnosticMessageInput): string;
//#endregion
//#region src/settings/settings.d.ts
declare const libraryDefaultLocale: "en";
declare const defaultTimeout = 60000;
//#endregion
//#region src/settings/plurals.d.ts
declare const pluralForms: readonly ["singular", "plural", "dual", "zero", "one", "two", "few", "many", "other"];
type PluralType = (typeof pluralForms)[number];
declare function isAcceptedPluralForm(form: string): form is PluralType;
//#endregion
//#region src/locales/getPluralForm.d.ts
/**
 * Given a number and a list of allowed plural forms, return the plural form that best fits the number.
 *
 * @param {number} n - The number to determine the plural form for.
 * @param {PluralType[]} forms - The allowed plural forms.
 * @returns {PluralType} The determined plural form, or an empty string if none fit.
 */
declare function _getPluralForm(n: number, forms?: readonly PluralType[], locales?: string[]): PluralType | '';
//#endregion
//#region src/utils/isVariable.d.ts
declare function isVariable(obj: unknown): obj is Variable$1;
//#endregion
//#region src/utils/minify.d.ts
declare function minifyVariableType(variableType: VariableTransformationSuffix): VariableType;
//#endregion
//#region src/utils/base64.d.ts
declare function encode(data: string): string;
declare function decode(base64: string): string;
//#endregion
//#region src/utils/isSupportedFileFormatTransform.d.ts
/**
 * This function checks if a file format transformation is supported during translation
 * @param from - The source file format.
 * @param to - The target file format.
 * @returns True if the transformation is supported, false otherwise
 */
declare function isSupportedFileFormatTransform(from: FileFormat, to: FileFormat): boolean;
//#endregion
//#region src/translate/utils/validateFileFormatTransform.d.ts
type FileFormatTransformInput = {
  fileFormat?: FileFormat;
  transformFormat?: FileFormat;
  fileName?: string;
  fileId?: string;
};
/**
 * Validates file format transforms before sending upload/enqueue requests.
 */
declare function validateFileFormatTransforms(files: FileFormatTransformInput[]): void;
//#endregion
//#region src/derive/decodeVars.d.ts
/**
 * Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()
 * @example
 * const encodedIcu = "Hi" + declareVar("Brian") + ", my name is {name}"
 * // 'Hi {_gt_, select, other {Brian}}, my name is {name}'
 * decodeVars(encodedIcu)
 * // 'Hi Brian, my name is {name}'
 */
declare function decodeVars(icuString: string): string;
//#endregion
//#region src/derive/declareVar.d.ts
/**
 * Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).
 *
 * @example
 * function nonDerivableFunction() {
 *   return Math.random();
 * }
 *
 * function derivableFunction() {
 *   if (condition) {
 *     return declareVar(nonDerivableFunction())
 *   }
 *   return 'John Doe';
 * }
 *
 * const gt = useGT();
 * gt(`My name is ${derive(derivableFunction())}`);
 *
 * @param {string | number | boolean | null | undefined} variable - The variable to sanitize.
 * @param {Object} [options] - The options for the sanitization.
 * @param {string} [options.$name] - The name of the variable.
 * @returns {string} The sanitized value.
 */
declare function declareVar(variable: string | number | boolean | null | undefined, options?: {
  $name?: string;
}): string;
//#endregion
//#region src/derive/derive.d.ts
/**
 * Marks content as derivable by the GT compiler and CLI.
 *
 * Use `derive()` when a translation string or context needs content that is
 * computed from source code, but should still be discovered during extraction
 * instead of treated as a runtime interpolation variable. The CLI attempts to
 * resolve the derivable expression into every possible static value and
 * includes those values in the source content that gets translated.
 *
 * `derive()` returns its argument unchanged at runtime.
 *
 * Run `gt validate` after adding or changing `derive()` calls to verify that
 * each derivable expression can be resolved by the CLI before translating or
 * building.
 *
 * @example
 * ```jsx
 * function getSubject() {
 *   return (Math.random() > 0.5) ? "Alice" : "Brian";
 * }
 * ...
 * gt(`My name is ${derive(getSubject())}`);
 * ```
 *
 * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.
 * @returns {T} The same content, unchanged at runtime.
 */
declare function derive<T extends string | boolean | number | null | undefined>(content: T): T;
/**
 * @deprecated Use derive() instead.
 *
 * Marks content as derivable by the GT compiler and CLI.
 *
 * Use `derive()` instead of `declareStatic()` for new code. This alias is kept
 * for backwards compatibility and returns its argument unchanged at runtime.
 *
 * Run `gt validate` after adding or changing derived content to verify that
 * each derivable expression can be resolved by the CLI before translating or
 * building.
 *
 * @example
 * ```jsx
 * function getSubject() {
 *   return (Math.random() > 0.5) ? "Alice" : "Brian";
 * }
 * ...
 * gt(`My name is ${declareStatic(getSubject())}`);
 * ```
 *
 * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.
 * @returns {T} The same content, unchanged at runtime.
 */
declare const declareStatic: typeof derive;
//#endregion
//#region src/derive/indexVars.d.ts
/**
 * Given an ICU string adds identifiers to each _gt_ placeholder
 * indexVars('Hello {_gt_} {_gt_} World') => 'Hello {_gt_1_} {_gt_2_} World'
 */
declare function indexVars(icuString: IcuMessage): string;
//#endregion
//#region src/derive/extractVars.d.ts
/**
 * Given an unindexed ICU string, extracts all the _gt_ variables and an indexed mapping of the variable to the values
 *
 * extractVars('Hello {_gt_, select, other {World}}') => { _gt_1: 'World' }
 *
 * @param {string} icuString - The ICU string to extract variables from.
 * @returns {Record<string, string>} A mapping of the variable to the value.
 */
declare function extractVars(icuString: string): Record<string, string>;
//#endregion
//#region src/derive/condenseVars.d.ts
/**
 * Given an indexed ICU string, condenses any select to an argument
 * indexVars('Hello {_gt_1, select, other {World}}') => 'Hello {_gt_1}'
 * @param {string} icuString - The ICU string to condense.
 * @returns {string} The condensed ICU string.
 */
declare function condenseVars(icuString: string): string;
//#endregion
//#region src/derive/utils/constants.d.ts
declare const VAR_IDENTIFIER = "_gt_";
declare const VAR_NAME_IDENTIFIER = "_gt_var_name";
//#endregion
//#region src/backwards-compatability/oldTypes.d.ts
type OldBranchType = 'branch' | 'plural';
type OldGTProp = {
  id: number;
  transformation?: OldBranchType;
  branches?: Record<string, OldJsxChildren>;
};
type OldJsxElement = {
  type: string;
  props: {
    children?: OldJsxChildren;
    'data-_gt': OldGTProp;
  };
};
type OldVariableType = 'number' | 'variable' | 'datetime' | 'currency';
type OldVariableObject = {
  variable?: OldVariableType;
  key: string;
  id?: number;
};
type OldJsxChild = OldJsxElement | OldVariableObject | string;
type OldJsxChildren = OldJsxChild | OldJsxChild[];
//#endregion
//#region src/backwards-compatability/dataConversion.d.ts
/**
 * Convert request data from old format to new format
 */
declare function getNewJsxChild(child: OldJsxChild): JsxChild;
declare function getNewJsxChildren(children: OldJsxChildren): JsxChildren;
declare function getNewJsxElement(element: OldJsxElement): JsxElement;
declare function getNewBranchType(branch: OldBranchType): 'b' | 'p';
declare function getNewVariableType(variable: OldVariableType): VariableType;
declare function getNewVariableObject(variable: OldVariableObject): Variable$1;
declare function getNewGTProp(dataGT: OldGTProp): GTProp;
/**
 * Convert response data from current format to old format
 */
declare function getOldJsxChild(child: JsxChild): OldJsxChild;
declare function getOldJsxChildren(children: JsxChildren | OldJsxChildren): OldJsxChildren;
declare function getOldJsxElement(element: JsxElement): OldJsxElement;
declare function getOldBranchType(branch: 'b' | 'p'): OldBranchType;
declare function getOldVariableType(variable: VariableType): OldVariableType;
declare function getOldVariableObject(variable: Variable$1): OldVariableObject;
declare function getOldGTProp(dataGT: GTProp, i: number): OldGTProp;
//#endregion
//#region src/backwards-compatability/typeChecking.d.ts
/**
 * Checks if a JSX child is an old variable object format
 * @param child - The JSX child to check.
 * @returns True if the child is an old variable object (has 'key' property)
 */
declare function isOldVariableObject(child: OldJsxChild | JsxChild): child is OldVariableObject;
/**
 * Checks if a JSX child is a new variable object format
 * @param child - The JSX child to check.
 * @returns True if the child is a new variable object (has 'k' property)
 */
declare function isNewVariableObject(child: OldJsxChild | JsxChild): child is Variable$1;
/**
 * Checks if JSX children follow the old format
 * @param children - The JSX children to check (can be string, array, or single child)
 * @returns True if all children are in the old format.
 */
declare function isOldJsxChildren(children: OldJsxChildren | JsxChildren): children is OldJsxChildren;
//#endregion
//#region src/backwards-compatability/oldHashJsxChildren.d.ts
/**
 * Calculates a unique hash for a given string using SHA-256.
 *
 * @param {string} string - The string to be hashed.
 * @returns {string} The resulting hash as a hexadecimal string.
 */
declare function oldHashString(string: string): string;
/**
 * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.
 *
 * @param {any} childrenAsObjects - The children objects to be hashed.
 * @param {string} context - The context for the children.
 * @param {string} id - The ID for the JSX children object.
 * @param {function} hashFunction - Custom hash function.
 * @returns {string} - The unique hash of the children.
 */
declare function oldHashJsxChildren({
  source,
  context,
  id,
  dataFormat
}: {
  source: OldJsxChildren;
  context?: string;
  id?: string;
  dataFormat: string;
}, hashFunction?: (string: string) => string): string;
//#endregion
export { type DiagnosticMessageInput, type DiagnosticSeverity, JsxChild, JsxChildren, JsxElement, LocaleProperties, type OldBranchType, type OldGTProp, type OldJsxChild, type OldJsxChildren, type OldJsxElement, type OldVariableObject, type OldVariableType, type RuntimeTranslateManyOptions, VAR_IDENTIFIER, VAR_NAME_IDENTIFIER, _Content, condenseVars, createDiagnosticMessage, declareStatic, declareVar, decode, decodeVars, defaultBaseUrl, defaultCacheUrl, defaultRuntimeApiUrl, defaultTimeout, derive, encode, extractVars, formatDiagnosticErrorDetails, getNewBranchType, getNewGTProp, getNewJsxChild, getNewJsxChildren, getNewJsxElement, getNewVariableObject, getNewVariableType, getOldBranchType, getOldGTProp, getOldJsxChild, getOldJsxChildren, getOldJsxElement, getOldVariableObject, getOldVariableType, _getPluralForm as getPluralForm, indexVars, isAcceptedPluralForm, isNewVariableObject, isOldJsxChildren, isOldVariableObject, isSupportedFileFormatTransform, isVariable, libraryDefaultLocale, minifyVariableType, oldHashJsxChildren, oldHashString, pluralForms, validateFileFormatTransforms };
//# sourceMappingURL=internal.d.cts.map