@rxap/ngx-localize 21.0.1-dev.1 → 22.0.0-dev.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/compodoc/changelog.html +20 -0
  3. package/compodoc/dependencies.html +5 -5
  4. package/compodoc/js/search/search_index.js +2 -2
  5. package/compodoc/properties.html +1 -1
  6. package/docs/documentation.json +32 -32
  7. package/docs/html/classes/I18nService.html +3 -3
  8. package/docs/html/classes/LanguageSelectorService.html +4 -4
  9. package/docs/html/functions/LanguageInterceptor.html +2 -2
  10. package/docs/html/functions/defaultLoadModule.html +2 -2
  11. package/docs/html/functions/loadI18nBootstrapHook.html +1 -1
  12. package/docs/html/functions/loadLanguages.html +2 -2
  13. package/docs/html/index.html +2 -2
  14. package/docs/html/modules.html +1 -1
  15. package/docs/html/types/FetchTranslationsFunction.html +1 -1
  16. package/docs/html/types/LoadModuleFunction.html +1 -1
  17. package/docs/html/variables/LOCALE_STORAGE_KEY.html +1 -1
  18. package/docs/markdown/README.md +1 -1
  19. package/docs/markdown/classes/I18nService.md +5 -5
  20. package/docs/markdown/classes/LanguageSelectorService.md +7 -7
  21. package/docs/markdown/functions/LanguageInterceptor.md +2 -2
  22. package/docs/markdown/functions/defaultLoadModule.md +2 -2
  23. package/docs/markdown/functions/loadI18nBootstrapHook.md +2 -2
  24. package/docs/markdown/functions/loadLanguages.md +2 -2
  25. package/docs/markdown/globals.md +2 -2
  26. package/docs/markdown/type-aliases/FetchTranslationsFunction.md +2 -2
  27. package/docs/markdown/type-aliases/LoadModuleFunction.md +2 -2
  28. package/docs/markdown/variables/LOCALE_STORAGE_KEY.md +2 -2
  29. package/docs/wiki/Class.I18nService.md +4 -4
  30. package/docs/wiki/Class.LanguageSelectorService.md +6 -6
  31. package/docs/wiki/Function.LanguageInterceptor.md +1 -1
  32. package/docs/wiki/Function.defaultLoadModule.md +1 -1
  33. package/docs/wiki/Function.loadI18nBootstrapHook.md +1 -1
  34. package/docs/wiki/Function.loadLanguages.md +1 -1
  35. package/docs/wiki/TypeAlias.FetchTranslationsFunction.md +1 -1
  36. package/docs/wiki/TypeAlias.LoadModuleFunction.md +1 -1
  37. package/docs/wiki/Variable.LOCALE_STORAGE_KEY.md +1 -1
  38. package/docs/wiki/globals.md +1 -1
  39. package/fesm2022/rxap-ngx-localize.mjs +140 -175
  40. package/fesm2022/rxap-ngx-localize.mjs.map +1 -1
  41. package/package.json +26 -26
  42. package/types/rxap-ngx-localize.d.ts +42 -48
@@ -1,24 +1,24 @@
1
- import * as i0 from '@angular/core';
2
- import { Signal, ApplicationConfig } from '@angular/core';
3
- import { HttpRequest, HttpHandlerFn, HttpEvent } from '@angular/common/http';
4
- import { Observable } from 'rxjs';
5
- import { LanguagesConfig } from '@rxap/config';
6
-
7
- declare const LOCALE_STORAGE_KEY = "locale";
8
-
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import * as i0 from "@angular/core";
5
+ import { ApplicationConfig, Signal } from "@angular/core";
6
+ import { HttpEvent, HttpHandlerFn, HttpRequest } from "@angular/common/http";
7
+ import { Observable } from "rxjs";
8
+ import { LanguagesConfig } from "@rxap/config";
9
+ export declare const LOCALE_STORAGE_KEY = "locale";
9
10
  /**
10
11
  * @deprecated removed
11
12
  */
12
- declare class I18nService {
13
- private readonly localId;
14
- private readonly userSettingsLanguageService;
15
- readonly currentLanguage: Signal<string>;
16
- setLanguage(language: string): Promise<void>;
17
- redirect(next: string, current?: string): void;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<I18nService, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<I18nService>;
13
+ export declare class I18nService {
14
+ private readonly localId;
15
+ private readonly userSettingsLanguageService;
16
+ readonly currentLanguage: Signal<string>;
17
+ setLanguage(language: string): Promise<void>;
18
+ redirect(next: string, current?: string): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<I18nService, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
20
21
  }
21
-
22
22
  /**
23
23
  * Intercepts an HTTP request to include a localized 'Accept-Language' header, if available.
24
24
  *
@@ -26,44 +26,42 @@ declare class I18nService {
26
26
  * @param {HttpHandlerFn} next - The next handler in the HTTP request pipeline.
27
27
  * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP response event.
28
28
  */
29
- declare function LanguageInterceptor(request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>>;
30
-
29
+ export declare function LanguageInterceptor(request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>>;
31
30
  /**
32
31
  * A service that manages language selection and configuration for the application.
33
32
  * Provides functionality to retrieve available languages, default language,
34
33
  * selected language, and dynamically change the application's language settings.
35
34
  */
36
- declare class LanguageSelectorService {
37
- private readonly config;
38
- readonly languages: Signal<LanguagesConfig>;
39
- readonly defaultLanguage: Signal<string>;
40
- readonly selectedLanguage: i0.WritableSignal<string>;
41
- readonly hasLanguages: Signal<boolean>;
42
- /**
43
- * Sets the application language to the specified value if it exists in the list of supported languages.
44
- * Optionally reloads the page if the `reload` parameter is set to `true`.
45
- *
46
- * @param {string} language - The language code to set as the active language.
47
- * @param {boolean} [reload=false] - A flag indicating whether to reload the page after updating the language.
48
- * @return {Promise<void>} A promise that resolves once the language has been set and optional reload is completed.
49
- */
50
- setLanguage(language: string, reload?: boolean): Promise<void>;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<LanguageSelectorService, never>;
52
- static ɵprov: i0.ɵɵInjectableDeclaration<LanguageSelectorService>;
35
+ export declare class LanguageSelectorService {
36
+ private readonly config;
37
+ readonly languages: Signal<LanguagesConfig>;
38
+ readonly defaultLanguage: Signal<string>;
39
+ readonly selectedLanguage: import("@angular/core").WritableSignal<string>;
40
+ readonly hasLanguages: Signal<boolean>;
41
+ /**
42
+ * Sets the application language to the specified value if it exists in the list of supported languages.
43
+ * Optionally reloads the page if the `reload` parameter is set to `true`.
44
+ *
45
+ * @param {string} language - The language code to set as the active language.
46
+ * @param {boolean} [reload=false] - A flag indicating whether to reload the page after updating the language.
47
+ * @return {Promise<void>} A promise that resolves once the language has been set and optional reload is completed.
48
+ */
49
+ setLanguage(language: string, reload?: boolean): Promise<void>;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<LanguageSelectorService, never>;
51
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
53
52
  }
54
-
55
53
  /**
56
54
  * Loads the locale data module for the specified locale and registers it.
57
55
  *
58
56
  * @param {string} locale - The locale identifier for which the module needs to be loaded.
59
57
  * @return {Promise<void>} A promise that resolves when the module is successfully loaded and registered, or logs an error if loading fails.
60
58
  */
61
- declare function defaultLoadModule(locale: string): Promise<void>;
62
- type FetchTranslationsFunction = (locale: string, preferredLanguages: string[], fallback: string) => Promise<{
63
- json: any;
64
- locale: string;
59
+ export declare function defaultLoadModule(locale: string): Promise<void>;
60
+ export type FetchTranslationsFunction = (locale: string, preferredLanguages: string[], fallback: string) => Promise<{
61
+ json: any;
62
+ locale: string;
65
63
  } | null>;
66
- type LoadModuleFunction = (locale: string) => Promise<void>;
64
+ export type LoadModuleFunction = (locale: string) => Promise<void>;
67
65
  /**
68
66
  * Loads language translations and sets the locale for the application.
69
67
  * This function fetches the translations based on the specified locale, preferred languages,
@@ -76,9 +74,5 @@ type LoadModuleFunction = (locale: string) => Promise<void>;
76
74
  * @param {string} [fallback] - The fallback key for translation files. Defaults to 'messages'.
77
75
  * @return {Promise<string>} The resolved locale, as a string.
78
76
  */
79
- declare function loadLanguages(fetchTranslations: FetchTranslationsFunction, loadModule?: LoadModuleFunction, locale?: string, preferredLanguages?: string[], fallback?: string): Promise<string>;
80
-
81
- declare function loadI18nBootstrapHook(fetchTranslations: FetchTranslationsFunction, loadModule?: LoadModuleFunction, locale?: string, preferredLanguages?: string[], fallback?: string): (_: any, options: Partial<ApplicationConfig>) => Promise<void>;
82
-
83
- export { I18nService, LOCALE_STORAGE_KEY, LanguageInterceptor, LanguageSelectorService, defaultLoadModule, loadI18nBootstrapHook, loadLanguages };
84
- export type { FetchTranslationsFunction, LoadModuleFunction };
77
+ export declare function loadLanguages(fetchTranslations: FetchTranslationsFunction, loadModule?: LoadModuleFunction, locale?: string, preferredLanguages?: string[], fallback?: string): Promise<string>;
78
+ export declare function loadI18nBootstrapHook(fetchTranslations: FetchTranslationsFunction, loadModule?: LoadModuleFunction, locale?: string, preferredLanguages?: string[], fallback?: string): (_: any, options: Partial<ApplicationConfig>) => Promise<void>;