UNPKG

@artegoser/fluent

Version:

Better Fluent integration for JavaScript

30 lines (29 loc) 1.09 kB
import { FluentBundle } from '@fluent/bundle'; import { TranslationContext } from '../fluent'; export interface WarningHandler { handleWarning: (warning: Warning) => void; } export declare type Warning = (TranslateBundleMissingMessageWarning | TranslateMessageMissingAttributeWarning | TranslateMissingTranslationWarning); export interface BaseWarning { type: string; } export interface TranslateWarning extends BaseWarning { locales: string[]; path: string; matchedBundles: Set<FluentBundle>; context?: TranslationContext; } export interface TranslateBundleMissingMessageWarning extends TranslateWarning { type: 'translate.bundle.missing-message'; messageId: string; bundle: FluentBundle; } export interface TranslateMessageMissingAttributeWarning extends TranslateWarning { type: 'translate.message.missing-attribute'; messageId: string; attributeName: string; bundle: FluentBundle; } export interface TranslateMissingTranslationWarning extends TranslateWarning { type: 'translate.missing-translation'; }