@rxap/config 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 (136) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/compodoc/changelog.html +27 -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 +180 -180
  7. package/docs/html/classes/ConfigLoaderService.html +2 -2
  8. package/docs/html/classes/ConfigService.html +7 -7
  9. package/docs/html/classes/ConfigTestingService.html +2 -2
  10. package/docs/html/enums/ConfigLoadMethod.html +2 -2
  11. package/docs/html/enums/ConfigLoadingStrategy.html +2 -2
  12. package/docs/html/functions/ProvideConfig.html +1 -1
  13. package/docs/html/functions/defaultConfigLoadErrorHandler.html +2 -2
  14. package/docs/html/functions/dnsLookup.html +1 -1
  15. package/docs/html/functions/dnsResolver.html +1 -1
  16. package/docs/html/functions/fetchCidContent.html +1 -1
  17. package/docs/html/functions/fetchCidContentAsJson.html +1 -1
  18. package/docs/html/functions/fetchCidContentViaHttp.html +1 -1
  19. package/docs/html/functions/fetchContentViaHttp.html +1 -1
  20. package/docs/html/functions/localPathIpfsGateway.html +1 -1
  21. package/docs/html/functions/localSubDomainIpfsGateway.html +1 -1
  22. package/docs/html/functions/raceSuccess.html +2 -2
  23. package/docs/html/functions/showConfigLoadError.html +2 -2
  24. package/docs/html/functions/storachaIpfsGateway.html +1 -1
  25. package/docs/html/functions/w3sIpfsGateway.html +1 -1
  26. package/docs/html/hierarchy.html +1 -1
  27. package/docs/html/index.html +2 -2
  28. package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
  29. package/docs/html/interfaces/Config.html +2 -2
  30. package/docs/html/interfaces/ConfigLoadError.html +4 -4
  31. package/docs/html/interfaces/ConfigLoadOptions.html +8 -8
  32. package/docs/html/interfaces/LogoConfig.html +2 -2
  33. package/docs/html/interfaces/NavigationConfig.html +2 -2
  34. package/docs/html/interfaces/Oauth2Config.html +2 -2
  35. package/docs/html/interfaces/i18nConfig.html +2 -2
  36. package/docs/html/modules.html +1 -1
  37. package/docs/html/types/AnySchema.html +1 -1
  38. package/docs/html/types/ConfigLoadErrorHandler.html +2 -2
  39. package/docs/html/types/ConfigLoadErrorKind.html +2 -2
  40. package/docs/html/types/ConfigRequestOptions.html +1 -1
  41. package/docs/html/types/IpfsGatewayFunction.html +1 -1
  42. package/docs/html/types/Join.html +1 -1
  43. package/docs/html/types/LanguagesConfig.html +1 -1
  44. package/docs/html/types/Leaves.html +1 -1
  45. package/docs/html/types/NoInferType.html +1 -1
  46. package/docs/html/types/Paths.html +1 -1
  47. package/docs/html/variables/RXAP_CONFIG.html +1 -1
  48. package/docs/html/variables/defaultDnsServers.html +1 -1
  49. package/docs/html/variables/defaultIpfsGatewayServers.html +1 -1
  50. package/docs/markdown/README.md +1 -1
  51. package/docs/markdown/classes/ConfigLoaderService.md +6 -6
  52. package/docs/markdown/classes/ConfigService.md +23 -23
  53. package/docs/markdown/classes/ConfigTestingService.md +8 -8
  54. package/docs/markdown/enumerations/ConfigLoadMethod.md +6 -6
  55. package/docs/markdown/enumerations/ConfigLoadingStrategy.md +4 -4
  56. package/docs/markdown/functions/ProvideConfig.md +2 -2
  57. package/docs/markdown/functions/defaultConfigLoadErrorHandler.md +2 -2
  58. package/docs/markdown/functions/dnsLookup.md +2 -2
  59. package/docs/markdown/functions/dnsResolver.md +2 -2
  60. package/docs/markdown/functions/fetchCidContent.md +2 -2
  61. package/docs/markdown/functions/fetchCidContentAsJson.md +2 -2
  62. package/docs/markdown/functions/fetchCidContentViaHttp.md +2 -2
  63. package/docs/markdown/functions/fetchContentViaHttp.md +2 -2
  64. package/docs/markdown/functions/localPathIpfsGateway.md +2 -2
  65. package/docs/markdown/functions/localSubDomainIpfsGateway.md +2 -2
  66. package/docs/markdown/functions/raceSuccess.md +2 -2
  67. package/docs/markdown/functions/showConfigLoadError.md +2 -2
  68. package/docs/markdown/functions/storachaIpfsGateway.md +2 -2
  69. package/docs/markdown/functions/w3sIpfsGateway.md +2 -2
  70. package/docs/markdown/globals.md +2 -2
  71. package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
  72. package/docs/markdown/interfaces/Config.md +6 -6
  73. package/docs/markdown/interfaces/ConfigLoadError.md +9 -9
  74. package/docs/markdown/interfaces/ConfigLoadOptions.md +17 -17
  75. package/docs/markdown/interfaces/LogoConfig.md +5 -5
  76. package/docs/markdown/interfaces/NavigationConfig.md +9 -9
  77. package/docs/markdown/interfaces/Oauth2Config.md +3 -3
  78. package/docs/markdown/interfaces/i18nConfig.md +4 -4
  79. package/docs/markdown/type-aliases/AnySchema.md +2 -2
  80. package/docs/markdown/type-aliases/ConfigLoadErrorHandler.md +2 -2
  81. package/docs/markdown/type-aliases/ConfigLoadErrorKind.md +2 -2
  82. package/docs/markdown/type-aliases/ConfigRequestOptions.md +2 -2
  83. package/docs/markdown/type-aliases/IpfsGatewayFunction.md +2 -2
  84. package/docs/markdown/type-aliases/Join.md +2 -2
  85. package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
  86. package/docs/markdown/type-aliases/Leaves.md +2 -2
  87. package/docs/markdown/type-aliases/NoInferType.md +2 -2
  88. package/docs/markdown/type-aliases/Paths.md +2 -2
  89. package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
  90. package/docs/markdown/variables/defaultDnsServers.md +2 -2
  91. package/docs/markdown/variables/defaultIpfsGatewayServers.md +2 -2
  92. package/docs/wiki/Class.ConfigLoaderService.md +5 -5
  93. package/docs/wiki/Class.ConfigService.md +22 -22
  94. package/docs/wiki/Class.ConfigTestingService.md +7 -7
  95. package/docs/wiki/Enumeration.ConfigLoadMethod.md +5 -5
  96. package/docs/wiki/Enumeration.ConfigLoadingStrategy.md +3 -3
  97. package/docs/wiki/Function.ProvideConfig.md +1 -1
  98. package/docs/wiki/Function.defaultConfigLoadErrorHandler.md +1 -1
  99. package/docs/wiki/Function.dnsLookup.md +1 -1
  100. package/docs/wiki/Function.dnsResolver.md +1 -1
  101. package/docs/wiki/Function.fetchCidContent.md +1 -1
  102. package/docs/wiki/Function.fetchCidContentAsJson.md +1 -1
  103. package/docs/wiki/Function.fetchCidContentViaHttp.md +1 -1
  104. package/docs/wiki/Function.fetchContentViaHttp.md +1 -1
  105. package/docs/wiki/Function.localPathIpfsGateway.md +1 -1
  106. package/docs/wiki/Function.localSubDomainIpfsGateway.md +1 -1
  107. package/docs/wiki/Function.raceSuccess.md +1 -1
  108. package/docs/wiki/Function.showConfigLoadError.md +1 -1
  109. package/docs/wiki/Function.storachaIpfsGateway.md +1 -1
  110. package/docs/wiki/Function.w3sIpfsGateway.md +1 -1
  111. package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
  112. package/docs/wiki/Interface.Config.md +5 -5
  113. package/docs/wiki/Interface.ConfigLoadError.md +8 -8
  114. package/docs/wiki/Interface.ConfigLoadOptions.md +16 -16
  115. package/docs/wiki/Interface.LogoConfig.md +4 -4
  116. package/docs/wiki/Interface.NavigationConfig.md +8 -8
  117. package/docs/wiki/Interface.Oauth2Config.md +2 -2
  118. package/docs/wiki/Interface.i18nConfig.md +3 -3
  119. package/docs/wiki/TypeAlias.AnySchema.md +1 -1
  120. package/docs/wiki/TypeAlias.ConfigLoadErrorHandler.md +1 -1
  121. package/docs/wiki/TypeAlias.ConfigLoadErrorKind.md +1 -1
  122. package/docs/wiki/TypeAlias.ConfigRequestOptions.md +1 -1
  123. package/docs/wiki/TypeAlias.IpfsGatewayFunction.md +1 -1
  124. package/docs/wiki/TypeAlias.Join.md +1 -1
  125. package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
  126. package/docs/wiki/TypeAlias.Leaves.md +1 -1
  127. package/docs/wiki/TypeAlias.NoInferType.md +1 -1
  128. package/docs/wiki/TypeAlias.Paths.md +1 -1
  129. package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
  130. package/docs/wiki/Variable.defaultDnsServers.md +1 -1
  131. package/docs/wiki/Variable.defaultIpfsGatewayServers.md +1 -1
  132. package/docs/wiki/globals.md +1 -1
  133. package/fesm2022/rxap-config.mjs +581 -713
  134. package/fesm2022/rxap-config.mjs.map +1 -1
  135. package/package.json +10 -10
  136. package/types/rxap-config.d.ts +223 -257
@@ -1,10 +1,12 @@
1
- import { Observable, ReplaySubject } from 'rxjs';
2
- import { HttpClient } from '@angular/common/http';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken } from '@angular/core';
5
- import { Environment } from '@rxap/environment';
6
- import { IconConfig } from '@rxap/utilities';
7
-
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { Observable, ReplaySubject } from "rxjs";
5
+ import { HttpClient } from "@angular/common/http";
6
+ import * as i0 from "@angular/core";
7
+ import { InjectionToken } from "@angular/core";
8
+ import { Environment } from "@rxap/environment";
9
+ import { IconConfig } from "@rxap/utilities";
8
10
  /**
9
11
  * The kind of failure that happened while loading a config url.
10
12
  *
@@ -14,284 +16,248 @@ import { IconConfig } from '@rxap/utilities';
14
16
  * - `parse`: the response body is not valid JSON
15
17
  * - `schema`: the schema validation failed
16
18
  */
17
- type ConfigLoadErrorKind = 'network' | 'redirect' | 'http' | 'parse' | 'schema';
18
- interface ConfigLoadError {
19
- kind: ConfigLoadErrorKind;
20
- url: string;
21
- /**
22
- * true if the config url is required. A required url throws after the error handler is called,
23
- * an optional url resolves with `null`.
24
- */
25
- required: boolean;
26
- status?: number;
27
- response?: Response;
28
- cause?: unknown;
29
- /**
30
- * The message the default handler would show.
31
- */
32
- message: string;
19
+ export type ConfigLoadErrorKind = 'network' | 'redirect' | 'http' | 'parse' | 'schema';
20
+ export interface ConfigLoadError {
21
+ kind: ConfigLoadErrorKind;
22
+ url: string;
23
+ /**
24
+ * true if the config url is required. A required url throws after the error handler is called,
25
+ * an optional url resolves with `null`.
26
+ */
27
+ required: boolean;
28
+ status?: number;
29
+ response?: Response;
30
+ cause?: unknown;
31
+ /**
32
+ * The message the default handler would show.
33
+ */
34
+ message: string;
33
35
  }
34
36
  /**
35
37
  * Called for every failed config url request. May never resolve, e.g. if it navigates away.
36
38
  */
37
- type ConfigLoadErrorHandler = (error: ConfigLoadError) => void | Promise<void>;
39
+ export type ConfigLoadErrorHandler = (error: ConfigLoadError) => void | Promise<void>;
38
40
  /**
39
41
  * The default config load error handler. Shows the error message in an overlay and reloads the
40
42
  * page after 30 s for required config urls. Logs a warning for optional config urls.
41
43
  *
42
44
  * Can be used as fallback in a custom error handler for error kinds it does not handle.
43
45
  */
44
- declare function defaultConfigLoadErrorHandler(error: ConfigLoadError): void;
46
+ export declare function defaultConfigLoadErrorHandler(error: ConfigLoadError): void;
45
47
  /**
46
48
  * Appends the message to the config error overlay and schedules a page reload in 30 s.
47
49
  */
48
- declare function showConfigLoadError(message: string): void;
49
-
50
- declare class ConfigLoaderService {
51
- readonly http: HttpClient;
52
- readonly configs: Map<string, any>;
53
- readonly configLoading: Map<string, Observable<any>>;
54
- load$<T = any>(url: string): Promise<T>;
55
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfigLoaderService, never>;
56
- static ɵprov: i0.ɵɵInjectableDeclaration<ConfigLoaderService>;
50
+ export declare function showConfigLoadError(message: string): void;
51
+ export declare class ConfigLoaderService {
52
+ readonly http: HttpClient;
53
+ readonly configs: Map<string, any>;
54
+ readonly configLoading: Map<string, Observable<any>>;
55
+ load$<T = any>(url: string): Promise<T>;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigLoaderService, never>;
57
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
57
58
  }
58
-
59
- declare type NoInferType<T> = [T][T extends any ? 0 : never];
60
- type Prev = [
61
- never,
62
- 0,
63
- 1,
64
- 2,
65
- 3,
66
- 4,
67
- 5,
68
- 6,
69
- 7,
70
- 8,
71
- 9,
72
- 10,
73
- 11,
74
- 12,
75
- 13,
76
- 14,
77
- 15,
78
- 16,
79
- 17,
80
- 18,
81
- 19,
82
- 20,
83
- ...0[]
84
- ];
85
- type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
86
- type Paths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
87
- [K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Paths<T[K], Prev[D]>> : never;
88
- }[keyof T] : '';
89
- type Leaves<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
90
- [K in keyof T]-?: Join<K, Leaves<T[K], Prev[D]>>;
91
- }[keyof T] : '';
92
-
93
- type AnySchema = {
94
- validateAsync: (...args: any[]) => any;
59
+ export declare type NoInferType<T> = [T][T extends any ? 0 : never];
60
+ type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[]];
61
+ export type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
62
+ export type Paths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? { [K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Paths<T[K], Prev[D]>> : never; }[keyof T] : '';
63
+ export type Leaves<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? { [K in keyof T]-?: Join<K, Leaves<T[K], Prev[D]>>; }[keyof T] : '';
64
+ export type AnySchema = {
65
+ validateAsync: (...args: any[]) => any;
95
66
  };
96
- declare enum ConfigLoadingStrategy {
97
- DEFAULT = "default",
98
- FIFO = "fifo"
67
+ export declare enum ConfigLoadingStrategy {
68
+ DEFAULT = "default",
69
+ FIFO = "fifo"
99
70
  }
100
- declare enum ConfigLoadMethod {
101
- FROM_URLS = "fromUrls",
102
- FROM_LOCAL_STORAGE = "fromLocalStorage",
103
- FROM_URL_PARAM = "fromUrlParam",
104
- FROM_CID = "fromCid"
71
+ export declare enum ConfigLoadMethod {
72
+ FROM_URLS = "fromUrls",
73
+ FROM_LOCAL_STORAGE = "fromLocalStorage",
74
+ FROM_URL_PARAM = "fromUrlParam",
75
+ FROM_CID = "fromCid"
105
76
  }
106
- interface ConfigLoadOptions {
107
- fromUrlParam?: string | boolean;
108
- fromUrls?: boolean;
109
- fromLocalStorage?: boolean;
110
- schema?: AnySchema;
111
- url?: string | string[] | ((environment: Environment) => string | string[]);
112
- /**
113
- * static config values
114
- */
115
- static?: Record<string, any>;
116
- /**
117
- * Load additional configuration based on a CID found in a DNS TXT record.
118
- * If true, uses `location.hostname`. If a string, uses that domain.
119
- */
120
- fromDns?: string | boolean;
121
- /**
122
- * Load additional configuration directly from the given Content Identifier (CID).
123
- * This takes precedence over `fromDns` if both are provided.
124
- */
125
- fromCid?: string;
126
- fetchCidContent?: (cid: string, path?: string) => Promise<Blob | null>;
127
- ipfsGatewayServers?: Array<(cid: string) => string>;
128
- dnsServers?: string[];
129
- strategy?: ConfigLoadingStrategy;
130
- /**
131
- * Defines the order and subset of config sources to load.
132
- * If not specified, defaults to: [FROM_URLS, FROM_LOCAL_STORAGE, FROM_URL_PARAM, FROM_CID]
133
- *
134
- * Note: static config is always merged first, and Overwrites are always merged last.
135
- * Note: fromDns is not a source itself - it resolves the CID for FROM_CID.
136
- */
137
- order?: ConfigLoadMethod[];
138
- /**
139
- * Replaces the default error handling (error overlay + page reload after 30 s) for failed
140
- * config url requests. Used for the `url` / `fromUrls` source and for `SideLoad`.
141
- *
142
- * Afterwards a required url still throws and an optional url resolves with `null`. The
143
- * `onError` / `onRequestError` hooks are still called.
144
- */
145
- errorHandler?: ConfigLoadErrorHandler;
146
- /**
147
- * Passed to `fetch()` for config url requests, e.g. `{ redirect: 'manual' }`.
148
- */
149
- requestInit?: RequestInit;
77
+ export interface ConfigLoadOptions {
78
+ fromUrlParam?: string | boolean;
79
+ fromUrls?: boolean;
80
+ fromLocalStorage?: boolean;
81
+ schema?: AnySchema;
82
+ url?: string | string[] | ((environment: Environment) => string | string[]);
83
+ /**
84
+ * static config values
85
+ */
86
+ static?: Record<string, any>;
87
+ /**
88
+ * Load additional configuration based on a CID found in a DNS TXT record.
89
+ * If true, uses `location.hostname`. If a string, uses that domain.
90
+ */
91
+ fromDns?: string | boolean;
92
+ /**
93
+ * Load additional configuration directly from the given Content Identifier (CID).
94
+ * This takes precedence over `fromDns` if both are provided.
95
+ */
96
+ fromCid?: string;
97
+ fetchCidContent?: (cid: string, path?: string) => Promise<Blob | null>;
98
+ ipfsGatewayServers?: Array<(cid: string) => string>;
99
+ dnsServers?: string[];
100
+ strategy?: ConfigLoadingStrategy;
101
+ /**
102
+ * Defines the order and subset of config sources to load.
103
+ * If not specified, defaults to: [FROM_URLS, FROM_LOCAL_STORAGE, FROM_URL_PARAM, FROM_CID]
104
+ *
105
+ * Note: static config is always merged first, and Overwrites are always merged last.
106
+ * Note: fromDns is not a source itself - it resolves the CID for FROM_CID.
107
+ */
108
+ order?: ConfigLoadMethod[];
109
+ /**
110
+ * Replaces the default error handling (error overlay + page reload after 30 s) for failed
111
+ * config url requests. Used for the `url` / `fromUrls` source and for `SideLoad`.
112
+ *
113
+ * Afterwards a required url still throws and an optional url resolves with `null`. The
114
+ * `onError` / `onRequestError` hooks are still called.
115
+ */
116
+ errorHandler?: ConfigLoadErrorHandler;
117
+ /**
118
+ * Passed to `fetch()` for config url requests, e.g. `{ redirect: 'manual' }`.
119
+ */
120
+ requestInit?: RequestInit;
150
121
  }
151
- type ConfigRequestOptions = Pick<ConfigLoadOptions, 'errorHandler' | 'requestInit'>;
152
- declare class ConfigService<Config extends Record<string, any> = Record<string, any>> {
153
- static onError: ReplaySubject<unknown>;
154
- static onRequestError: ReplaySubject<Response>;
155
- static onErrorFnc: Array<(error: any) => void>;
156
- static onRequestErrorFnc: Array<(response: Response) => void>;
157
- static Config: any;
158
- /**
159
- * Static default values for the config object.
160
- * Will be overwritten by an dynamic config file specified in
161
- * the Urls array.
162
- */
163
- static Defaults: any;
164
- /**
165
- * Any value definition in the Overwrites object will overwrite any
166
- * value form the Defaults values or dynamic config files
167
- */
168
- static Overwrites: any;
169
- static LocalStorageKey: string;
170
- /**
171
- * The errorHandler and requestInit of the last Load call. Used by SideLoad.
172
- */
173
- static RequestOptions: ConfigRequestOptions;
174
- /**
175
- * @deprecated instead use the url property of the ConfigLoadOptions
176
- */
177
- static Urls: never[];
178
- readonly config: Config;
179
- constructor(config?: any | null);
180
- /**
181
- * Used to load the app config from a remote resource.
182
- *
183
- * Promise.all([ ConfigService.Load() ])
184
- * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))
185
- * .catch(err => console.error(err))
186
- *
187
- */
188
- static Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void>;
189
- private static isSourceEnabled;
190
- private static loadConfigFromMethod;
191
- private static getMethodName;
192
- private static loadConfigFromUrlParam;
193
- private static loadConfigFromLocalStorage;
194
- private static loadConfigFromUrls;
195
- private static loadConfigFromCid;
196
- private static loadConfigFromDns;
197
- private static handleError;
198
- private static handleRequestError;
199
- private static loadConfig;
200
- /**
201
- * Notifies the onError/onRequestError hooks (required urls only), calls the error handler and
202
- * throws for required urls. Resolves with null for optional urls.
203
- */
204
- private static handleLoadError;
205
- private static LoadConfigDefaultFromUrlParam;
206
- static SideLoad(url: string, propertyPath: string, required?: boolean, schema?: AnySchema, options?: ConfigRequestOptions): Promise<void>;
207
- static Get<T = any, K extends Record<string, any> = Record<string, any>>(path: string, defaultValue: T | undefined, config: Record<string, any>): T;
208
- setLocalConfig(config: Config): void;
209
- clearLocalConfig(): void;
210
- get<T = any>(propertyPath: string): T | undefined;
211
- get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
212
- getOrThrow<T = any>(propertyPath: string): T;
213
- getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
214
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfigService<any>, [{ optional: true; }]>;
215
- static ɵprov: i0.ɵɵInjectableDeclaration<ConfigService<any>>;
122
+ export type ConfigRequestOptions = Pick<ConfigLoadOptions, 'errorHandler' | 'requestInit'>;
123
+ export declare class ConfigService<Config extends Record<string, any> = Record<string, any>> {
124
+ static onError: ReplaySubject<unknown>;
125
+ static onRequestError: ReplaySubject<Response>;
126
+ static onErrorFnc: Array<(error: any) => void>;
127
+ static onRequestErrorFnc: Array<(response: Response) => void>;
128
+ static Config: any;
129
+ /**
130
+ * Static default values for the config object.
131
+ * Will be overwritten by an dynamic config file specified in
132
+ * the Urls array.
133
+ */
134
+ static Defaults: any;
135
+ /**
136
+ * Any value definition in the Overwrites object will overwrite any
137
+ * value form the Defaults values or dynamic config files
138
+ */
139
+ static Overwrites: any;
140
+ static LocalStorageKey: string;
141
+ /**
142
+ * The errorHandler and requestInit of the last Load call. Used by SideLoad.
143
+ */
144
+ static RequestOptions: ConfigRequestOptions;
145
+ /**
146
+ * @deprecated instead use the url property of the ConfigLoadOptions
147
+ */
148
+ static Urls: never[];
149
+ readonly config: Config;
150
+ constructor(config?: any | null);
151
+ /**
152
+ * Used to load the app config from a remote resource.
153
+ *
154
+ * Promise.all([ ConfigService.Load() ])
155
+ * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))
156
+ * .catch(err => console.error(err))
157
+ *
158
+ */
159
+ static Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void>;
160
+ private static isSourceEnabled;
161
+ private static loadConfigFromMethod;
162
+ private static getMethodName;
163
+ private static loadConfigFromUrlParam;
164
+ private static loadConfigFromLocalStorage;
165
+ private static loadConfigFromUrls;
166
+ private static loadConfigFromCid;
167
+ private static loadConfigFromDns;
168
+ private static handleError;
169
+ private static handleRequestError;
170
+ private static loadConfig;
171
+ /**
172
+ * Notifies the onError/onRequestError hooks (required urls only), calls the error handler and
173
+ * throws for required urls. Resolves with null for optional urls.
174
+ */
175
+ private static handleLoadError;
176
+ private static LoadConfigDefaultFromUrlParam;
177
+ static SideLoad(url: string, propertyPath: string, required?: boolean, schema?: AnySchema, options?: ConfigRequestOptions): Promise<void>;
178
+ static Get<T = any, K extends Record<string, any> = Record<string, any>>(path: string, defaultValue: T | undefined, config: Record<string, any>): T;
179
+ setLocalConfig(config: Config): void;
180
+ clearLocalConfig(): void;
181
+ get<T = any>(propertyPath: string): T | undefined;
182
+ get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
183
+ getOrThrow<T = any>(propertyPath: string): T;
184
+ getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
185
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigService<any>, [{
186
+ optional: true;
187
+ }]>;
188
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
216
189
  }
217
-
218
- declare class ConfigTestingService implements ConfigService {
219
- readonly config: Record<string, any>;
220
- clearLocalConfig(): void;
221
- set<T>(propertyPath: string, value: T): void;
222
- get<T>(propertyPath: string, defaultValue?: T): T | undefined;
223
- getOrThrow<T>(propertyPath: string): T;
224
- setLocalConfig(config: Record<string, any>): void;
225
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfigTestingService, never>;
226
- static ɵprov: i0.ɵɵInjectableDeclaration<ConfigTestingService>;
190
+ export declare class ConfigTestingService implements ConfigService {
191
+ readonly config: Record<string, any>;
192
+ clearLocalConfig(): void;
193
+ set<T>(propertyPath: string, value: T): void;
194
+ get<T>(propertyPath: string, defaultValue?: T): T | undefined;
195
+ getOrThrow<T>(propertyPath: string): T;
196
+ setLocalConfig(config: Record<string, any>): void;
197
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigTestingService, never>;
198
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
227
199
  }
228
-
229
- interface AppsNavigationConfig {
230
- target?: string;
231
- image?: string;
232
- label: string;
233
- href?: string;
234
- routerLink?: string[];
235
- empty?: false;
236
- hidden?: boolean;
237
- id?: string;
238
- permissions?: string[];
239
- icon?: IconConfig;
200
+ export interface AppsNavigationConfig {
201
+ target?: string;
202
+ image?: string;
203
+ label: string;
204
+ href?: string;
205
+ routerLink?: string[];
206
+ empty?: false;
207
+ hidden?: boolean;
208
+ id?: string;
209
+ permissions?: string[];
210
+ icon?: IconConfig;
240
211
  }
241
- interface LogoConfig {
242
- src?: string;
243
- width?: number;
244
- height?: number;
212
+ export interface LogoConfig {
213
+ src?: string;
214
+ width?: number;
215
+ height?: number;
245
216
  }
246
- interface NavigationConfig {
247
- apps?: AppsNavigationConfig[];
248
- collapsable?: boolean;
249
- pinned?: boolean;
250
- mode?: 'side' | 'over';
251
- opened?: boolean;
252
- fixedInViewport?: boolean;
253
- mobileQuery?: string;
217
+ export interface NavigationConfig {
218
+ apps?: AppsNavigationConfig[];
219
+ collapsable?: boolean;
220
+ pinned?: boolean;
221
+ mode?: 'side' | 'over';
222
+ opened?: boolean;
223
+ fixedInViewport?: boolean;
224
+ mobileQuery?: string;
254
225
  }
255
- type LanguagesConfig = Record<string, string>;
256
- interface i18nConfig {
257
- languages?: LanguagesConfig;
258
- defaultLanguage?: string;
226
+ export type LanguagesConfig = Record<string, string>;
227
+ export interface i18nConfig {
228
+ languages?: LanguagesConfig;
229
+ defaultLanguage?: string;
259
230
  }
260
- interface Oauth2Config {
261
- profileUrl?: string;
231
+ export interface Oauth2Config {
232
+ profileUrl?: string;
262
233
  }
263
- interface Config {
264
- navigation?: NavigationConfig;
265
- logo?: LogoConfig;
266
- i18n?: i18nConfig;
267
- oauth2?: Oauth2Config;
234
+ export interface Config {
235
+ navigation?: NavigationConfig;
236
+ logo?: LogoConfig;
237
+ i18n?: i18nConfig;
238
+ oauth2?: Oauth2Config;
268
239
  }
269
-
270
- declare function ProvideConfig(config?: Record<string, unknown>): {
271
- provide: i0.InjectionToken<unknown>;
272
- useValue: Record<string, unknown>;
240
+ export declare function ProvideConfig(config?: Record<string, unknown>): {
241
+ provide: import("@angular/core").InjectionToken<unknown>;
242
+ useValue: Record<string, unknown>;
273
243
  };
274
-
275
- declare const RXAP_CONFIG: InjectionToken<unknown>;
276
-
244
+ export declare const RXAP_CONFIG: InjectionToken<unknown>;
277
245
  /**
278
246
  * Similar to Promise.race() but only resolves with the first successful promise.
279
247
  * It will only reject if all promises reject.
280
248
  */
281
- declare function raceSuccess<T>(promises: Promise<T>[]): Promise<T>;
282
- declare function dnsResolver(endpoint: string, name: string, type: string): Promise<string>;
283
- declare const defaultDnsServers: string[];
284
- declare function dnsLookup(name: string, type: string, dnsServers?: string[]): Promise<string>;
285
- declare function fetchContentViaHttp(url: string): Observable<Blob | null>;
286
- type IpfsGatewayFunction = (cid: string) => string;
287
- declare const w3sIpfsGateway: IpfsGatewayFunction;
288
- declare const storachaIpfsGateway: IpfsGatewayFunction;
289
- declare const localPathIpfsGateway: IpfsGatewayFunction;
290
- declare const localSubDomainIpfsGateway: IpfsGatewayFunction;
291
- declare const defaultIpfsGatewayServers: Array<IpfsGatewayFunction>;
292
- declare function fetchCidContentViaHttp(cid: string, path?: string, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Observable<Blob | null>;
293
- declare function fetchCidContent(cid: string, path?: string, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Promise<Blob | null>;
294
- declare function fetchCidContentAsJson(cid: string, path?: string, _fetchCidContent?: typeof fetchCidContent, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Promise<any | null>;
295
-
296
- export { ConfigLoadMethod, ConfigLoaderService, ConfigLoadingStrategy, ConfigService, ConfigTestingService, ProvideConfig, RXAP_CONFIG, defaultConfigLoadErrorHandler, defaultDnsServers, defaultIpfsGatewayServers, dnsLookup, dnsResolver, fetchCidContent, fetchCidContentAsJson, fetchCidContentViaHttp, fetchContentViaHttp, localPathIpfsGateway, localSubDomainIpfsGateway, raceSuccess, showConfigLoadError, storachaIpfsGateway, w3sIpfsGateway };
297
- export type { AnySchema, AppsNavigationConfig, Config, ConfigLoadError, ConfigLoadErrorHandler, ConfigLoadErrorKind, ConfigLoadOptions, ConfigRequestOptions, IpfsGatewayFunction, Join, LanguagesConfig, Leaves, LogoConfig, NavigationConfig, NoInferType, Oauth2Config, Paths, i18nConfig };
249
+ export declare function raceSuccess<T>(promises: Promise<T>[]): Promise<T>;
250
+ export declare function dnsResolver(endpoint: string, name: string, type: string): Promise<string>;
251
+ export declare const defaultDnsServers: string[];
252
+ export declare function dnsLookup(name: string, type: string, dnsServers?: string[]): Promise<string>;
253
+ export declare function fetchContentViaHttp(url: string): Observable<Blob | null>;
254
+ export type IpfsGatewayFunction = (cid: string) => string;
255
+ export declare const w3sIpfsGateway: IpfsGatewayFunction;
256
+ export declare const storachaIpfsGateway: IpfsGatewayFunction;
257
+ export declare const localPathIpfsGateway: IpfsGatewayFunction;
258
+ export declare const localSubDomainIpfsGateway: IpfsGatewayFunction;
259
+ export declare const defaultIpfsGatewayServers: Array<IpfsGatewayFunction>;
260
+ export declare function fetchCidContentViaHttp(cid: string, path?: string, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Observable<Blob | null>;
261
+ export declare function fetchCidContent(cid: string, path?: string, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Promise<Blob | null>;
262
+ export declare function fetchCidContentAsJson(cid: string, path?: string, _fetchCidContent?: typeof fetchCidContent, ipfsGatewayServers?: Array<IpfsGatewayFunction>): Promise<any | null>;
263
+ export {};