@sixbell-telco/sdk
Version:
A collection of reusable components designed for use in Sixbell Telco Angular projects
34 lines (33 loc) • 1.13 kB
TypeScript
import { RuntimeUpdateEvent } from '@sixbell-telco/sdk/utils/runtime-config';
import type { Observable } from 'rxjs';
/**
* Configuration options for the runtime translation provider.
*
* @property appId - Optional namespace to avoid cache collisions across MFEs
* @property sse - Optional SSE config for runtime update checks (disabled by default)
* @property updateStream - Optional Observable for runtime update checks (disabled by default)
*
* @example
* ```typescript
* // Default mode: Always fetch fresh translations with fallback to cache
* provideRuntimeTranslation('/assets/config/translation-config.json')
*
* // Custom caching mode
* provideRuntimeTranslation('/assets/config/translation-config.json', {
* loaderOptions: {
* freshOnNavigation: false,
* retries: 3,
* },
* })
* ```
*/
export interface RuntimeTranslationProviderOptions {
appId?: string;
sse?: {
url: string;
withCredentials?: boolean;
eventType?: string;
transform?: (event: MessageEvent) => RuntimeUpdateEvent | null;
};
updateStream?: Observable<RuntimeUpdateEvent>;
}