/** * Analysis utilities for identifying GT components and functions */ import { GT_ALL_FUNCTIONS, GT_CALLBACK_FUNCTIONS, GT_COMPONENT_TYPES, GT_FUNCTIONS_WITH_CALLBACKS, GT_IMPORT_SOURCES } from './constants'; import { HtmlContentPropValuesRecord } from '@generaltranslation/format/types'; /** * Check if a name is a GT function * @param name - The name to check * @returns True if the name is a GT function */ export declare function isGTFunction(name: string): name is GT_ALL_FUNCTIONS; /** * Check if a name is a GT function with callbacks * @param name - The name to check * @returns True if the name is a GT function with callbacks */ export declare function isGTFunctionWithCallbacks(name: string): name is GT_FUNCTIONS_WITH_CALLBACKS; /** * Check if a name is a GT component * @param name - The name to check * @returns True if the name is a GT component */ export declare function isGTComponent(name: string): name is GT_COMPONENT_TYPES; /** * Check if a component name matches known gt-next translation components */ export declare function isTranslationComponent(name: string): name is GT_COMPONENT_TYPES.T; /** * Check if a component name matches known gt-next variable components */ export declare function isVariableComponent(name: string): name is GT_COMPONENT_TYPES; /** * Check if a name is a GT derive component */ export declare function isDeriveComponent(name: string): name is GT_COMPONENT_TYPES; /** * Check if a name is a GT branch component */ export declare function isBranchComponent(name: string): name is GT_COMPONENT_TYPES; /** * Check if a name is a GT translation function */ export declare function isTranslationFunction(name: string): name is 'useGT' | 'getGT'; /** * Check if it's a translation function callback (const t = useGT()) */ export declare function isTranslationFunctionCallback(name: string): name is GT_CALLBACK_FUNCTIONS; /** * Check if it's a GT import source */ export declare function isGTImportSource(name: string): name is GT_IMPORT_SOURCES; export declare function isGTReactImportSource(name: string): name is GT_IMPORT_SOURCES.GT_REACT | GT_IMPORT_SOURCES.GT_REACT_CLIENT | GT_IMPORT_SOURCES.GT_REACT_BROWSER; export declare function getGtReactImportSource(legacyGtReactImportSource: boolean): GT_IMPORT_SOURCES.GT_REACT | GT_IMPORT_SOURCES.GT_REACT_BROWSER; /** * Check if is a html content prop */ export declare function isHtmlContentProp(name: string): name is keyof HtmlContentPropValuesRecord; /** * Minify the canonical name */ export declare function minifyCanonicalName(canonicalName: GT_COMPONENT_TYPES): string; /** * Default variable names */ export declare const defaultVariableNames: { readonly Var: "value"; readonly GtInternalVar: "value"; readonly Num: "n"; readonly GtInternalNum: "n"; readonly DateTime: "date"; readonly GtInternalDateTime: "date"; readonly RelativeTime: "time"; readonly Currency: "cost"; readonly GtInternalCurrency: "cost"; readonly Derive: "static"; }; /** * Get the variable name */ export declare function getVariableName(variableType: keyof typeof defaultVariableNames, id: number, name?: string): string; //# sourceMappingURL=helpers.d.ts.map