Skip to content

@i18n-micro/test-utils

36 exports across 2 entry points. Generated from the API snapshot that pnpm run api:surface checks against the TypeScript sources.

@i18n-micro/test-utils

ts
import { /* … */ } from '@i18n-micro/test-utils'
ExportKindSignature
defaultLocaleconst() => string | undefined
getLocaleconst() => string
getLocaleNameconst() => string | null
getLocalesconst() => Locale[]
getRouteNameconst(_route?: unknown, _locale?: string) => string
Gettertype(key: TranslationKey, params?: Record<string, string | number | boolean>, defaultValue?: string) => unknown
hasconst(key: TranslationKey) => boolean
i18nUtilsconst{ t: (key: TranslationKey, params?: Params, defaultValue?: string) => Translation; tc: (key: TranslationKey, params: number | Params, defaultValue?: string) => string; setTranslationsFromJson: (locale: string, translations: Record<string, unknown>) => Promise<void>; getLocale: () => string; setLocale: (val: string) => string; getLocaleName: () => string | null; setLocaleName: (val: string | null) => string | null; getLocales: () => Locale[]; setLocales: (val: Locale[]) => Locale[]; defaultLocale: () => string | undefined; setDefaultLocale: (val: string | undefined) => string | undefined; getRouteName: (_route?: unknown, _locale?: string) => string; settRouteName: (val: string) => string; ts: (key: TranslationKey, params?: Params, defaultValue?: string) => string; tn: (value: number, options?: Intl.NumberFormatOptions) => string; td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string; has: (key: TranslationKey) => boolean; mergeTranslations: (newTranslations: Translations) => void; resolveTranslations: () => Record<string, unknown>; setTranslation: (key: TranslationKey, value: unknown) => void; switchLocaleRoute: (val: string) => string; switchLocalePath: (val: string) => string; switchLocale: (val: string) => string; switchRoute: (_route: unknown, _toLocale?: string) => void; localeRoute: (_to: unknown, _locale?: string) => void; localePath: (_to: unknown, _locale?: string) => string; setI18nRouteParams: (_value: unknown) => void; }
localePathconst(_to: unknown, _locale?: string) => string
localeRouteconst(_to: unknown, _locale?: string) => void
mergeTranslationsconst(newTranslations: Translations) => void
resolveTranslationsconst() => Record<string, unknown>
setDefaultLocaleconst(val: string | undefined) => string | undefined
setI18nRouteParamsconst(_value: unknown) => void
setLocaleconst(val: string) => string
setLocaleNameconst(val: string | null) => string | null
setLocalesconst(val: Locale[]) => Locale[]
setTranslationconst(key: TranslationKey, value: unknown) => void
setTranslationsFromJsonfunction(locale: string, translations: Record<string, unknown>) => Promise<void>
settRouteNameconst(val: string) => string
switchLocaleconst(val: string) => string
switchLocalePathconst(val: string) => string
switchLocaleRouteconst(val: string) => string
switchRouteconst(_route: unknown, _toLocale?: string) => void
tfunction(key: TranslationKey, params?: Params, defaultValue?: string) => Translation
tcfunction(key: TranslationKey, params: number | Params, defaultValue?: string) => string
tdconst(value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string
tnconst(value: number, options?: Intl.NumberFormatOptions) => string
tsconst(key: TranslationKey, params?: Params, defaultValue?: string) => string

@i18n-micro/test-utils/publish-smoke

ts
import { /* … */ } from '@i18n-micro/test-utils/publish-smoke'
ExportKindSignature
ExportTargetinterface3 members
getLoadedModulefunction(mods: Record<string, Record<string, unknown>>, key: string) => Record<string, unknown>
loadResolvedExportfunction(item: ResolvedExport, packageRequire: NodeRequire) => Promise<Record<string, unknown>>
packageRootFromImportMetafunction(importMetaUrl: string, levelsUp?: number) => string
PublishFormattype'esm' | 'cjs'
resolveExportTargetsfunction(pkg: { exports?: unknown; }, targets: ExportTarget[], packageRoot: string) => ResolvedExport[]
smokeLoadExportsfunction(packageRoot: string, pkg: { exports?: unknown; }, targets: ExportTarget[]) => Promise<Record<string, Record<string, unknown>>>
ExportTarget — 3 members
MemberType
condition?"import" | "require" | "default" | undefined
formats?PublishFormat[] | undefined
subpathstring

Back to all packages · Integration guides

Released under the MIT License.