@gschz/astro-plugin-i18n 0.3.7-rc.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.
@@ -0,0 +1,73 @@
1
+ import { L as Language, T as TranslationKey, a as TranslationOptions, b as TranslationConfig, I as I18nPluginOptions } from './index-Dyxmdid5.js';
2
+ export { S as SupportedLanguage, c as TranslationValues } from './index-Dyxmdid5.js';
3
+ export { LangToggle } from './components/LangToggle.js';
4
+ export { TranslatedText } from './components/TranslatedText.js';
5
+ export { createI18nIntegration } from './integration.js';
6
+ import 'react';
7
+ import 'astro';
8
+
9
+ /**
10
+ * Funciones para gestionar el idioma en astro-plugin-i18n.
11
+ */
12
+
13
+ declare function getCurrentLanguage(locals?: Record<string, any>): Language;
14
+ declare function changeLanguage(lang: Language): void;
15
+ declare function setupLanguage(): void;
16
+ declare function setupLanguageObserver(callback: (lang: Language) => void): () => void;
17
+
18
+ /**
19
+ * Funciones de traduccion y hooks para componentes.
20
+ */
21
+
22
+ declare function populateClientCache(lang: Language, translations: Record<string, any>): void;
23
+ declare function translateAsync(key: TranslationKey, options?: TranslationOptions): Promise<string>;
24
+ declare function t(key: TranslationKey, options?: TranslationOptions): string;
25
+ declare function useTranslation(): {
26
+ language: string;
27
+ changeLanguage: typeof changeLanguage;
28
+ t: (key: TranslationKey, options?: Omit<TranslationOptions, "lang">) => string;
29
+ };
30
+
31
+ /**
32
+ * Gestion de configuracion para astro-plugin-i18n.
33
+ */
34
+
35
+ declare function getConfig(): TranslationConfig;
36
+ declare function updateConfig(options?: Partial<I18nPluginOptions>): TranslationConfig;
37
+ declare function resetConfig(): TranslationConfig;
38
+ declare function initConfig(options?: Partial<I18nPluginOptions>): TranslationConfig;
39
+ declare function getSupportedLanguages(): Language[];
40
+ declare function getDefaultLanguage(): Language;
41
+
42
+ /**
43
+ * Funciones para cargar y gestionar traducciones desde el sistema de archivos.
44
+ */
45
+
46
+ declare function getTranslationsForLanguage(lang: Language): Promise<Record<string, any>>;
47
+ declare function loadTranslations(lang: Language): Promise<Record<string, any>>;
48
+ declare function getTranslation(key: string, lang: Language): Promise<string>;
49
+ declare function clearTranslationsCache(): void;
50
+
51
+ /**
52
+ * Generador de tipos TypeScript para las claves de traduccion.
53
+ */
54
+ declare function generateTranslationTypes(): Promise<string>;
55
+
56
+ /**
57
+ * Funciones auxiliares relacionadas con la configuracion y gestion de i18n.
58
+ */
59
+
60
+ declare function reloadTranslations(): void;
61
+ declare function isLanguageSupported(lang: Language): boolean;
62
+ declare function getLanguageRedirect(url: URL): URL | null;
63
+
64
+ /**
65
+ * Punto de entrada principal para @hkxdv/astro-plugin-i18n.
66
+ */
67
+
68
+ declare function createDefaultPlugin(): {
69
+ name: string;
70
+ version: string;
71
+ };
72
+
73
+ export { I18nPluginOptions, Language, TranslationConfig, TranslationKey, TranslationOptions, changeLanguage, clearTranslationsCache, createDefaultPlugin as default, generateTranslationTypes, getConfig, getCurrentLanguage, getDefaultLanguage, getLanguageRedirect, getSupportedLanguages, getTranslation, getTranslationsForLanguage, initConfig, isLanguageSupported, loadTranslations, populateClientCache, reloadTranslations, resetConfig, setupLanguage, setupLanguageObserver, t, translateAsync, updateConfig, useTranslation };