Lokalized JavaScript — Version 1.0.0
    Preparing search index...

    Interface Strings

    An immutable synchronous translation runtime returned by createStrings. Exactly one ambient locale supplier is consulted per lookup without overrides. Use getResult to retain locale selection, fallback attempts, and outcome.

    interface Strings {
        get: (
            key: string,
            placeholders?: Readonly<Record<string, unknown>>,
            callOptions?: Readonly<
                {
                    bidiIsolation?: BidiIsolation;
                    locale?: string;
                    localeMatchResult?: Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange:
                                | string
                                | Readonly<{ range: string; weight: number }>
                                | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly Readonly<
                                { range: string; weight: number },
                            >[];
                        },
                    >;
                    translationFailureHandler?: TranslationFailureHandler
                    | null;
                    translationFallbackObserver?: TranslationFallbackObserver | null;
                    translationFallbackPolicy?:
                        | TranslationFallbackPolicy
                        | BuiltinTranslationFallbackPolicy
                        | null;
                },
            >,
        ) => string;
        getCatalogIdentity: () => | Readonly<
            { catalogFingerprint: string; catalogVersion: string },
        >
        | null;
        getDirectLocaleContext: (
            locale: string,
        ) => Readonly<
            {
                localeMatchResult: Readonly<
                    Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange: string | WeightedLanguageRange | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly WeightedLanguageRange[];
                        },
                    >,
                >;
                lookupLocale: string;
            },
        >;
        getKeysForLocale: (locale: string) => readonly string[];
        getLoadVerification: () => | Readonly<
            Readonly<
                {
                    behavioralVectorsVersion: string;
                    cardinalityMode: "exact";
                    catalogIdentity: CatalogIdentity;
                    cldrVersion: string;
                    complete: boolean;
                    coverage: StringsLoadCoverage;
                    coveredLocales: readonly string[];
                    dataFingerprint: string;
                    ianaDataFingerprint: string;
                    ianaRegistryDate: string;
                    localeDataMode: "pinned";
                    manifestLocaleConfiguration: LocaleConfiguration;
                    plannedLocales: readonly string[];
                    producerImplementation: "lokalized-js";
                    producerVersion: string;
                    source: "verified-manifest-v1"
                    | "unverified-loaded-v1";
                },
            >,
        >
        | null;
        getLocaleConfiguration: () => Readonly<
            {
                fallbackLocale: string;
                supportedLocales: readonly string[];
                tiebreakerLocalesByLanguageCode: Readonly<
                    Record<string, readonly string[]>,
                >;
            },
        >;
        getMissingKeys: (
            sourceLocale: string,
            targetLocale: string,
        ) => readonly string[];
        getResult: (
            key: string,
            placeholders?: Readonly<Record<string, unknown>>,
            callOptions?: Readonly<
                {
                    bidiIsolation?: BidiIsolation;
                    locale?: string;
                    localeMatchResult?: Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange:
                                | string
                                | Readonly<{ range: string; weight: number }>
                                | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly Readonly<
                                { range: string; weight: number },
                            >[];
                        },
                    >;
                    translationFailureHandler?: TranslationFailureHandler
                    | null;
                    translationFallbackObserver?: TranslationFallbackObserver | null;
                    translationFallbackPolicy?:
                        | TranslationFallbackPolicy
                        | BuiltinTranslationFallbackPolicy
                        | null;
                },
            >,
        ) => | Readonly<
            {
                attemptedLocales: readonly string[];
                cause: null;
                failureReason: null;
                isFallback: boolean;
                key: string;
                localeMatchResult: Readonly<
                    Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange: string | WeightedLanguageRange | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly WeightedLanguageRange[];
                        },
                    >,
                >;
                lookupLocale: string;
                resolvedLocale: string;
                status: "translated";
                translation: string;
            },
        >
        | Readonly<
            {
                attemptedLocales: readonly string[];
                cause: unknown;
                failureReason: TranslationFailureReason;
                isFallback: boolean;
                key: string;
                localeMatchResult: Readonly<
                    Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange: string | WeightedLanguageRange | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly WeightedLanguageRange[];
                        },
                    >,
                >;
                lookupLocale: string;
                resolvedLocale: null;
                status: "returned-key"
                | "returned-string";
                translation: string;
            },
        >;
        getSupportedLocales: () => readonly string[];
        getWarnings: () => readonly Readonly<
            {
                key: string;
                locale: string;
                message: string;
                missingLanguageForms: readonly string[];
                placeholder: string;
                source: string;
                type: | "INCOMPLETE_CARDINALITY_TRANSLATIONS"
                | "INCOMPLETE_ORDINALITY_TRANSLATIONS";
            },
        >[];
        isCatalogComplete: () => boolean;
        t: (
            key: string,
            placeholders?: Readonly<Record<string, unknown>>,
            callOptions?: Readonly<
                {
                    bidiIsolation?: BidiIsolation;
                    locale?: string;
                    localeMatchResult?: Readonly<
                        {
                            consideredLocales: readonly string[];
                            effectiveWeight: number
                            | null;
                            fallbackLocale: string;
                            isMatch: boolean;
                            languageRange:
                                | string
                                | Readonly<{ range: string; weight: number }>
                                | null;
                            locale: string | null;
                            matchType:
                                | "none"
                                | "exact"
                                | "canonical"
                                | "cldr-fallback"
                                | "likely-subtag"
                                | "extended-range"
                                | "primary-language"
                                | "wildcard";
                            requestedLanguageRanges: readonly Readonly<
                                { range: string; weight: number },
                            >[];
                        },
                    >;
                    translationFailureHandler?: TranslationFailureHandler
                    | null;
                    translationFallbackObserver?: TranslationFallbackObserver | null;
                    translationFallbackPolicy?:
                        | TranslationFallbackPolicy
                        | BuiltinTranslationFallbackPolicy
                        | null;
                },
            >,
        ) => string;
    }
    Index
    get: (
        key: string,
        placeholders?: Readonly<Record<string, unknown>>,
        callOptions?: Readonly<
            {
                bidiIsolation?: BidiIsolation;
                locale?: string;
                localeMatchResult?: Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange:
                            | string
                            | Readonly<{ range: string; weight: number }>
                            | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly Readonly<
                            { range: string; weight: number },
                        >[];
                    },
                >;
                translationFailureHandler?: TranslationFailureHandler
                | null;
                translationFallbackObserver?: TranslationFallbackObserver | null;
                translationFallbackPolicy?:
                    | TranslationFallbackPolicy
                    | BuiltinTranslationFallbackPolicy
                    | null;
            },
        >,
    ) => string
    getCatalogIdentity: () => | Readonly<
        { catalogFingerprint: string; catalogVersion: string },
    >
    | null

    Return this catalog set's identity, or null if no identity was supplied.

    A manifest loader supplies the verified identity. Direct construction can carry a caller-supplied identity, which does not establish verified delivery.

    getDirectLocaleContext: (
        locale: string,
    ) => Readonly<
        {
            localeMatchResult: Readonly<
                Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange: string | WeightedLanguageRange | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly WeightedLanguageRange[];
                    },
                >,
            >;
            lookupLocale: string;
        },
    >

    Return the normalized lookup locale and its match against this instance's locale configuration. This does not render a string or consult an ambient locale supplier. The requested tag must be well formed.

    getKeysForLocale: (locale: string) => readonly string[]

    Return the keys in the catalog for the normalized locale tag, sorted by UTF-16 code unit order. The returned array is frozen.

    Inspection requires an exact loaded locale; it does not negotiate or use fallback catalogs. Throws UnsupportedLocaleError if that locale is not loaded.

    getLoadVerification: () => | Readonly<
        Readonly<
            {
                behavioralVectorsVersion: string;
                cardinalityMode: "exact";
                catalogIdentity: CatalogIdentity;
                cldrVersion: string;
                complete: boolean;
                coverage: StringsLoadCoverage;
                coveredLocales: readonly string[];
                dataFingerprint: string;
                ianaDataFingerprint: string;
                ianaRegistryDate: string;
                localeDataMode: "pinned";
                manifestLocaleConfiguration: LocaleConfiguration;
                plannedLocales: readonly string[];
                producerImplementation: "lokalized-js";
                producerVersion: string;
                source: "verified-manifest-v1"
                | "unverified-loaded-v1";
            },
        >,
    >
    | null

    The loader's verification record, or null for direct construction.

    getLocaleConfiguration: () => Readonly<
        {
            fallbackLocale: string;
            supportedLocales: readonly string[];
            tiebreakerLocalesByLanguageCode: Readonly<
                Record<string, readonly string[]>,
            >;
        },
    >
    getMissingKeys: (
        sourceLocale: string,
        targetLocale: string,
    ) => readonly string[]

    Return the source catalog keys absent from the target catalog, in sorted order, as a frozen array. Both tags are normalized and must identify exact loaded locales. Throws UnsupportedLocaleError if either locale is not loaded.

    getResult: (
        key: string,
        placeholders?: Readonly<Record<string, unknown>>,
        callOptions?: Readonly<
            {
                bidiIsolation?: BidiIsolation;
                locale?: string;
                localeMatchResult?: Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange:
                            | string
                            | Readonly<{ range: string; weight: number }>
                            | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly Readonly<
                            { range: string; weight: number },
                        >[];
                    },
                >;
                translationFailureHandler?: TranslationFailureHandler
                | null;
                translationFallbackObserver?: TranslationFallbackObserver | null;
                translationFallbackPolicy?:
                    | TranslationFallbackPolicy
                    | BuiltinTranslationFallbackPolicy
                    | null;
            },
        >,
    ) => | Readonly<
        {
            attemptedLocales: readonly string[];
            cause: null;
            failureReason: null;
            isFallback: boolean;
            key: string;
            localeMatchResult: Readonly<
                Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange: string | WeightedLanguageRange | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly WeightedLanguageRange[];
                    },
                >,
            >;
            lookupLocale: string;
            resolvedLocale: string;
            status: "translated";
            translation: string;
        },
    >
    | Readonly<
        {
            attemptedLocales: readonly string[];
            cause: unknown;
            failureReason: TranslationFailureReason;
            isFallback: boolean;
            key: string;
            localeMatchResult: Readonly<
                Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange: string | WeightedLanguageRange | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly WeightedLanguageRange[];
                    },
                >,
            >;
            lookupLocale: string;
            resolvedLocale: null;
            status: "returned-key"
            | "returned-string";
            translation: string;
        },
    >
    getSupportedLocales: () => readonly string[]
    getWarnings: () => readonly Readonly<
        {
            key: string;
            locale: string;
            message: string;
            missingLanguageForms: readonly string[];
            placeholder: string;
            source: string;
            type: | "INCOMPLETE_CARDINALITY_TRANSLATIONS"
            | "INCOMPLETE_ORDINALITY_TRANSLATIONS";
        },
    >[]

    Construction warnings, returned as a frozen array.

    isCatalogComplete: () => boolean

    Whether the loaded catalog set is complete. Direct construction returns true.

    t: (
        key: string,
        placeholders?: Readonly<Record<string, unknown>>,
        callOptions?: Readonly<
            {
                bidiIsolation?: BidiIsolation;
                locale?: string;
                localeMatchResult?: Readonly<
                    {
                        consideredLocales: readonly string[];
                        effectiveWeight: number
                        | null;
                        fallbackLocale: string;
                        isMatch: boolean;
                        languageRange:
                            | string
                            | Readonly<{ range: string; weight: number }>
                            | null;
                        locale: string | null;
                        matchType:
                            | "none"
                            | "exact"
                            | "canonical"
                            | "cldr-fallback"
                            | "likely-subtag"
                            | "extended-range"
                            | "primary-language"
                            | "wildcard";
                        requestedLanguageRanges: readonly Readonly<
                            { range: string; weight: number },
                        >[];
                    },
                >;
                translationFailureHandler?: TranslationFailureHandler
                | null;
                translationFallbackObserver?: TranslationFallbackObserver | null;
                translationFallbackPolicy?:
                    | TranslationFallbackPolicy
                    | BuiltinTranslationFallbackPolicy
                    | null;
            },
        >,
    ) => string