Skip to content

pantoken-root / renderers/web-components/src / LocaleSet

Interface: LocaleSet<K> ​

Alpha

A typed subset of LocaleBundles. Created by createLocaleSet to constrain an app's supported locales at compile time — registering or retrieving a locale not in the set is a TypeScript error.

Type Parameters ​

K ​

K extends string

Properties ​

locales ​

readonly locales: readonly K[]

Alpha

The locale tags included in this set.

Methods ​

has() ​

has(locale): locale is K

Alpha

Type guard — true when locale is in this set.

Parameters ​

locale ​

string

Returns ​

locale is K


get() ​

get(locale): LocaleBundle

Alpha

Return the bundle for locale. Throws at runtime when called with an unknown locale.

Parameters ​

locale ​

K

Returns ​

LocaleBundle


register() ​

register(locale, target?, options?): void

Alpha

Register @pantoken/web-components elements with the given locale from this set.

Parameters ​

locale ​

K

target? ​

ElementRegistry

options? ​
prefix? ​

string | null

only? ​

readonly string[]

Returns ​

void